~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2007-06-28 16:50:06 UTC
  • mfrom: (2561 +trunk)
  • mto: (2520.4.116 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2572.
  • Revision ID: abentley@panoramicfeedback.com-20070628165006-m7bd56ngqs26rd91
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
from bzrlib.merge3 import Merge3
42
42
from bzrlib.osutils import rename, pathjoin
43
43
from progress import DummyProgress, ProgressPhase
44
 
from bzrlib.revision import common_ancestor, is_ancestor, NULL_REVISION
 
44
from bzrlib.revision import (is_ancestor, NULL_REVISION, ensure_null)
45
45
from bzrlib.textfile import check_text_lines
46
46
from bzrlib.trace import mutter, warning, note
47
47
from bzrlib.transform import (TreeTransform, resolve_conflicts, cook_conflicts,
201
201
            return
202
202
        if self.other_rev_id is None:
203
203
            return
204
 
        ancestry = self.this_branch.repository.get_ancestry(self.this_basis)
 
204
        ancestry = set(self.this_branch.repository.get_ancestry(
 
205
            self.this_basis, topo_sorted=False))
205
206
        if self.other_rev_id in ancestry:
206
207
            return
207
208
        self.this_tree.add_parent_tree((self.other_rev_id, self.other_tree))
258
259
                pb = ui.ui_factory.nested_progress_bar()
259
260
                try:
260
261
                    this_repo = self.this_branch.repository
261
 
                    self.base_rev_id = common_ancestor(self.this_basis, 
262
 
                                                       self.other_basis, 
263
 
                                                       this_repo, pb)
 
262
                    graph = this_repo.get_graph()
 
263
                    revisions = [ensure_null(self.this_basis),
 
264
                                 ensure_null(self.other_basis)]
 
265
                    if NULL_REVISION in revisions:
 
266
                        self.base_rev_id = NULL_REVISION
 
267
                    else:
 
268
                        self.base_rev_id = graph.find_unique_lca(*revisions)
 
269
                        if self.base_rev_id == NULL_REVISION:
 
270
                            raise UnrelatedBranches()
264
271
                finally:
265
272
                    pb.finished()
266
273
            except NoCommonAncestor: