983
984
ver_a = osutils.safe_revision_id(ver_a)
984
985
ver_b = osutils.safe_revision_id(ver_b)
985
986
ancestors_b = set(self.get_ancestry(ver_b, topo_sorted=False))
986
def status_a(revision, text):
987
if revision in ancestors_b:
988
return 'killed-b', text
992
988
ancestors_a = set(self.get_ancestry(ver_a, topo_sorted=False))
993
def status_b(revision, text):
994
if revision in ancestors_a:
995
return 'killed-a', text
999
989
annotated_a = self.annotate(ver_a)
1000
990
annotated_b = self.annotate(ver_b)
1001
plain_a = [t for (a, t) in annotated_a]
1002
plain_b = [t for (a, t) in annotated_b]
1003
blocks = KnitSequenceMatcher(None, plain_a, plain_b).get_matching_blocks()
1006
for ai, bi, l in blocks:
1007
# process all mismatched sections
1008
# (last mismatched section is handled because blocks always
1009
# includes a 0-length last block)
1010
for revision, text in annotated_a[a_cur:ai]:
1011
yield status_a(revision, text)
1012
for revision, text in annotated_b[b_cur:bi]:
1013
yield status_b(revision, text)
1015
# and now the matched section
1018
for text_a, text_b in zip(plain_a[ai:a_cur], plain_b[bi:b_cur]):
1019
assert text_a == text_b
1020
yield "unchanged", text_a
991
return merge._plan_annotate_merge(annotated_a, annotated_b,
992
ancestors_a, ancestors_b)
1023
995
class _KnitComponentFile(object):