diff mercurial/debugcommands.py @ 44290:d8b53385b1bc

tags: add a debug command to display .hg/cache/hgtagsfnodes1 Differential Revision: https://phab.mercurial-scm.org/D8093
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Fri, 07 Feb 2020 13:54:09 -0500
parents 0b475b0b0344
children a0ec05d93c8e
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Sat Feb 08 10:22:47 2020 -0500
+++ b/mercurial/debugcommands.py	Fri Feb 07 13:54:09 2020 -0500
@@ -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',