diff mercurial/debugcommands.py @ 49215:22279b604a88

fix-ci: backed out changeset 308e45f7b455 The chg variant of the CI see a failure on `tests/test-narrow-pull.t`. Bisecting point the failure as starting at this small changeset? Backing it out, restore the CI on default. It was never broken on stable, which is even more puzzling.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 16 May 2022 23:12:49 +0100
parents a932cad26d37
children 883be4c74d54
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue May 17 12:05:09 2022 +0100
+++ b/mercurial/debugcommands.py	Mon May 16 23:12:49 2022 +0100
@@ -1017,6 +1017,22 @@
 
 
 @command(
+    b'debugdirstateignorepatternshash',
+    [],
+    _(b''),
+)
+def debugdirstateignorepatternshash(ui, repo, **opts):
+    """show the hash of ignore patterns stored in dirstate if v2,
+    or nothing for dirstate-v2
+    """
+    if repo.dirstate._use_dirstate_v2:
+        docket = repo.dirstate._map.docket
+        hash_len = 20  # 160 bits for SHA-1
+        hash_bytes = docket.tree_metadata[-hash_len:]
+        ui.write(binascii.hexlify(hash_bytes) + b'\n')
+
+
+@command(
     b'debugdiscovery',
     [
         (b'', b'old', None, _(b'use old-style discovery')),