~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

- merge improved merge base selection from aaron
aaron.bentley@utoronto.ca-20050912025534-43d7275dd948e4ad

Show diffs side-by-side

added added

removed removed

Lines of Context:
805
805
        """Pull in all new revisions from other branch.
806
806
        """
807
807
        from bzrlib.fetch import greedy_fetch
 
808
        from bzrlib.revision import get_intervening_revisions
808
809
 
809
810
        pb = bzrlib.ui.ui_factory.progress_bar()
810
811
        pb.update('comparing histories')
811
812
 
812
 
        revision_ids = self.missing_revisions(other, stop_revision)
 
813
        try:
 
814
            revision_ids = self.missing_revisions(other, stop_revision)
 
815
        except DivergedBranches, e:
 
816
            try:
 
817
                if stop_revision is None:
 
818
                    end_revision = other.last_patch()
 
819
                revision_ids = get_intervening_revisions(self.last_patch(), 
 
820
                                                         end_revision, other)
 
821
                assert self.last_patch() not in revision_ids
 
822
            except bzrlib.errors.NotAncestor:
 
823
                raise e
813
824
 
814
825
        if len(revision_ids) > 0:
815
826
            count = greedy_fetch(self, other, revision_ids[-1], pb)[0]