diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3010,6 +3010,8 @@ def createrepository(ui, path, createopt wdirvfs.makedirs() hgvfs.makedir(notindexed=True) + if 'sharedrepo' not in createopts: + hgvfs.mkdir(b'cache') if b'store' in requirements and 'sharedrepo' not in createopts: hgvfs.mkdir(b'store') diff --git a/tests/test-empty.t b/tests/test-empty.t --- a/tests/test-empty.t +++ b/tests/test-empty.t @@ -20,6 +20,7 @@ Check the basic files created: $ ls .hg 00changelog.i + cache requires store diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t --- a/tests/test-inherit-mode.t +++ b/tests/test-inherit-mode.t @@ -42,7 +42,7 @@ just in case somebody has a strange $TMP $ hg init repo $ cd repo - $ chmod 0770 .hg/store + $ chmod 0770 .hg/store .hg/cache before commit store can be written by the group, other files cannot @@ -51,6 +51,7 @@ store is setgid $ "$PYTHON" ../printmodes.py . 00700 ./.hg/ 00600 ./.hg/00changelog.i + 00770 ./.hg/cache/ 00600 ./.hg/requires 00770 ./.hg/store/ @@ -116,6 +117,7 @@ group can write everything $ "$PYTHON" ../printmodes.py ../push 00770 ../push/.hg/ 00660 ../push/.hg/00changelog.i + 00770 ../push/.hg/cache/ 00660 ../push/.hg/requires 00770 ../push/.hg/store/