Show More
@@ -1460,10 +1460,10 b' def debuglocks(ui, repo, **opts):' | |||
|
1460 | 1460 | |
|
1461 | 1461 | @command('debugmanifestfulltextcache', [ |
|
1462 | 1462 | ('', 'clear', False, _('clear the cache')), |
|
1463 |
('a', 'add', |
|
|
1463 | ('a', 'add', [], _('add the given manifest nodes to the cache'), | |
|
1464 | 1464 | _('NODE')) |
|
1465 | 1465 | ], '') |
|
1466 |
def debugmanifestfulltextcache(ui, repo, add= |
|
|
1466 | def debugmanifestfulltextcache(ui, repo, add=(), **opts): | |
|
1467 | 1467 | """show, clear or amend the contents of the manifest fulltext cache""" |
|
1468 | 1468 | |
|
1469 | 1469 | def getcache(): |
@@ -1483,9 +1483,11 b' def debugmanifestfulltextcache(ui, repo,' | |||
|
1483 | 1483 | |
|
1484 | 1484 | if add: |
|
1485 | 1485 | with repo.lock(): |
|
1486 | m = repo.manifestlog | |
|
1487 | store = m.getstorage(b'') | |
|
1488 | for n in add: | |
|
1486 | 1489 | try: |
|
1487 |
m = re |
|
|
1488 | manifest = m[m.getstorage(b'').lookup(add)] | |
|
1490 | manifest = m[store.lookup(n)] | |
|
1489 | 1491 | except error.LookupError as e: |
|
1490 | 1492 | raise error.Abort(e, hint="Check your manifest node id") |
|
1491 | 1493 | manifest.read() # stores revisision in cache too |
@@ -148,3 +148,13 b' Check cache clearing' | |||
|
148 | 148 | $ hg debugmanifestfulltextcache --clear |
|
149 | 149 | $ hg debugmanifestfulltextcache |
|
150 | 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