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