[PATCH 1 of 6] revlog: in _getcandidaterevs, shorten revlog._generaldelta to gdelta

Paul Morelle paul.morelle at octobus.net
Mon May 21 17:47:53 EDT 2018


# HG changeset patch
# User Paul Morelle <paul.morelle at octobus.net>
# Date 1525438855 -7200
#      Fri May 04 15:00:55 2018 +0200
# Node ID 054469518b3480201e7f8ada16957027009e9f64
# Parent  514605777244de61b68c7e1503c4f106773913f4
# EXP-Topic semi-snapshots
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 054469518b34
revlog: in _getcandidaterevs, shorten revlog._generaldelta to gdelta

diff -r 514605777244 -r 054469518b34 mercurial/revlog.py
--- a/mercurial/revlog.py	Fri May 11 23:28:02 2018 -0700
+++ b/mercurial/revlog.py	Fri May 04 15:00:55 2018 +0200
@@ -305,6 +305,7 @@
         grouped by level of easiness.
         """
         revlog = self.revlog
+        gdelta = revlog._generaldelta
         curr = len(revlog)
         prev = curr - 1
         p1r, p2r = revlog.rev(p1), revlog.rev(p2)
@@ -316,13 +317,13 @@
             # changegroup data into a generaldelta repo. The only time it
             # isn't true is if this is the first revision in a delta chain
             # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.
-            if cachedelta and revlog._generaldelta and revlog._lazydeltabase:
+            if cachedelta and gdelta and revlog._lazydeltabase:
                 # Assume what we received from the server is a good choice
                 # build delta will reuse the cache
                 yield (cachedelta[0],)
                 tested.add(cachedelta[0])
 
-            if revlog._generaldelta:
+            if gdelta:
                 # exclude already lazy tested base if any
                 parents = [p for p in (p1r, p2r)
                            if p != nullrev and p not in tested]


More information about the Mercurial-devel mailing list