~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-21 02:47:23 UTC
  • mto: (1092.1.41) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1110.
  • Revision ID: aaron.bentley@utoronto.ca-20050821024722-8415d261af04ec4f
Added greedy_fetch to update_revisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
829
829
        >>> br2.revision_history()
830
830
        [u'REVISION-ID-1']
831
831
        >>> br2.update_revisions(br1)
832
 
        Added 0 texts.
833
 
        Added 0 inventories.
834
832
        Added 0 revisions.
835
833
        >>> br1.text_store.total_size() == br2.text_store.total_size()
836
834
        True
837
835
        """
 
836
        from bzrlib.fetch import greedy_fetch
838
837
        pb = ProgressBar()
839
838
        pb.update('comparing histories')
840
839
        revision_ids = self.missing_revisions(other, stop_revision)
841
 
        count, failures = self.install_revisions(other, revision_ids, pb=pb)
 
840
        if len(revision_ids) > 0:
 
841
            count = greedy_fetch(self, other, revision_ids[-1], pb)[0]
 
842
        else:
 
843
            count = 0
842
844
        self.append_revision(*revision_ids)
843
845
        print "Added %d revisions." % count
844
 
        assert len(failures) == 0
845
846
                    
846
847
    def install_revisions(self, other, revision_ids, pb=None):
847
848
        if pb is None: