Patchwork [3,of,3] upgrade: clarify "aggressivemergedelta" handling

login
register
mail settings
Submitter Boris Feld
Date Dec. 2, 2018, 3:56 p.m.
Message ID <a103c42778e617014c95.1543766206@pc62.home>
Download mbox | patch
Permalink /patch/36902/
State Accepted
Headers show

Comments

Boris Feld - Dec. 2, 2018, 3:56 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1531475115 -7200
#      Fri Jul 13 11:45:15 2018 +0200
# Node ID a103c42778e617014c95d9c6f9936bfbe420271a
# Parent  67ee61288306b5f74c2151a3e71a5321bc5989cb
# EXP-Topic upgrade-test
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a103c42778e6
upgrade: clarify "aggressivemergedelta" handling

We rename "aggressivemergedelta" argument to "forceaggressivemergedelta". The
previous argument naming could infer an absolute control on the behavior.
However, the code show we respect the config option if set.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2287,7 +2287,7 @@  class revlog(object):
     DELTAREUSEALL = {'always', 'samerevs', 'never', 'fulladd'}
 
     def clone(self, tr, destrevlog, addrevisioncb=None,
-              deltareuse=DELTAREUSESAMEREVS, deltabothparents=None):
+              deltareuse=DELTAREUSESAMEREVS, forcedeltabothparents=None):
         """Copy this revlog to another, possibly with format changes.
 
         The destination revlog will contain the same revisions and nodes.
@@ -2321,9 +2321,9 @@  class revlog(object):
         deltas will be recomputed if the delta's parent isn't a parent of the
         revision.
 
-        In addition to the delta policy, the ``deltabothparents`` argument
-        controls whether to compute deltas against both parents for merges.
-        By default, the current default is used.
+        In addition to the delta policy, the ``forcedeltabothparents``
+        argument controls whether to force compute deltas against both parents
+        for merges. By default, the current default is used.
         """
         if deltareuse not in self.DELTAREUSEALL:
             raise ValueError(_('value for deltareuse invalid: %s') % deltareuse)
@@ -2346,7 +2346,7 @@  class revlog(object):
             elif deltareuse == self.DELTAREUSESAMEREVS:
                 destrevlog._lazydeltabase = False
 
-            destrevlog._deltabothparents = deltabothparents or oldamd
+            destrevlog._deltabothparents = forcedeltabothparents or oldamd
 
             populatecachedelta = deltareuse in (self.DELTAREUSEALWAYS,
                                                 self.DELTAREUSESAMEREVS)
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -469,7 +469,7 @@  def _revlogfrompath(repo, path):
         #reverse of "/".join(("data", path + ".i"))
         return filelog.filelog(repo.svfs, path[5:-2])
 
-def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, deltabothparents):
+def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, forcedeltabothparents):
     """Copy revlogs between 2 repos."""
     revcount = 0
     srcsize = 0
@@ -591,7 +591,7 @@  def _copyrevlogs(ui, srcrepo, dstrepo, t
         ui.note(_('cloning %d revisions from %s\n') % (len(oldrl), unencoded))
         oldrl.clone(tr, newrl, addrevisioncb=oncopiedrevision,
                     deltareuse=deltareuse,
-                    deltabothparents=deltabothparents)
+                    forcedeltabothparents=forcedeltabothparents)
 
         info = newrl.storageinfo(storedsize=True)
         datasize = info['storedsize'] or 0