cache: create `wcache` directory at init time
The cache directory will be needed very quickly, so it seems simpler to create
it early to make sure it has the same owner and permission than the other
directory in the repository.
--- a/mercurial/localrepo.py Thu Nov 15 02:38:55 2018 +0100
+++ b/mercurial/localrepo.py Thu Nov 15 02:46:31 2018 +0100
@@ -3012,6 +3012,7 @@
hgvfs.makedir(notindexed=True)
if 'sharedrepo' not in createopts:
hgvfs.mkdir(b'cache')
+ hgvfs.mkdir(b'wcache')
if b'store' in requirements and 'sharedrepo' not in createopts:
hgvfs.mkdir(b'store')
--- a/tests/test-bundle.t Thu Nov 15 02:38:55 2018 +0100
+++ b/tests/test-bundle.t Thu Nov 15 02:46:31 2018 +0100
@@ -212,6 +212,7 @@
cache
requires
store
+ wcache
Pull ../full.hg into empty (with hook)
--- a/tests/test-empty.t Thu Nov 15 02:38:55 2018 +0100
+++ b/tests/test-empty.t Thu Nov 15 02:46:31 2018 +0100
@@ -23,6 +23,7 @@
cache
requires
store
+ wcache
Should be empty:
--- a/tests/test-inherit-mode.t Thu Nov 15 02:38:55 2018 +0100
+++ b/tests/test-inherit-mode.t Thu Nov 15 02:46:31 2018 +0100
@@ -42,7 +42,7 @@
$ hg init repo
$ cd repo
- $ chmod 0770 .hg/store .hg/cache
+ $ chmod 0770 .hg/store .hg/cache .hg/wcache
before commit
store can be written by the group, other files cannot
@@ -54,6 +54,7 @@
00770 ./.hg/cache/
00600 ./.hg/requires
00770 ./.hg/store/
+ 00770 ./.hg/wcache/
$ mkdir dir
$ touch foo dir/bar
@@ -120,6 +121,7 @@
00770 ../push/.hg/cache/
00660 ../push/.hg/requires
00770 ../push/.hg/store/
+ 00770 ../push/.hg/wcache/
$ umask 077
$ hg -q push ../push
@@ -155,6 +157,7 @@
00660 ../push/.hg/undo.branch
00660 ../push/.hg/undo.desc
00660 ../push/.hg/undo.dirstate
+ 00770 ../push/.hg/wcache/
Test that we don't lose the setgid bit when we call chmod.
--- a/tests/test-subrepo.t Thu Nov 15 02:38:55 2018 +0100
+++ b/tests/test-subrepo.t Thu Nov 15 02:46:31 2018 +0100
@@ -1242,6 +1242,7 @@
../shared/subrepo-1/.hg/hgrc
../shared/subrepo-1/.hg/requires
../shared/subrepo-1/.hg/sharedpath
+ ../shared/subrepo-1/.hg/wcache
../shared/subrepo-2
../shared/subrepo-2/.hg
../shared/subrepo-2/.hg/branch