diff mercurial/debugcommands.py @ 44309:6c07480d6659

nodemap: add a function to read the data from disk This changeset is small and mostly an excuse to introduce an API function reading the data from disk. Differential Revision: https://phab.mercurial-scm.org/D7836
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:47:31 +0100
parents c577bb4a04d4
children 20e125cdd719
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed Jan 15 15:47:21 2020 +0100
+++ b/mercurial/debugcommands.py	Wed Jan 15 15:47:31 2020 +0100
@@ -2086,16 +2086,29 @@
 
 @command(
     b'debugnodemap',
-    [(b'', b'dump', False, _(b'write persistent binary nodemap on stdin'))],
+    [
+        (
+            b'',
+            b'dump-new',
+            False,
+            _(b'write a (new) persistent binary nodemap on stdin'),
+        ),
+        (b'', b'dump-disk', False, _(b'dump on-disk data on stdin')),
+    ],
 )
 def debugnodemap(ui, repo, **opts):
     """write and inspect on disk nodemap
     """
-    if opts['dump']:
+    if opts['dump_new']:
         unfi = repo.unfiltered()
         cl = unfi.changelog
         data = nodemap.persistent_data(cl.index)
         ui.write(data)
+    elif opts['dump_disk']:
+        unfi = repo.unfiltered()
+        cl = unfi.changelog
+        data = nodemap.persisted_data(cl)
+        ui.write(data)
 
 
 @command(