Previous patch from Matt demonstrates that debugtagscache does not warn about
filenode being unknown which can be caused by a corrupted cache.
We start by showing that it's an unknown node.
( )
Alphare | |
marmoute |
hg-reviewers |
Previous patch from Matt demonstrates that debugtagscache does not warn about
filenode being unknown which can be caused by a corrupted cache.
We start by showing that it's an unknown node.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (4 lines) | |||
M | tests/test-tags.t (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
a4b60fd503bb | 9f29b3633710 | Pulkit Goyal | Feb 15 2021, 6:38 AM |
def debugtagscache(ui, repo): | def debugtagscache(ui, repo): | ||||
"""display the contents of .hg/cache/hgtagsfnodes1""" | """display the contents of .hg/cache/hgtagsfnodes1""" | ||||
cache = tagsmod.hgtagsfnodescache(repo.unfiltered()) | cache = tagsmod.hgtagsfnodescache(repo.unfiltered()) | ||||
for r in repo: | for r in repo: | ||||
node = repo[r].node() | node = repo[r].node() | ||||
tagsnode = cache.getfnode(node, computemissing=False) | tagsnode = cache.getfnode(node, computemissing=False) | ||||
if tagsnode: | if tagsnode: | ||||
tagsnodedisplay = hex(tagsnode) | tagsnodedisplay = hex(tagsnode) | ||||
try: | |||||
repo.filectx(b'.hgtags', fileid=tagsnode).data() | |||||
except error.LookupError: | |||||
tagsnodedisplay += b' (invalid node)' | |||||
elif tagsnode is None: | elif tagsnode is None: | ||||
tagsnodedisplay = b'missing' | tagsnodedisplay = b'missing' | ||||
else: | else: | ||||
tagsnodedisplay = b'invalid' | tagsnodedisplay = b'invalid' | ||||
ui.write(b'%d %s %s\n' % (r, hex(node), tagsnodedisplay)) | ui.write(b'%d %s %s\n' % (r, hex(node), tagsnodedisplay)) | ||||
0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.| | 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.| | ||||
0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..| | 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..| | ||||
0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(| | 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(| | ||||
0070: 78 ee 5a 2d ad bc 94 3d 8d bf e6 0e 0c 04 f2 a8 |x.Z-...=........| | 0070: 78 ee 5a 2d ad bc 94 3d 8d bf e6 0e 0c 04 f2 a8 |x.Z-...=........| | ||||
0080: de ad de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |......B(x.Z-...=| | 0080: de ad de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |......B(x.Z-...=| | ||||
$ hg debugtagscache | tail -2 | $ hg debugtagscache | tail -2 | ||||
4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d | 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d | ||||
5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d | 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d (invalid node) | ||||
$ rm -f .hg/cache/tags2-visible | $ rm -f .hg/cache/tags2-visible | ||||
$ hg debugtagscache | tail -2 | $ hg debugtagscache | tail -2 | ||||
4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d | 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d | ||||
5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d | 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d (invalid node) | ||||
$ hg tags | $ hg tags | ||||
abort: data/.hgtags.i@0c04f2a8deadde17fab7422878ee5a2dadbc943d: no match found | abort: data/.hgtags.i@0c04f2a8deadde17fab7422878ee5a2dadbc943d: no match found | ||||
[50] | [50] | ||||
BUG: Unless this file is restored, the `hg tags` in the next unix-permissions | BUG: Unless this file is restored, the `hg tags` in the next unix-permissions | ||||
conditional will fail: "abort: data/.hgtags.i@0c04f2a8dead: no match found" | conditional will fail: "abort: data/.hgtags.i@0c04f2a8dead: no match found" | ||||