Patchwork D8163: nodemap: use data from the index in debugnodemap --dump-new

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2020, 5:37 p.m.
Message ID <differential-rev-PHID-DREV-bo7zagoo63aam6iu6njg-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45344/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2020, 5:37 p.m.
Alphare created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It is better to run the actual code when generating a new nodemap cache from
  scratch. So we do.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8163

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2114,7 +2114,10 @@ 
     if opts['dump_new']:
         unfi = repo.unfiltered()
         cl = unfi.changelog
-        data = nodemap.persistent_data(cl.index)
+        if util.safehasattr(cl.index, "nodemap_data_all"):
+            data = cl.index.nodemap_data_all()
+        else:
+            data = nodemap.persistent_data(cl.index)
         ui.write(data)
     elif opts['dump_disk']:
         unfi = repo.unfiltered()