changeset 38150:69ec6f98cfa6

revlog: isgooddeltainfo takes the whole revinfo object Future changes will need other information about te revision.
author Paul Morelle <paul.morelle@octobus.net>
date Wed, 07 Mar 2018 12:00:58 +0100
parents bf59f95583c1
children d8bd6a9c64a5
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Mar 07 12:00:07 2018 +0100
+++ b/mercurial/revlog.py	Wed Mar 07 12:00:58 2018 +0100
@@ -449,7 +449,7 @@
                 if revlog.flags(candidaterev) & REVIDX_RAWTEXT_CHANGING_FLAGS:
                     continue
                 candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh)
-                if revlog._isgooddeltainfo(candidatedelta, revinfo.textlen):
+                if revlog._isgooddeltainfo(candidatedelta, revinfo):
                     nominateddeltas.append(candidatedelta)
             if nominateddeltas:
                 deltainfo = min(nominateddeltas, key=lambda x: x.deltalen)
@@ -2093,7 +2093,7 @@
 
         return compressor.decompress(data)
 
-    def _isgooddeltainfo(self, deltainfo, textlen):
+    def _isgooddeltainfo(self, deltainfo, revinfo):
         """Returns True if the given delta is good. Good means that it is within
         the disk span, disk size, and chain length bounds that we know to be
         performant."""
@@ -2106,6 +2106,7 @@
         #   deltas we need to apply -- bounding it limits the amount of CPU
         #   we consume.
 
+        textlen = revinfo.textlen
         defaultmax = textlen * 4
         maxdist = self._maxdeltachainspan
         if not maxdist: