Patchwork [2,of,3] aggressivemergedeltas: rename variable internally

login
register
mail settings
Submitter Boris Feld
Date July 19, 2018, 9:08 a.m.
Message ID <fdfde2e7c10f72e2f5b3.1531991315@FB-lair>
Download mbox | patch
Permalink /patch/32908/
State Accepted
Headers show

Comments

Boris Feld - July 19, 2018, 9:08 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1531987618 -7200
#      Thu Jul 19 10:06:58 2018 +0200
# Node ID fdfde2e7c10f72e2f5b3afee86cb16c5ce14cd78
# Parent  043803928d57813dd766747f9feea0d22c19b197
# EXP-Topic aggressivemergedeltas
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r fdfde2e7c10f
aggressivemergedeltas: rename variable internally

The "aggressivemergedeltas" name is not great. First, it is quite long,
second, we would rather have less "Aggressive" names within the project. We
are about to rename the config option, so it seems the appropriate time to
rename the internal variable.

Patch

diff --git a/mercurial/filelog.py b/mercurial/filelog.py
--- a/mercurial/filelog.py
+++ b/mercurial/filelog.py
@@ -215,12 +215,12 @@  class filelog(object):
         self._revlog._lazydeltabase = value
 
     @property
-    def _aggressivemergedeltas(self):
-        return self._revlog._aggressivemergedeltas
+    def _deltabothparents(self):
+        return self._revlog._deltabothparents
 
-    @_aggressivemergedeltas.setter
-    def _aggressivemergedeltas(self, value):
-        self._revlog._aggressivemergedeltas = value
+    @_deltabothparents.setter
+    def _deltabothparents(self, value):
+        self._revlog._deltabothparents = value
 
     @property
     def _inline(self):
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -669,9 +669,9 @@  class localrepository(object):
         if manifestcachesize is not None:
             self.svfs.options['manifestcachesize'] = manifestcachesize
         # experimental config: format.aggressivemergedeltas
-        aggressivemergedeltas = self.ui.configbool('format',
-                                                   'aggressivemergedeltas')
-        self.svfs.options['aggressivemergedeltas'] = aggressivemergedeltas
+        deltabothparents = self.ui.configbool('format',
+                                              'aggressivemergedeltas')
+        self.svfs.options['deltabothparents'] = deltabothparents
         self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui)
         chainspan = self.ui.configbytes('experimental', 'maxdeltachainspan')
         if 0 <= chainspan:
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -628,7 +628,7 @@  class _deltacomputer(object):
                 parents = [p for p in (p1r, p2r)
                            if p != nullrev and p not in tested]
 
-                if not revlog._aggressivemergedeltas and len(parents) == 2:
+                if not revlog._deltabothparents and len(parents) == 2:
                     parents.sort()
                     # To minimize the chance of having to build a fulltext,
                     # pick first whichever parent is closest to us (max rev)
@@ -915,7 +915,7 @@  class revlog(object):
         # How much data to read and cache into the raw revlog data cache.
         self._chunkcachesize = 65536
         self._maxchainlen = None
-        self._aggressivemergedeltas = True
+        self._deltabothparents = True
         self.index = []
         # Mapping of partial identifiers to full nodes.
         self._pcache = {}
@@ -945,8 +945,8 @@  class revlog(object):
                 self._chunkcachesize = opts['chunkcachesize']
             if 'maxchainlen' in opts:
                 self._maxchainlen = opts['maxchainlen']
-            if 'aggressivemergedeltas' in opts:
-                self._aggressivemergedeltas = opts['aggressivemergedeltas']
+            if 'deltabothparents' in opts:
+                self._deltabothparents = opts['deltabothparents']
             self._lazydeltabase = bool(opts.get('lazydeltabase', False))
             if 'compengine' in opts:
                 self._compengine = opts['compengine']
@@ -2843,7 +2843,7 @@  class revlog(object):
     DELTAREUSEALL = {'always', 'samerevs', 'never', 'fulladd'}
 
     def clone(self, tr, destrevlog, addrevisioncb=None,
-              deltareuse=DELTAREUSESAMEREVS, aggressivemergedeltas=None):
+              deltareuse=DELTAREUSESAMEREVS, deltabothparents=None):
         """Copy this revlog to another, possibly with format changes.
 
         The destination revlog will contain the same revisions and nodes.
@@ -2877,7 +2877,7 @@  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 ``aggressivemergedeltas`` argument
+        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.
         """
@@ -2894,7 +2894,7 @@  class revlog(object):
 
         # lazydeltabase controls whether to reuse a cached delta, if possible.
         oldlazydeltabase = destrevlog._lazydeltabase
-        oldamd = destrevlog._aggressivemergedeltas
+        oldamd = destrevlog._deltabothparents
 
         try:
             if deltareuse == self.DELTAREUSEALWAYS:
@@ -2902,7 +2902,7 @@  class revlog(object):
             elif deltareuse == self.DELTAREUSESAMEREVS:
                 destrevlog._lazydeltabase = False
 
-            destrevlog._aggressivemergedeltas = aggressivemergedeltas or oldamd
+            destrevlog._deltabothparents = deltabothparents or oldamd
 
             populatecachedelta = deltareuse in (self.DELTAREUSEALWAYS,
                                                 self.DELTAREUSESAMEREVS)
@@ -2957,4 +2957,4 @@  class revlog(object):
                     addrevisioncb(self, rev, node)
         finally:
             destrevlog._lazydeltabase = oldlazydeltabase
-            destrevlog._aggressivemergedeltas = oldamd
+            destrevlog._deltabothparents = oldamd
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -455,7 +455,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, aggressivemergedeltas):
+def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, deltabothparents):
     """Copy revlogs between 2 repos."""
     revcount = 0
     srcsize = 0
@@ -579,7 +579,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,
-                    aggressivemergedeltas=aggressivemergedeltas)
+                    deltabothparents=deltabothparents)
 
         datasize = 0
         idx = newrl.index