##// END OF EJS Templates
manifestcache: protect write with `wlock` instead of `lock`...
marmoute -
r42130:d1218230 default
parent child Browse files
Show More
@@ -1476,13 +1476,13 b' def debugmanifestfulltextcache(ui, repo,'
1476 raise error.Abort(msg)
1476 raise error.Abort(msg)
1477
1477
1478 if opts.get(r'clear'):
1478 if opts.get(r'clear'):
1479 with repo.lock():
1479 with repo.wlock():
1480 cache = getcache()
1480 cache = getcache()
1481 cache.clear(clear_persisted_data=True)
1481 cache.clear(clear_persisted_data=True)
1482 return
1482 return
1483
1483
1484 if add:
1484 if add:
1485 with repo.lock():
1485 with repo.wlock():
1486 m = repo.manifestlog
1486 m = repo.manifestlog
1487 store = m.getstorage(b'')
1487 store = m.getstorage(b'')
1488 for n in add:
1488 for n in add:
@@ -1435,11 +1435,11 b' class manifestrevlog(object):'
1435
1435
1436 def _setupmanifestcachehooks(self, repo):
1436 def _setupmanifestcachehooks(self, repo):
1437 """Persist the manifestfulltextcache on lock release"""
1437 """Persist the manifestfulltextcache on lock release"""
1438 if not util.safehasattr(repo, '_lockref'):
1438 if not util.safehasattr(repo, '_wlockref'):
1439 return
1439 return
1440
1440
1441 self._fulltextcache._opener = repo.cachevfs
1441 self._fulltextcache._opener = repo.cachevfs
1442 if repo._currentlock(repo._lockref) is None:
1442 if repo._currentlock(repo._wlockref) is None:
1443 return
1443 return
1444
1444
1445 reporef = weakref.ref(repo)
1445 reporef = weakref.ref(repo)
@@ -58,6 +58,7 b' Ensure branchcache got copied over:'
58
58
59 $ ls .hg/cache
59 $ ls .hg/cache
60 branch2-served
60 branch2-served
61 manifestfulltextcache
61 rbc-names-v1
62 rbc-names-v1
62 rbc-revs-v1
63 rbc-revs-v1
63
64
@@ -290,7 +290,7 b' Update back to revision 12 in r4 should '
290 1 r4/.hg/branch
290 1 r4/.hg/branch
291 2 r4/.hg/cache/branch2-base
291 2 r4/.hg/cache/branch2-base
292 2 r4/.hg/cache/branch2-served
292 2 r4/.hg/cache/branch2-served
293 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
293 1 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
294 2 r4/.hg/cache/rbc-names-v1
294 2 r4/.hg/cache/rbc-names-v1
295 2 r4/.hg/cache/rbc-revs-v1
295 2 r4/.hg/cache/rbc-revs-v1
296 1 r4/.hg/dirstate
296 1 r4/.hg/dirstate
@@ -106,7 +106,9 b' Reminder of the manifest log content'
106 Showing the content of the caches after the above operations
106 Showing the content of the caches after the above operations
107
107
108 $ hg debugmanifestfulltextcache
108 $ hg debugmanifestfulltextcache
109 cache empty
109 cache contains 1 manifest entries, in order of most to least recent:
110 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
111 total cache data size 157 bytes, on-disk 157 bytes
110
112
111 (Clearing the cache in case of any content)
113 (Clearing the cache in case of any content)
112
114
@@ -183,3 +185,19 b' Commit should have the new node cached:'
183 $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:'
185 $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:'
184 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
186 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
185 manifest: 2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65
187 manifest: 2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65
188
189 hg update should warm the cache too
190
191 (force dirstate check to avoid flackiness in manifest order)
192 $ hg debugrebuilddirstate
193
194 $ hg update 0
195 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
196 $ hg debugmanifestfulltextcache
197 cache contains 3 manifest entries, in order of most to least recent:
198 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
199 id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
200 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
201 total cache data size 425 bytes, on-disk 425 bytes
202 $ hg log -r '0' --debug | grep 'manifest:'
203 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf
General Comments 0
You need to be logged in to leave comments. Login now