##// END OF EJS Templates
issue6528: implement _is_revision_affected using callback...
marmoute -
r48626:5b046c2e stable
parent child Browse files
Show More
@@ -563,6 +563,19 b' def _reorder_filelog_parents(repo, fl, t'
563
563
564
564
565 def _is_revision_affected(fl, filerev, metadata_cache=None):
565 def _is_revision_affected(fl, filerev, metadata_cache=None):
566 full_text = lambda: fl._revlog.rawdata(filerev)
567 parent_revs = lambda: fl._revlog.parentrevs(filerev)
568 return _is_revision_affected_inner(
569 full_text, parent_revs, filerev, metadata_cache
570 )
571
572
573 def _is_revision_affected_inner(
574 full_text,
575 parents_revs,
576 filerev,
577 metadata_cache=None,
578 ):
566 """Mercurial currently (5.9rc0) uses `p1 == nullrev and p2 != nullrev` as a
579 """Mercurial currently (5.9rc0) uses `p1 == nullrev and p2 != nullrev` as a
567 special meaning compared to the reverse in the context of filelog-based
580 special meaning compared to the reverse in the context of filelog-based
568 copytracing. issue6528 exists because new code assumed that parent ordering
581 copytracing. issue6528 exists because new code assumed that parent ordering
@@ -570,7 +583,7 b' def _is_revision_affected(fl, filerev, m'
570 it's only used for filelog-based copytracing) and its parents are in the
583 it's only used for filelog-based copytracing) and its parents are in the
571 "wrong" order."""
584 "wrong" order."""
572 try:
585 try:
573 raw_text = fl.rawdata(filerev)
586 raw_text = full_text()
574 except error.CensoredNodeError:
587 except error.CensoredNodeError:
575 # We don't care about censored nodes as they never carry metadata
588 # We don't care about censored nodes as they never carry metadata
576 return False
589 return False
@@ -578,7 +591,7 b' def _is_revision_affected(fl, filerev, m'
578 if metadata_cache is not None:
591 if metadata_cache is not None:
579 metadata_cache[filerev] = has_meta
592 metadata_cache[filerev] = has_meta
580 if has_meta:
593 if has_meta:
581 (p1, p2) = fl.parentrevs(filerev)
594 (p1, p2) = parents_revs()
582 if p1 != nullrev and p2 == nullrev:
595 if p1 != nullrev and p2 == nullrev:
583 return True
596 return True
584 return False
597 return False
General Comments 0
You need to be logged in to leave comments. Login now