445
445
revision_id = _mod_revision.ensure_null(revision_id)
446
446
return branch, self.revision_tree(revision_id, branch)
448
@deprecated_method(deprecated_in((2, 1, 0)))
449
def ensure_revision_trees(self):
450
if self.this_revision_tree is None:
451
self.this_basis_tree = self.revision_tree(self.this_basis)
452
if self.this_basis == self.this_rev_id:
453
self.this_revision_tree = self.this_basis_tree
455
if self.other_rev_id is None:
456
other_basis_tree = self.revision_tree(self.other_basis)
457
if other_basis_tree.has_changes(self.other_tree):
458
raise errors.WorkingTreeNotRevision(self.this_tree)
459
other_rev_id = self.other_basis
460
self.other_tree = other_basis_tree
462
@deprecated_method(deprecated_in((2, 1, 0)))
463
def file_revisions(self, file_id):
464
self.ensure_revision_trees()
465
if self.this_rev_id is None:
466
if self.this_basis_tree.get_file_sha1(file_id) != \
467
self.this_tree.get_file_sha1(file_id):
468
raise errors.WorkingTreeNotRevision(self.this_tree)
470
trees = (self.this_basis_tree, self.other_tree)
471
return [tree.get_file_revision(file_id) for tree in trees]
473
@deprecated_method(deprecated_in((2, 1, 0)))
474
def check_basis(self, check_clean, require_commits=True):
475
if self.this_basis is None and require_commits is True:
476
raise errors.BzrCommandError(
477
"This branch has no commits."
478
" (perhaps you would prefer 'bzr pull')")
481
if self.this_basis != self.this_rev_id:
482
raise errors.UncommittedChanges(self.this_tree)
484
@deprecated_method(deprecated_in((2, 1, 0)))
485
def compare_basis(self):
487
basis_tree = self.revision_tree(self.this_tree.last_revision())
488
except errors.NoSuchRevision:
489
basis_tree = self.this_tree.basis_tree()
490
if not self.this_tree.has_changes(basis_tree):
491
self.this_rev_id = self.this_basis
493
448
def set_interesting_files(self, file_list):
494
449
self.interesting_files = file_list
540
495
raise errors.NoCommits(self.other_branch)
541
496
if self.other_rev_id is not None:
542
497
self._cached_trees[self.other_rev_id] = self.other_tree
543
self._maybe_fetch(self.other_branch,self.this_branch, self.other_basis)
498
self._maybe_fetch(self.other_branch, self.this_branch, self.other_basis)
545
500
def set_other_revision(self, revision_id, other_branch):
546
501
"""Set 'other' based on a branch and revision id