496
496
b_marker=TextMerge.B_MARKER):
497
497
return PlanWeaveMerge(plan, a_marker, b_marker).merge_lines()[0]
499
def calculate_parents(self, revision_id, get_text_version, file_id,
500
parents_provider, repo_graph, get_inventory):
501
text_revision = get_text_version(file_id, revision_id)
502
if text_revision is None:
504
parents_of_text_revision = parents_provider.get_parents(
506
parents_from_inventories = []
507
for parent in parents_of_text_revision:
508
if parent == revision.NULL_REVISION:
511
inventory = get_inventory(parent)
512
except errors.RevisionNotPresent:
515
introduced_in = inventory[file_id].revision
516
parents_from_inventories.append(introduced_in)
517
mutter('%r:%r introduced in: %r',
518
file_id, revision_id, parents_from_inventories)
519
heads = set(repo_graph.heads(parents_from_inventories))
520
mutter(' heads: %r', heads)
522
for parent in parents_from_inventories:
523
if parent in heads and parent not in new_parents:
524
new_parents.append(parent)
527
def check_parents(self, revision_ids, get_text_version, file_id,
528
parents_provider, repo_graph, get_inventory):
530
for num, revision_id in enumerate(revision_ids):
531
correct_parents = self.calculate_parents(revision_id,
532
get_text_version, file_id, parents_provider, repo_graph,
534
if correct_parents is None:
536
text_revision = get_text_version(file_id, revision_id)
537
knit_parents = self.get_parents(text_revision)
538
if correct_parents != knit_parents:
539
result[revision_id] = (knit_parents, correct_parents)
540
mutter(' RESULT: %r', result)
543
499
def find_bad_ancestors(self, revision_ids, get_text_version, file_id,
544
500
parents_provider, repo_graph):
545
501
"""Search this versionedfile for ancestors that are not referenced.