diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -76,6 +76,7 @@ sshpeer, sslutil, streamclone, + tags as tagsmod, templater, treediscovery, upgrade, @@ -3428,6 +3429,15 @@ ui.write(node2str(node)) ui.write(b'\n') +@command(b'debugtagscache', []) +def debugtagscache(ui, repo): + """display the contents of .hg/cache/hgtagsfnodes1""" + cache = tagsmod.hgtagsfnodescache(repo.unfiltered()) + for r in repo: + node = repo[r].node() + tagsnode = cache.getfnode(node, computemissing=False) + tagsnodedisplay = hex(tagsnode) if tagsnode else 'missing/invalid' + ui.write(b'%s %s %s\n' % (r, hex(node), tagsnodedisplay)) @command( b'debugtemplate', diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -128,6 +128,7 @@ debugssl debugsub debugsuccessorssets + debugtagscache debugtemplate debuguigetpass debuguiprompt @@ -310,6 +311,7 @@ debugssl: debugsub: rev debugsuccessorssets: closest + debugtagscache: debugtemplate: rev, define debuguigetpass: prompt debuguiprompt: prompt diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -1055,6 +1055,8 @@ debugsub (no help text available) debugsuccessorssets show set of successors for revision + debugtagscache + display the contents of .hg/cache/hgtagsfnodes1 debugtemplate parse and apply a template debuguigetpass diff --git a/tests/test-tags.t b/tests/test-tags.t --- a/tests/test-tags.t +++ b/tests/test-tags.t @@ -103,6 +103,9 @@ 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| + $ hg debugtagscache + 0 acb14030fe0a21b60322c440ad2d20cf7685a376 missing/invalid + 1 b9154636be938d3d431e75a7c906504a079bfe07 26b7b4a773e09ee3c52f510e19e05e1ff966d859 Repeat with cold tag cache: