~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2007-05-26 04:27:39 UTC
  • mto: This revision was merged to the branch mainline in revision 2534.
  • Revision ID: aaron.bentley@utoronto.ca-20070526042739-0o2yva7r05fslgqm
Use GraphWalker.unique_ancestor to determine merge base

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 (common_ancestor, is_ancestor, NULL_REVISION,
 
45
                             ensure_null)
45
46
from bzrlib.textfile import check_text_lines
46
47
from bzrlib.trace import mutter, warning, note
47
48
from bzrlib.transform import (TreeTransform, resolve_conflicts, cook_conflicts,
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
                    walker = this_repo.get_graph_walker()
 
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 = walker.unique_common(*revisions)
 
269
                        if self.base_rev_id == NULL_REVISION:
 
270
                            raise UnrelatedBranches()
264
271
                finally:
265
272
                    pb.finished()
266
273
            except NoCommonAncestor: