upgrade: clarify "aggressivemergedelta" handling
authorBoris Feld <boris.feld@octobus.net>
Fri, 13 Jul 2018 11:45:15 +0200
changeset 53602 64051af155963de2a527d4013ad281dbd6ef8d15
parent 53601 5887973febc728e0c420b0fe65f8f5c36ff50755
child 53603 901f6ef670ca5e1a9ed07f31aed4e1930982688d
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
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.
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2282,17 +2282,17 @@ class revlog(object):
     DELTAREUSESAMEREVS = 'samerevs'
     DELTAREUSENEVER = 'never'
     DELTAREUSEFULLADD = 'fulladd'
     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.
         However, it may not be bit-for-bit identical due to e.g. delta encoding
         The ``deltareuse`` argument control how deltas from the existing revlog
         are preserved in the destination revlog. The argument can have the
@@ -2316,19 +2316,19 @@ class revlog(object):
         The default policy (``DELTAREUSESAMEREVS``) strikes a balance between
         two extremes. Deltas will be reused if they are appropriate. But if the
         delta could choose a better revision, it will do so. This means if you
         are converting a non-generaldelta revlog to a generaldelta revlog,
         deltas will be recomputed if the delta's parent isn't a parent of the
-        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)
         if len(destrevlog):
             raise ValueError(_('destination revlog is not empty'))
         if getattr(self, 'filteredrevs', None):
@@ -2341,17 +2341,17 @@ class revlog(object):
         oldamd = destrevlog._deltabothparents
             if deltareuse == self.DELTAREUSEALWAYS:
                 destrevlog._lazydeltabase = True
             elif deltareuse == self.DELTAREUSESAMEREVS:
                 destrevlog._lazydeltabase = False
-            destrevlog._deltabothparents = deltabothparents or oldamd
+            destrevlog._deltabothparents = forcedeltabothparents or oldamd
             populatecachedelta = deltareuse in (self.DELTAREUSEALWAYS,
             deltacomputer = deltautil.deltacomputer(destrevlog)
             index = self.index
             for rev in self:
                 entry = index[rev]
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -451,17 +451,17 @@ def _revlogfrompath(repo, path):
         return changelog.changelog(repo.svfs)
     elif path.endswith('00manifest.i'):
         mandir = path[:-len('00manifest.i')]
         return manifest.manifestrevlog(repo.svfs, tree=mandir)
         #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
     srcrawsize = 0
     dstsize = 0
     fcount = 0
     frevcount = 0
     fsrcsize = 0
@@ -573,17 +573,17 @@ def _copyrevlogs(ui, srcrepo, dstrepo, t
             progress = srcrepo.ui.makeprogress(_('file revisions'),
         ui.note(_('cloning %d revisions from %s\n') % (len(oldrl), unencoded))
         oldrl.clone(tr, newrl, addrevisioncb=oncopiedrevision,
-                    deltabothparents=deltabothparents)
+                    forcedeltabothparents=forcedeltabothparents)
         info = newrl.storageinfo(storedsize=True)
         datasize = info['storedsize'] or 0
         dstsize += datasize
         if isinstance(newrl, changelog.changelog):
             cdstsize += datasize