[Updated] D9991: upgrade: write nodemap for manifests too
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Wed Feb 24 15:54:40 UTC 2021
Closed by commit rHG636853347e14: upgrade: write nodemap for manifests too (authored by pulkit).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D9991?vs=25627&id=25811
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D9991/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D9991
AFFECTED FILES
mercurial/upgrade_utils/engine.py
tests/test-persistent-nodemap.t
CHANGE DETAILS
diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t
--- a/tests/test-persistent-nodemap.t
+++ b/tests/test-persistent-nodemap.t
@@ -641,6 +641,8 @@
$ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
00changelog-*.nd (glob)
00changelog.n
+ 00manifest-*.nd (glob)
+ 00manifest.n
$ hg debugnodemap --metadata
uid: * (glob)
diff --git a/mercurial/upgrade_utils/engine.py b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -468,6 +468,13 @@
unfi = srcrepo.unfiltered()
cl = unfi.changelog
nodemap.persist_nodemap(tr, cl, force=True)
+ # we want to directly operate on the underlying revlog to force
+ # create a nodemap file. This is fine since this is upgrade code
+ # and it heavily relies on repository being revlog based
+ # hence accessing private attributes can be justified
+ nodemap.persist_nodemap(
+ tr, unfi.manifestlog._rootstore._revlog, force=True
+ )
scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
else:
with dstrepo.transaction(b'upgrade') as tr:
To: pulkit, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210224/b4330312/attachment-0002.html>
More information about the Mercurial-patches
mailing list