~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: John Arbash Meinel
  • Date: 2007-11-30 14:52:30 UTC
  • mto: This revision was merged to the branch mainline in revision 3061.
  • Revision ID: john@arbash-meinel.com-20071130145230-njpq31mmf39l2zow
deprecate revision.is_ancestor, update the callers and the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
from bzrlib.merge3 import Merge3
45
45
from bzrlib.osutils import rename, pathjoin
46
46
from progress import DummyProgress, ProgressPhase
47
 
from bzrlib.revision import (is_ancestor, NULL_REVISION, ensure_null)
 
47
from bzrlib.revision import (NULL_REVISION, ensure_null)
48
48
from bzrlib.textfile import check_text_lines
49
49
from bzrlib.trace import mutter, warning, note
50
50
from bzrlib.transform import (TreeTransform, resolve_conflicts, cook_conflicts,
296
296
        self.base_branch = branch
297
297
        self._maybe_fetch(branch, self.this_branch, revision_id)
298
298
        self.base_tree = self.revision_tree(revision_id)
299
 
        self.base_is_ancestor = is_ancestor(self.this_basis,
300
 
                                            self.base_rev_id,
301
 
                                            self.this_branch)
302
 
        self.base_is_other_ancestor = is_ancestor(self.other_basis,
303
 
                                                  self.base_rev_id,
304
 
                                                  self.this_branch)
 
299
        graph = self.this_branch.repository.get_graph()
 
300
        self.base_is_ancestor = graph.is_ancestor(self.base_rev_id,
 
301
                                                  self.this_basis)
 
302
        self.base_is_other_ancestor = graph.is_ancestor(self.base_rev_id,
 
303
                                                        self.other_basis)
305
304
 
306
305
    def _maybe_fetch(self, source, target, revision_id):
307
306
        if not source.repository.has_same_location(target.repository):
340
339
                self.base_rev_id = _mod_revision.ensure_null(
341
340
                    base_branch.get_rev_id(base_revision[1]))
342
341
            self._maybe_fetch(base_branch, self.this_branch, self.base_rev_id)
343
 
            self.base_is_ancestor = is_ancestor(self.this_basis, 
344
 
                                                self.base_rev_id,
345
 
                                                self.this_branch)
346
 
            self.base_is_other_ancestor = is_ancestor(self.other_basis,
347
 
                                                      self.base_rev_id,
348
 
                                                      self.this_branch)
 
342
            graph = self.this_branch.repository.get_graph()
 
343
            self.base_is_ancestor = graph.is_ancestor(self.base_rev_id,
 
344
                                                      self.this_basis)
 
345
            self.base_is_other_ancestor = graph.is_ancestor(self.base_rev_id,
 
346
                                                            self.other_basis)
349
347
 
350
348
    def do_merge(self):
351
349
        kwargs = {'working_tree':self.this_tree, 'this_tree': self.this_tree,