~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-19 12:54:46 UTC
  • mfrom: (5793.2.6 revisiontree-get-revision)
  • Revision ID: pqm@pqm.ubuntu.com-20110419125446-s16r0ck8t1ig6u7n
(jelmer) Add RevisionTree.get_file_revision,
 replacing an existing static method on Tree. 
 This should also make it unnecessary to access the inventory in a couple
 more cases. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
458
458
    @deprecated_method(deprecated_in((2, 1, 0)))
459
459
    def file_revisions(self, file_id):
460
460
        self.ensure_revision_trees()
461
 
        def get_id(tree, file_id):
462
 
            revision_id = tree.inventory[file_id].revision
463
 
            return revision_id
464
461
        if self.this_rev_id is None:
465
462
            if self.this_basis_tree.get_file_sha1(file_id) != \
466
463
                self.this_tree.get_file_sha1(file_id):
467
464
                raise errors.WorkingTreeNotRevision(self.this_tree)
468
465
 
469
466
        trees = (self.this_basis_tree, self.other_tree)
470
 
        return [get_id(tree, file_id) for tree in trees]
 
467
        return [tree.get_file_revision(file_id) for tree in trees]
471
468
 
472
469
    @deprecated_method(deprecated_in((2, 1, 0)))
473
470
    def check_basis(self, check_clean, require_commits=True):