Mercurial > hg
changeset 38716:c67093e81a3e
revlog: extract `deltainfo.distance` for future conditional redefinition
This commit exist to make the next one clearer.
author | Paul Morelle <paul.morelle@octobus.net> |
---|---|
date | Mon, 04 Jun 2018 12:12:00 +0200 |
parents | 905b66681004 |
children | aa21a9ad46ea |
files | mercurial/revlog.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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