##// END OF EJS Templates
delta-find: adjust the moment when we mark something as "tested"...
marmoute -
r50511:4956942c default
parent child Browse files
Show More
@@ -707,21 +707,25 b' def _candidategroups('
707 # filter out revision we tested already
707 # filter out revision we tested already
708 if rev in tested:
708 if rev in tested:
709 continue
709 continue
710 tested.add(rev)
711 # an higher authority deamed the base unworthy (e.g. censored)
710 # an higher authority deamed the base unworthy (e.g. censored)
712 if excluded_bases is not None and rev in excluded_bases:
711 if excluded_bases is not None and rev in excluded_bases:
712 tested.add(rev)
713 continue
713 continue
714 # We are in some recomputation cases and that rev is too high in
714 # We are in some recomputation cases and that rev is too high in
715 # the revlog
715 # the revlog
716 if target_rev is not None and rev >= target_rev:
716 if target_rev is not None and rev >= target_rev:
717 tested.add(rev)
717 continue
718 continue
718 # filter out delta base that will never produce good delta
719 # filter out delta base that will never produce good delta
719 if deltas_limit < revlog.length(rev):
720 if deltas_limit < revlog.length(rev):
721 tested.add(rev)
720 continue
722 continue
721 if sparse and revlog.rawsize(rev) < (textlen // LIMIT_BASE2TEXT):
723 if sparse and revlog.rawsize(rev) < (textlen // LIMIT_BASE2TEXT):
724 tested.add(rev)
722 continue
725 continue
723 # no delta for rawtext-changing revs (see "candelta" for why)
726 # no delta for rawtext-changing revs (see "candelta" for why)
724 if revlog.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS:
727 if revlog.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS:
728 tested.add(rev)
725 continue
729 continue
726
730
727 # If we reach here, we are about to build and test a delta.
731 # If we reach here, we are about to build and test a delta.
@@ -731,9 +735,11 b' def _candidategroups('
731 chainlen, chainsize = revlog._chaininfo(rev)
735 chainlen, chainsize = revlog._chaininfo(rev)
732 # if chain will be too long, skip base
736 # if chain will be too long, skip base
733 if revlog._maxchainlen and chainlen >= revlog._maxchainlen:
737 if revlog._maxchainlen and chainlen >= revlog._maxchainlen:
738 tested.add(rev)
734 continue
739 continue
735 # if chain already have too much data, skip base
740 # if chain already have too much data, skip base
736 if deltas_limit < chainsize:
741 if deltas_limit < chainsize:
742 tested.add(rev)
737 continue
743 continue
738 if sparse and revlog.upperboundcomp is not None:
744 if sparse and revlog.upperboundcomp is not None:
739 maxcomp = revlog.upperboundcomp
745 maxcomp = revlog.upperboundcomp
@@ -752,12 +758,14 b' def _candidategroups('
752 snapshotlimit = textlen >> snapshotdepth
758 snapshotlimit = textlen >> snapshotdepth
753 if snapshotlimit < lowestrealisticdeltalen:
759 if snapshotlimit < lowestrealisticdeltalen:
754 # delta lower bound is larger than accepted upper bound
760 # delta lower bound is larger than accepted upper bound
761 tested.add(rev)
755 continue
762 continue
756
763
757 # check the relative constraint on the delta size
764 # check the relative constraint on the delta size
758 revlength = revlog.length(rev)
765 revlength = revlog.length(rev)
759 if revlength < lowestrealisticdeltalen:
766 if revlength < lowestrealisticdeltalen:
760 # delta probable lower bound is larger than target base
767 # delta probable lower bound is larger than target base
768 tested.add(rev)
761 continue
769 continue
762
770
763 group.append(rev)
771 group.append(rev)
@@ -765,6 +773,7 b' def _candidategroups('
765 # XXX: in the sparse revlog case, group can become large,
773 # XXX: in the sparse revlog case, group can become large,
766 # impacting performances. Some bounding or slicing mecanism
774 # impacting performances. Some bounding or slicing mecanism
767 # would help to reduce this impact.
775 # would help to reduce this impact.
776 tested.update(group)
768 good = yield tuple(group)
777 good = yield tuple(group)
769 yield None
778 yield None
770
779
General Comments 0
You need to be logged in to leave comments. Login now