~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to annotate.py

  • Committer: Aaron Bentley
  • Date: 2005-09-19 02:44:11 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20050919024411-8bb9efa8c13c7c44
Updated to match API changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    i = 0
33
33
    for revno in q:
34
34
        i += 1
35
 
        cur_tree = branch.revision_tree(branch.lookup_revision(revno))
 
35
        cur_tree = branch.revision_tree(branch.get_rev_id(revno))
36
36
        if file_id not in cur_tree.inventory:
37
37
            text_id = None
38
38
        else:
45
45
        yield progress.Progress("revisions", i)
46
46
 
47
47
def get_patch(branch, old_revno, new_revno, file_id):
48
 
    old_tree = branch.revision_tree(branch.lookup_revision(old_revno))
49
 
    new_tree = branch.revision_tree(branch.lookup_revision(new_revno))
 
48
    old_tree = branch.revision_tree(branch.get_rev_id(old_revno))
 
49
    new_tree = branch.revision_tree(branch.get_rev_id(new_revno))
50
50
    if file_id in old_tree.inventory:
51
51
        old_file = old_tree.get_file(file_id).readlines()
52
52
    else:
61
61
    def run(self, filename):
62
62
        if not os.path.exists(filename):
63
63
            raise BzrCommandError("The file %s does not exist." % filename)
64
 
        branch = (Branch(filename))
 
64
        branch = (Branch.open_containing(filename))
65
65
        file_id = branch.working_tree().path2id(branch.relpath(filename))
66
66
        if file_id is None:
67
67
            raise BzrCommandError("The file %s is not versioned." % filename)