# HG changeset patch # User Valentin Gatien-Baron # Date 2020-02-07 18:54:09 # Node ID d8b53385b1bcae3b2d8db2a0bb777b0dd1b1e4ad # Parent 9f8eddd2723f9ad7367714eb555300c77e0f7478 tags: add a debug command to display .hg/cache/hgtagsfnodes1 Differential Revision: https://phab.mercurial-scm.org/D8093 diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -76,6 +76,7 @@ from . import ( sshpeer, sslutil, streamclone, + tags as tagsmod, templater, treediscovery, upgrade, @@ -3428,6 +3429,15 @@ def debugsuccessorssets(ui, repo, *revs, 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 @@ Show debug commands if there are no othe debugssl debugsub debugsuccessorssets + debugtagscache debugtemplate debuguigetpass debuguiprompt @@ -310,6 +311,7 @@ Show all commands + options 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 @@ Test list of internal help commands 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 @@ The cache should have an empty entry for 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: