/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2008-08-05 05:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 3724.
  • Revision ID: robertc@robertcollins.net-20080805054110-9prc026f7yq5iom8
Implement lookups into the current working tree for bzr annotate, fixing bug 3439.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3498
3498
    @display_command
3499
3499
    def run(self, filename, all=False, long=False, revision=None,
3500
3500
            show_ids=False):
3501
 
        from bzrlib.annotate import annotate_file
 
3501
        from bzrlib.annotate import annotate_file, annotate_file_tree
3502
3502
        wt, branch, relpath = \
3503
3503
            bzrdir.BzrDir.open_containing_tree_or_branch(filename)
3504
3504
        if wt is not None:
3520
3520
            if file_id is None:
3521
3521
                raise errors.NotVersionedError(filename)
3522
3522
            file_version = tree.inventory[file_id].revision
3523
 
            annotate_file(branch, file_version, file_id, long, all, self.outf,
3524
 
                          show_ids=show_ids)
 
3523
            if wt is not None and revision is None:
 
3524
                # If there is a tree and we're not annotating historical
 
3525
                # versions, annotate the working tree's content.
 
3526
                annotate_file_tree(wt, file_id, self.outf, long, all,
 
3527
                    show_ids=show_ids)
 
3528
            else:
 
3529
                annotate_file(branch, file_version, file_id, long, all, self.outf,
 
3530
                              show_ids=show_ids)
3525
3531
        finally:
3526
3532
            if wt is not None:
3527
3533
                wt.unlock()