Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/deltas.py @ 40957:f960c51eebf3
delta: filter nullrev out first
When picking a potential candidate, we filter them on various criteria. The
"different from nullrev" criteria is very fast to compute and we should
process it first.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 06 Dec 2018 10:39:05 +0100 |
parents | 39d29542fe40 |
children | 42f59d3f714d |
comparison
equal
deleted
inserted
replaced
40956:74ee5ff1e81c | 40957:f960c51eebf3 |
---|---|
631 and not (rev == nullrev | 631 and not (rev == nullrev |
632 or rev in tested | 632 or rev in tested |
633 or deltalength(rev))): | 633 or deltalength(rev))): |
634 tested.add(rev) | 634 tested.add(rev) |
635 rev = deltaparent(rev) | 635 rev = deltaparent(rev) |
636 # no need to try a delta against nullrev, this will be done as a | |
637 # last resort. | |
638 if rev == nullrev: | |
639 continue | |
636 # filter out revision we tested already | 640 # filter out revision we tested already |
637 if rev in tested: | 641 if rev in tested: |
638 continue | 642 continue |
639 tested.add(rev) | 643 tested.add(rev) |
640 # filter out delta base that will never produce good delta | 644 # filter out delta base that will never produce good delta |
641 if deltas_limit < revlog.length(rev): | 645 if deltas_limit < revlog.length(rev): |
642 continue | |
643 # no need to try a delta against nullrev, this will be done as a | |
644 # last resort. | |
645 if rev == nullrev: | |
646 continue | 646 continue |
647 # no delta for rawtext-changing revs (see "candelta" for why) | 647 # no delta for rawtext-changing revs (see "candelta" for why) |
648 if revlog.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS: | 648 if revlog.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS: |
649 continue | 649 continue |
650 group.append(rev) | 650 group.append(rev) |