diff mercurial/repair.py @ 34144:91f0677dc920 stable

repair: preserve phase also when not using generaldelta (issue5678) It seems like we used to pick the oldest possible version of the changegroup to use for bundles created by the repair module (used e.g. by "hg strip" and for temporary bundles by "hg rebase"). I tried to preserve that behavior when I created the changegroup.safeversion() method in 3b2ac2115464 (changegroup: introduce safeversion(), 2016-01-19). However, we have recently chagned our minds and decided that these commands are only used locally and downgrades are unlikely. That decicion allowed us to start adding obsmarker and phase information to these bundles. However, as the bug report shows, it means we get different behavior e.g. when generaldelta is not enabled (because when it was enabled, it forced us to use bundle2). The commit that actually caused the reported bug was 8e3021fd1a44 (strip: include phases in bundle (BC), 2017-06-15). So, since we now depend on having more information in the bundles, let's make sure we instead pick the newest possible changegroup version. Differential Revision: https://phab.mercurial-scm.org/D715
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Sep 2017 11:16:57 -0700
parents 902fe63954a9
children 2844c4bd5a39
line wrap: on
line diff
--- a/mercurial/repair.py	Thu Sep 14 11:16:47 2017 -0700
+++ b/mercurial/repair.py	Thu Sep 14 11:16:57 2017 -0700
@@ -38,7 +38,7 @@
     totalhash = hashlib.sha1(''.join(allhashes)).hexdigest()
     name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)
 
-    cgversion = changegroup.safeversion(repo)
+    cgversion = changegroup.localversion(repo)
     comp = None
     if cgversion != '01':
         bundletype = "HG20"