##// END OF EJS Templates
deltas: skip if projected delta size does not match text size constraint...
Valentin Gatien-Baron , Pierre-Yves David pierre-yves.david@octobus.net -
r42663:a0b26fc8 default
parent child Browse files
Show More
@@ -679,6 +679,25 b' def _candidategroups(revlog, textlen, p1'
679 # if chain already have too much data, skip base
679 # if chain already have too much data, skip base
680 if deltas_limit < chainsize:
680 if deltas_limit < chainsize:
681 continue
681 continue
682 if sparse and revlog.upperboundcomp is not None:
683 maxcomp = revlog.upperboundcomp
684 basenotsnap = (p1, p2, nullrev)
685 if rev not in basenotsnap and revlog.issnapshot(rev):
686 snapshotdepth = revlog.snapshotdepth(rev)
687 # If text is significantly larger than the base, we can
688 # expect the resulting delta to be proportional to the size
689 # difference
690 revsize = revlog.rawsize(rev)
691 rawsizedistance = max(textlen - revsize, 0)
692 # use an estimate of the compression upper bound.
693 lowestrealisticdeltalen = rawsizedistance // maxcomp
694
695 # check the absolute constraint on the delta size
696 snapshotlimit = textlen >> snapshotdepth
697 if snapshotlimit < lowestrealisticdeltalen:
698 # delta lower bound is larger than accepted upper bound
699 continue
700
682 group.append(rev)
701 group.append(rev)
683 if group:
702 if group:
684 # XXX: in the sparse revlog case, group can become large,
703 # XXX: in the sparse revlog case, group can become large,
General Comments 0
You need to be logged in to leave comments. Login now