deltas: accept and skip None return for delta info
They are some extra computation that will shortcut the delta compression if the
delta seems hopeless, returning None.
--- a/mercurial/revlogutils/deltas.py Mon Jan 21 22:36:16 2019 +0100
+++ b/mercurial/revlogutils/deltas.py Mon Jan 21 22:37:30 2019 +0100
@@ -1025,8 +1025,9 @@
nominateddeltas.append(deltainfo)
for candidaterev in candidaterevs:
candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh)
- if isgooddeltainfo(self.revlog, candidatedelta, revinfo):
- nominateddeltas.append(candidatedelta)
+ if candidatedelta is not None:
+ if isgooddeltainfo(self.revlog, candidatedelta, revinfo):
+ nominateddeltas.append(candidatedelta)
if nominateddeltas:
deltainfo = min(nominateddeltas, key=lambda x: x.deltalen)
if deltainfo is not None: