677 if revlog._maxchainlen and chainlen >= revlog._maxchainlen: |
677 if revlog._maxchainlen and chainlen >= revlog._maxchainlen: |
678 continue |
678 continue |
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, |
685 # impacting performances. Some bounding or slicing mecanism |
704 # impacting performances. Some bounding or slicing mecanism |
686 # would help to reduce this impact. |
705 # would help to reduce this impact. |