Show More
@@ -582,6 +582,7 b' def _candidategroups(revlog, textlen, p1' | |||||
582 |
|
582 | |||
583 | deltalength = revlog.length |
|
583 | deltalength = revlog.length | |
584 | deltaparent = revlog.deltaparent |
|
584 | deltaparent = revlog.deltaparent | |
|
585 | good = None | |||
585 |
|
586 | |||
586 | deltas_limit = textlen * LIMIT_DELTA2TEXT |
|
587 | deltas_limit = textlen * LIMIT_DELTA2TEXT | |
587 |
|
588 | |||
@@ -612,7 +613,9 b' def _candidategroups(revlog, textlen, p1' | |||||
612 | # XXX: in the sparse revlog case, group can become large, |
|
613 | # XXX: in the sparse revlog case, group can become large, | |
613 | # impacting performances. Some bounding or slicing mecanism |
|
614 | # impacting performances. Some bounding or slicing mecanism | |
614 | # would help to reduce this impact. |
|
615 | # would help to reduce this impact. | |
615 | yield tuple(group) |
|
616 | good = yield tuple(group) | |
|
617 | if good is not None: | |||
|
618 | break | |||
616 | yield None |
|
619 | yield None | |
617 |
|
620 | |||
618 | def _findsnapshots(revlog, cache, start_rev): |
|
621 | def _findsnapshots(revlog, cache, start_rev): | |
@@ -847,14 +850,20 b' class deltacomputer(object):' | |||||
847 | candidaterevs = next(groups) |
|
850 | candidaterevs = next(groups) | |
848 | while candidaterevs is not None: |
|
851 | while candidaterevs is not None: | |
849 | nominateddeltas = [] |
|
852 | nominateddeltas = [] | |
|
853 | if deltainfo is not None: | |||
|
854 | # if we already found a good delta, | |||
|
855 | # challenge it against refined candidates | |||
|
856 | nominateddeltas.append(deltainfo) | |||
850 | for candidaterev in candidaterevs: |
|
857 | for candidaterev in candidaterevs: | |
851 | candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh) |
|
858 | candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh) | |
852 | if isgooddeltainfo(self.revlog, candidatedelta, revinfo): |
|
859 | if isgooddeltainfo(self.revlog, candidatedelta, revinfo): | |
853 | nominateddeltas.append(candidatedelta) |
|
860 | nominateddeltas.append(candidatedelta) | |
854 | if nominateddeltas: |
|
861 | if nominateddeltas: | |
855 | deltainfo = min(nominateddeltas, key=lambda x: x.deltalen) |
|
862 | deltainfo = min(nominateddeltas, key=lambda x: x.deltalen) | |
856 | break |
|
863 | if deltainfo is not None: | |
857 |
candidaterevs = |
|
864 | candidaterevs = groups.send(deltainfo.base) | |
|
865 | else: | |||
|
866 | candidaterevs = next(groups) | |||
858 |
|
867 | |||
859 | if deltainfo is None: |
|
868 | if deltainfo is None: | |
860 | deltainfo = self._fullsnapshotinfo(fh, revinfo) |
|
869 | deltainfo = self._fullsnapshotinfo(fh, revinfo) |
General Comments 0
You need to be logged in to leave comments.
Login now