Patchwork [8,of,8,"] manifestcache: use `wcache` directory for manifest cache

login
register
mail settings
Submitter Pierre-Yves David
Date March 16, 2019, 10:36 a.m.
Message ID <7d84ef5895b397ffd55f.1552732589@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39291/
State Accepted
Headers show

Comments

Pierre-Yves David - March 16, 2019, 10:36 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1552524011 0
#      Thu Mar 14 00:40:11 2019 +0000
# Node ID 7d84ef5895b397ffd55f555805a70ba7011851de
# Parent  027c8ee15982b19da2adc5f116211ce5587e23f8
# EXP-Topic manifestcache
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 7d84ef5895b3
manifestcache: use `wcache` directory for manifest cache

The manifest full text cache is tightly related to the working copy. We should
use the `wcache` directory for it, instead of the `cache`. Otherwise, multiple
shares would keep overwriting each other cache entry and we loose its benefit.

This is also more consistent with the fact this cache file is protected by
`wlock`.

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1438,7 +1438,7 @@  class manifestrevlog(object):
         if not util.safehasattr(repo, '_wlockref'):
             return
 
-        self._fulltextcache._opener = repo.cachevfs
+        self._fulltextcache._opener = repo.wcachevfs
         if repo._currentlock(repo._wlockref) is None:
             return
 
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -43,7 +43,6 @@  Trigger branchcache creation:
   default                       10:a7949464abda
   $ ls .hg/cache
   branch2-served
-  manifestfulltextcache (reporevlogstore !)
   rbc-names-v1
   rbc-revs-v1
 
@@ -58,7 +57,6 @@  Ensure branchcache got copied over:
 
   $ ls .hg/cache
   branch2-served
-  manifestfulltextcache
   rbc-names-v1
   rbc-revs-v1
 
diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t
--- a/tests/test-debugcommands.t
+++ b/tests/test-debugcommands.t
@@ -545,7 +545,6 @@  Test cache warming command
   .hg/cache/tags2
   .hg/cache/rbc-revs-v1
   .hg/cache/rbc-names-v1
-  .hg/cache/manifestfulltextcache (reporevlogstore !)
   .hg/cache/branch2-served
 
 Test debugcolor
diff --git a/tests/test-fncache.t b/tests/test-fncache.t
--- a/tests/test-fncache.t
+++ b/tests/test-fncache.t
@@ -88,7 +88,6 @@  Non store repo:
   .hg/00manifest.i
   .hg/cache
   .hg/cache/branch2-served
-  .hg/cache/manifestfulltextcache (reporevlogstore !)
   .hg/cache/rbc-names-v1
   .hg/cache/rbc-revs-v1
   .hg/data
@@ -111,6 +110,7 @@  Non store repo:
   .hg/wcache/checkisexec (execbit !)
   .hg/wcache/checklink (symlink !)
   .hg/wcache/checklink-target (symlink !)
+  .hg/wcache/manifestfulltextcache (reporevlogstore !)
   $ cd ..
 
 Non fncache repo:
@@ -126,7 +126,6 @@  Non fncache repo:
   .hg/00changelog.i
   .hg/cache
   .hg/cache/branch2-served
-  .hg/cache/manifestfulltextcache (reporevlogstore !)
   .hg/cache/rbc-names-v1
   .hg/cache/rbc-revs-v1
   .hg/dirstate
@@ -152,6 +151,7 @@  Non fncache repo:
   .hg/wcache/checkisexec (execbit !)
   .hg/wcache/checklink (symlink !)
   .hg/wcache/checklink-target (symlink !)
+  .hg/wcache/manifestfulltextcache (reporevlogstore !)
   $ cd ..
 
 Encoding of reserved / long paths in the store
diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t
--- a/tests/test-hardlinks.t
+++ b/tests/test-hardlinks.t
@@ -239,7 +239,6 @@  r4 has hardlinks in the working dir (not
   2 r4/.hg/branch
   2 r4/.hg/cache/branch2-base
   2 r4/.hg/cache/branch2-served
-  2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
   2 r4/.hg/cache/rbc-names-v1
   2 r4/.hg/cache/rbc-revs-v1
   2 r4/.hg/dirstate
@@ -268,6 +267,7 @@  r4 has hardlinks in the working dir (not
   2 r4/.hg/wcache/checkisexec (execbit !)
   2 r4/.hg/wcache/checklink-target (symlink !)
   2 r4/.hg/wcache/checknoexec (execbit !)
+  2 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
   2 r4/d1/data1
   2 r4/d1/f2
   2 r4/f1
@@ -290,7 +290,6 @@  Update back to revision 12 in r4 should 
   1 r4/.hg/branch
   2 r4/.hg/cache/branch2-base
   2 r4/.hg/cache/branch2-served
-  1 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
   2 r4/.hg/cache/rbc-names-v1
   2 r4/.hg/cache/rbc-revs-v1
   1 r4/.hg/dirstate
@@ -319,6 +318,7 @@  Update back to revision 12 in r4 should 
   2 r4/.hg/wcache/checkisexec (execbit !)
   2 r4/.hg/wcache/checklink-target (symlink !)
   2 r4/.hg/wcache/checknoexec (execbit !)
+  1 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
   2 r4/d1/data1
   2 r4/d1/f2
   1 r4/f1
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
@@ -71,7 +71,6 @@  new directories are setgid
   00600 ./.hg/00changelog.i
   00770 ./.hg/cache/
   00660 ./.hg/cache/branch2-served
-  00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !)
   00660 ./.hg/cache/rbc-names-v1
   00660 ./.hg/cache/rbc-revs-v1
   00660 ./.hg/dirstate
@@ -105,6 +104,7 @@  new directories are setgid
   00711 ./.hg/wcache/checkisexec
   007.. ./.hg/wcache/checklink (re)
   00600 ./.hg/wcache/checklink-target
+  00660 ./.hg/wcache/manifestfulltextcache (reporevlogstore !)
   00700 ./dir/
   00600 ./dir/bar
   00600 ./foo
diff --git a/tests/test-share.t b/tests/test-share.t
--- a/tests/test-share.t
+++ b/tests/test-share.t
@@ -34,9 +34,9 @@  share shouldn't have a full cache dir, o
   checkisexec (execbit !)
   checklink (symlink !)
   checklink-target (symlink !)
+  manifestfulltextcache (reporevlogstore !)
   $ ls -1 ../repo1/.hg/cache
   branch2-served
-  manifestfulltextcache (reporevlogstore !)
   rbc-names-v1
   rbc-revs-v1
   tags2-visible
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -1264,6 +1264,7 @@  Check that share works with subrepo
   ../shared/subrepo-2/.hg/wcache/checkisexec (execbit !)
   ../shared/subrepo-2/.hg/wcache/checklink (symlink !)
   ../shared/subrepo-2/.hg/wcache/checklink-target (symlink !)
+  ../shared/subrepo-2/.hg/wcache/manifestfulltextcache (reporevlogstore !)
   ../shared/subrepo-2/file
   $ hg -R ../shared in
   abort: repository default not found!