##// END OF EJS Templates
manifestcache: support multiple cache addition in one debug command run...
marmoute -
r42124:1fe278aa default
parent child Browse files
Show More
@@ -1460,10 +1460,10 b' def debuglocks(ui, repo, **opts):'
1460
1460
1461 @command('debugmanifestfulltextcache', [
1461 @command('debugmanifestfulltextcache', [
1462 ('', 'clear', False, _('clear the cache')),
1462 ('', 'clear', False, _('clear the cache')),
1463 ('a', 'add', '', _('add the given manifest node to the cache'),
1463 ('a', 'add', [], _('add the given manifest nodes to the cache'),
1464 _('NODE'))
1464 _('NODE'))
1465 ], '')
1465 ], '')
1466 def debugmanifestfulltextcache(ui, repo, add=None, **opts):
1466 def debugmanifestfulltextcache(ui, repo, add=(), **opts):
1467 """show, clear or amend the contents of the manifest fulltext cache"""
1467 """show, clear or amend the contents of the manifest fulltext cache"""
1468
1468
1469 def getcache():
1469 def getcache():
@@ -1483,9 +1483,11 b' def debugmanifestfulltextcache(ui, repo,'
1483
1483
1484 if add:
1484 if add:
1485 with repo.lock():
1485 with repo.lock():
1486 m = repo.manifestlog
1487 store = m.getstorage(b'')
1488 for n in add:
1486 try:
1489 try:
1487 m = repo.manifestlog
1490 manifest = m[store.lookup(n)]
1488 manifest = m[m.getstorage(b'').lookup(add)]
1489 except error.LookupError as e:
1491 except error.LookupError as e:
1490 raise error.Abort(e, hint="Check your manifest node id")
1492 raise error.Abort(e, hint="Check your manifest node id")
1491 manifest.read() # stores revisision in cache too
1493 manifest.read() # stores revisision in cache too
@@ -148,3 +148,13 b' Check cache clearing'
148 $ hg debugmanifestfulltextcache --clear
148 $ hg debugmanifestfulltextcache --clear
149 $ hg debugmanifestfulltextcache
149 $ hg debugmanifestfulltextcache
150 cache empty
150 cache empty
151
152 Check adding multiple entry in one go:
153
154 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
155 $ hg debugmanifestfulltextcache
156 cache contains 2 manifest entries, in order of most to least recent:
157 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
158 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
159 total cache data size 268 bytes, on-disk 268 bytes
160 $ hg debugmanifestfulltextcache --clear
General Comments 0
You need to be logged in to leave comments. Login now