102
102
from bzrlib.transport.local import LocalTransport
103
103
import bzrlib.tree
104
104
from bzrlib.progress import DummyProgress, ProgressPhase
105
from bzrlib.revision import NULL_REVISION
105
from bzrlib.revision import NULL_REVISION, CURRENT_REVISION
106
106
import bzrlib.revisiontree
107
107
from bzrlib.rio import RioReader, rio_file, Stanza
108
108
from bzrlib.symbol_versioning import (deprecated_passed,
468
468
def get_file_byname(self, filename):
469
469
return file(self.abspath(filename), 'rb')
471
def annotate_iter(self, file_id):
472
"""See Tree.annotate_iter
474
This implementation will use the basis tree implementation if possible.
475
Lines not in the basis are attributed to CURRENT_REVISION
477
If there are pending merges, lines added by those merges will be
478
incorrectly attributed to CURRENT_REVISION (but after committing, the
479
attribution will be correct).
481
basis = self.basis_tree()
482
changes = self._iter_changes(basis, True, [file_id]).next()
483
changed_content, kind = changes[2], changes[6]
484
if not changed_content:
485
return basis.annotate_iter(file_id)
489
if kind[0] != 'file':
492
old_lines = list(basis.annotate_iter(file_id))
494
for tree in self.branch.repository.revision_trees(
495
self.get_parent_ids()[1:]):
496
if file_id not in tree:
498
old.append(list(tree.annotate_iter(file_id)))
499
return annotate.reannotate(old, self.get_file(file_id).readlines(),
471
502
def get_parent_ids(self):
472
503
"""See Tree.get_parent_ids.