~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Lalo Martins
  • Date: 2005-09-15 15:16:12 UTC
  • mfrom: (1185.1.18)
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050915151611-86c5de4298bb71f9
merging from integration again.

This is a "checkpoint" commit; the tests don't actually pass, but all the
really hard stuff has been merged (in particular, Aaron's new ancestor:
namespace was moved to revisionspec).

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.changeset import generate_changeset, ExceptionConflictHandler
28
28
from bzrlib.changeset import Inventory, Diff3Merge
29
29
from bzrlib.branch import Branch
30
 
from bzrlib.errors import BzrCommandError, UnrelatedBranches
 
30
from bzrlib.errors import BzrCommandError, UnrelatedBranches, NoCommonAncestor
 
31
from bzrlib.errors import NoCommits
31
32
from bzrlib.delta import compare_trees
32
33
from bzrlib.trace import mutter, warning
33
34
from bzrlib.fetch import greedy_fetch
256
257
                                            this_branch)
257
258
        if other_revision[1] == -1:
258
259
            other_rev_id = other_branch.last_patch()
 
260
            if other_rev_id is None:
 
261
                raise NoCommits(other_branch)
259
262
            other_basis = other_rev_id
260
263
        elif other_revision[1] is not None:
261
264
            other_rev_id = other_branch.get_rev_id(other_revision[1])
263
266
        else:
264
267
            other_rev_id = None
265
268
            other_basis = other_branch.last_patch()
 
269
            if other_basis is None:
 
270
                raise NoCommits(other_branch)
266
271
        if base_revision == [None, None]:
267
 
            base_rev_id = common_ancestor(this_rev_id, other_basis, 
268
 
                                          this_branch)
269
 
            if base_rev_id is None:
 
272
            try:
 
273
                base_rev_id = common_ancestor(this_rev_id, other_basis, 
 
274
                                              this_branch)
 
275
            except NoCommonAncestor:
270
276
                raise UnrelatedBranches()
271
277
            base_tree = get_revid_tree(this_branch, base_rev_id, tempdir, 
272
278
                                       "base", None)