##// END OF EJS Templates
snapshot: use None as a stop value when looking for a good delta...
Boris Feld -
r39533:5b308a4e default
parent child Browse files
Show More
@@ -577,6 +577,7 b' def _candidategroups(revlog, textlen, p1'
577 """
577 """
578 # should we try to build a delta?
578 # should we try to build a delta?
579 if not (len(revlog) and revlog._storedeltachains):
579 if not (len(revlog) and revlog._storedeltachains):
580 yield None
580 return
581 return
581
582
582 deltalength = revlog.length
583 deltalength = revlog.length
@@ -612,6 +613,7 b' def _candidategroups(revlog, textlen, p1'
612 # impacting performances. Some bounding or slicing mecanism
613 # impacting performances. Some bounding or slicing mecanism
613 # would help to reduce this impact.
614 # would help to reduce this impact.
614 yield tuple(group)
615 yield tuple(group)
616 yield None
615
617
616 def _findsnapshots(revlog, cache, start_rev):
618 def _findsnapshots(revlog, cache, start_rev):
617 """find snapshot from start_rev to tip"""
619 """find snapshot from start_rev to tip"""
@@ -842,7 +844,8 b' class deltacomputer(object):'
842 p1r, p2r = revlog.rev(p1), revlog.rev(p2)
844 p1r, p2r = revlog.rev(p1), revlog.rev(p2)
843 groups = _candidategroups(self.revlog, revinfo.textlen,
845 groups = _candidategroups(self.revlog, revinfo.textlen,
844 p1r, p2r, cachedelta)
846 p1r, p2r, cachedelta)
845 for candidaterevs in groups:
847 candidaterevs = next(groups)
848 while candidaterevs is not None:
846 nominateddeltas = []
849 nominateddeltas = []
847 for candidaterev in candidaterevs:
850 for candidaterev in candidaterevs:
848 candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh)
851 candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh)
@@ -851,6 +854,7 b' class deltacomputer(object):'
851 if nominateddeltas:
854 if nominateddeltas:
852 deltainfo = min(nominateddeltas, key=lambda x: x.deltalen)
855 deltainfo = min(nominateddeltas, key=lambda x: x.deltalen)
853 break
856 break
857 candidaterevs = next(groups)
854
858
855 if deltainfo is None:
859 if deltainfo is None:
856 deltainfo = self._fullsnapshotinfo(fh, revinfo)
860 deltainfo = self._fullsnapshotinfo(fh, revinfo)
General Comments 0
You need to be logged in to leave comments. Login now