# HG changeset patch # User Paul Morelle # Date 1528107120 -7200 # Node ID c67093e81a3e52844186fd7e404d2831d3bad3f6 # Parent 905b66681004d63d53061d06e15a719cc672bb60 revlog: extract `deltainfo.distance` for future conditional redefinition This commit exist to make the next one clearer. diff -r 905b66681004 -r c67093e81a3e mercurial/revlog.py --- a/mercurial/revlog.py Mon Jul 16 14:04:48 2018 -0700 +++ b/mercurial/revlog.py Mon Jun 04 12:12:00 2018 +0200 @@ -2398,13 +2398,14 @@ # deltas we need to apply -- bounding it limits the amount of CPU # we consume. + distance = deltainfo.distance textlen = revinfo.textlen defaultmax = textlen * 4 maxdist = self._maxdeltachainspan if not maxdist: - maxdist = deltainfo.distance # ensure the conditional pass + maxdist = distance # ensure the conditional pass maxdist = max(maxdist, defaultmax) - if (deltainfo.distance > maxdist or deltainfo.deltalen > textlen or + if (distance > maxdist or deltainfo.deltalen > textlen or deltainfo.compresseddeltalen > textlen * 2 or (self._maxchainlen and deltainfo.chainlen > self._maxchainlen)): return False