##// END OF EJS Templates
revlogutils: teach issue6528 filtering about grandparents...
Joerg Sonnenberger -
r52808:62238928 default
parent child Browse files
Show More
@@ -618,12 +618,17 def _is_revision_affected_fast(repo, fl,
618 delta = lambda: rl._inner._chunk(filerev)
618 delta = lambda: rl._inner._chunk(filerev)
619 full_text = lambda: rl.rawdata(filerev)
619 full_text = lambda: rl.rawdata(filerev)
620 parent_revs = lambda: rl.parentrevs(filerev)
620 parent_revs = lambda: rl.parentrevs(filerev)
621 # This function is used by repair_issue6528, but not by
622 # filter_delta_issue6528. As such, we do not want to trust
623 # parent revisions of the delta base to decide whether
624 # the delta base has metadata.
621 return _is_revision_affected_fast_inner(
625 return _is_revision_affected_fast_inner(
622 is_censored,
626 is_censored,
623 delta_base,
627 delta_base,
624 delta,
628 delta,
625 full_text,
629 full_text,
626 parent_revs,
630 parent_revs,
631 None, # don't trust the parent revisions
627 filerev,
632 filerev,
628 metadata_cache,
633 metadata_cache,
629 )
634 )
@@ -635,6 +640,7 def _is_revision_affected_fast_inner(
635 delta,
640 delta,
636 full_text,
641 full_text,
637 parent_revs,
642 parent_revs,
643 deltabase_parentrevs,
638 filerev,
644 filerev,
639 metadata_cache,
645 metadata_cache,
640 ):
646 ):
@@ -659,12 +665,25 def _is_revision_affected_fast_inner(
659 delta_parent = delta_base()
665 delta_parent = delta_base()
660 parent_has_metadata = metadata_cache.get(delta_parent)
666 parent_has_metadata = metadata_cache.get(delta_parent)
661 if parent_has_metadata is None:
667 if parent_has_metadata is None:
662 return _is_revision_affected_inner(
668 if deltabase_parentrevs is not None:
663 full_text,
669 deltabase_parentrevs = deltabase_parentrevs()
664 parent_revs,
670 if deltabase_parentrevs == (nullrev, nullrev):
665 filerev,
671 # Need to check the content itself as there is no flag.
666 metadata_cache,
672 parent_has_metadata = None
667 )
673 elif deltabase_parentrevs[0] == nullrev:
674 # Second parent is !null, assume repository is correct
675 # and has flagged this file revision as having metadata.
676 parent_has_metadata = True
677 elif deltabase_parentrevs[1] == nullrev:
678 # First parent is !null, so assume it has no metadata.
679 parent_has_metadata = False
680 if parent_has_metadata is None:
681 return _is_revision_affected_inner(
682 full_text,
683 parent_revs,
684 filerev,
685 metadata_cache,
686 )
668
687
669 chunk = delta()
688 chunk = delta()
670 if not len(chunk):
689 if not len(chunk):
@@ -766,9 +785,9 def filter_delta_issue6528(revlog, delta
766 p2_rev = revlog.rev(p2_node)
785 p2_rev = revlog.rev(p2_node)
767
786
768 is_censored = lambda: bool(flags & REVIDX_ISCENSORED)
787 is_censored = lambda: bool(flags & REVIDX_ISCENSORED)
769 delta_base = lambda: revlog.rev(delta_base)
770 delta_base = lambda: base_rev
788 delta_base = lambda: base_rev
771 parent_revs = lambda: (p1_rev, p2_rev)
789 parent_revs = lambda: (p1_rev, p2_rev)
790 deltabase_parentrevs = lambda: revlog.parentrevs(base_rev)
772
791
773 def full_text():
792 def full_text():
774 # note: being able to reuse the full text computation in the
793 # note: being able to reuse the full text computation in the
@@ -794,6 +813,7 def filter_delta_issue6528(revlog, delta
794 lambda: delta,
813 lambda: delta,
795 full_text,
814 full_text,
796 parent_revs,
815 parent_revs,
816 deltabase_parentrevs,
797 rev,
817 rev,
798 metadata_cache,
818 metadata_cache,
799 )
819 )
General Comments 0
You need to be logged in to leave comments. Login now