822
822
pb = bzrlib.ui.ui_factory.progress_bar()
823
823
pb.update('comparing histories')
824
if stop_revision is None:
825
other_revision = other.last_patch()
827
other_revision = other.get_rev_id(stop_revision)
828
count = greedy_fetch(self, other, other_revision, pb)[0]
826
830
revision_ids = self.missing_revisions(other, stop_revision)
827
831
except DivergedBranches, e:
829
if stop_revision is None:
830
end_revision = other.last_patch()
831
833
revision_ids = get_intervening_revisions(self.last_patch(),
834
other_revision, self)
833
835
assert self.last_patch() not in revision_ids
834
836
except bzrlib.errors.NotAncestor:
837
if len(revision_ids) > 0:
838
count = greedy_fetch(self, other, revision_ids[-1], pb)[0]
841
839
self.append_revision(*revision_ids)
842
## note("Added %d revisions." % count)
845
842
def install_revisions(self, other, revision_ids, pb):
846
843
if hasattr(other.revision_store, "prefetch"):
847
844
other.revision_store.prefetch(revision_ids)
848
845
if hasattr(other.inventory_store, "prefetch"):
849
inventory_ids = [other.get_revision(r).inventory_id
850
for r in revision_ids]
847
for rev_id in revision_ids:
849
revision = other.get_revision(rev_id).inventory_id
850
inventory_ids.append(revision)
851
except bzrlib.errors.NoSuchRevision:
851
853
other.inventory_store.prefetch(inventory_ids)
916
918
raise bzrlib.errors.NoSuchRevision(self, revno)
917
919
return history[revno - 1]
919
922
def revision_tree(self, revision_id):
920
923
"""Return Tree for a revision on this branch.
1355
1358
br_to.update_revisions(branch_from, stop_revision=revno)
1356
1359
merge((to_location, -1), (to_location, 0), this_dir=to_location,
1357
1360
check_clean=False, ignore_zero=True)
1359
1361
br_to.set_parent(branch_from.base)