~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-09-15 08:37:41 UTC
  • Revision ID: mbp@sourcefrog.net-20050915083741-70d7550b97c7b580
- some updates for fetch/update function

Show diffs side-by-side

added added

removed removed

Lines of Context:
768
768
 
769
769
 
770
770
    def missing_revisions(self, other, stop_revision=None, diverged_ok=False):
771
 
        """
 
771
        """Return a list of new revisions that would perfectly fit.
 
772
        
772
773
        If self and other have not diverged, return a list of the revisions
773
774
        present in other, but missing from self.
774
775
 
794
795
        Traceback (most recent call last):
795
796
        DivergedBranches: These branches have diverged.
796
797
        """
 
798
        # FIXME: If the branches have diverged, but the latest
 
799
        # revision in this branch is completely merged into the other,
 
800
        # then we should still be able to pull.
797
801
        self_history = self.revision_history()
798
802
        self_len = len(self_history)
799
803
        other_history = other.revision_history()
812
816
 
813
817
 
814
818
    def update_revisions(self, other, stop_revision=None):
815
 
        """Pull in all new revisions from other branch.
 
819
        """Pull in new perfect-fit revisions.
816
820
        """
817
 
        # FIXME: Is this redundant with just doing fetch?
818
821
        from bzrlib.fetch import greedy_fetch
819
822
 
820
 
        pb = bzrlib.ui.ui_factory.progress_bar()
821
 
        pb.update('comparing histories')
 
823
        greedy_fetch(to_branch=self, from_branch=other,
 
824
                     revision_limit=stop_revision)
822
825
 
823
826
        revision_ids = self.missing_revisions(other, stop_revision)
824
827
 
827
830
        else:
828
831
            count = 0
829
832
        self.append_revision(*revision_ids)
830
 
        ## note("Added %d revisions." % count)
831
 
        pb.clear()
832
833
 
833
834
 
834
835
    def commit(self, *args, **kw):