477
478
incorrectly attributed to CURRENT_REVISION (but after committing, the
478
479
attribution will be correct).
480
basis = self.basis_tree()
483
changes = self.iter_changes(basis, True, [self.id2path(file_id)],
484
require_versioned=True).next()
485
changed_content, kind = changes[2], changes[6]
486
if not changed_content:
487
return basis.annotate_iter(file_id)
490
from bzrlib import annotate
491
if kind[0] != 'file':
494
old_lines = list(basis.annotate_iter(file_id))
496
for tree in self.branch.repository.revision_trees(
497
self.get_parent_ids()[1:]):
498
if file_id not in tree:
481
maybe_file_parent_keys = []
482
for parent_id in self.get_parent_ids():
484
parent_tree = self.revision_tree(parent_id)
485
except errors.NoSuchRevisionInTree:
486
parent_tree = self.branch.repository.revision_tree(parent_id)
487
parent_tree.lock_read()
489
if file_id not in parent_tree:
500
old.append(list(tree.annotate_iter(file_id)))
501
return annotate.reannotate(old, self.get_file(file_id).readlines(),
491
ie = parent_tree.inventory[file_id]
492
parent_text_key = (file_id, ie.revision)
493
if parent_text_key not in maybe_file_parent_keys:
494
maybe_file_parent_keys.append(parent_text_key)
497
graph = _mod_graph.Graph(self.branch.repository.texts)
498
heads = graph.heads(maybe_file_parent_keys)
499
file_parent_keys = []
500
for key in maybe_file_parent_keys:
502
file_parent_keys.append(key)
504
# Now we have the parents of this content
505
annotator = self.branch.repository.texts.get_annotator()
506
text = self.get_file(file_id).read()
507
this_key =(file_id, default_revision)
508
annotator.add_special_text(this_key, file_parent_keys, text)
509
annotations = [(key[-1], line)
510
for key, line in annotator.annotate_flat(this_key)]
506
513
def _get_ancestors(self, default_revision):
507
514
ancestors = set([default_revision])