~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

merge from abently, take his fixes for merge in preference

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
            other_rev_id = None
260
260
            other_basis = other_branch.last_patch()
261
261
        if base_revision == [None, None]:
262
 
            if other_revision[1] == -1:
263
 
                o_revno = None
264
 
            else:
265
 
                o_revno = other_revision[1]
 
262
            base_rev_id = common_ancestor(this_rev_id, other_basis, 
 
263
                                          this_branch)
 
264
            if base_rev_id is None:
266
265
                raise UnrelatedBranches()
267
 
            try:
268
 
                base_revision = this_branch.get_revision(base_rev_id)
269
 
                base_branch = this_branch
270
 
            except NoSuchRevision:
271
 
                base_branch = other_branch
272
 
            base_tree = get_revid_tree(base_branch, base_rev_id, tempdir, 
273
 
                                       "base")
 
266
            base_tree = get_revid_tree(this_branch, base_rev_id, tempdir, 
 
267
                                       "base", None)
274
268
            base_is_ancestor = True
275
269
        else:
276
 
            if base_revision[1] == "auto":
277
 
                base_revno, base_rev_id = this_branch.common_ancestor(other_branch)
278
 
                base_branch, base_tree = get_tree((base_revision[0], "revid:%s" % base_rev_id), tempdir, "base")
279
 
            elif base_revision[1] == -1:
280
 
                base_branch, base_tree = get_tree(base_revision, tempdir, "base")
 
270
            base_branch, base_tree = get_tree(base_revision, tempdir, "base")
 
271
            if base_revision[1] == -1:
281
272
                base_rev_id = base_branch.last_patch()
282
273
            elif base_revision[1] is None:
283
 
                base_branch, base_tree = get_tree(base_revision, tempdir, "base")
284
274
                base_rev_id = None
285
275
            else:
286
 
                base_branch, base_tree = get_tree(base_revision, tempdir, "base")
287
276
                base_rev_id = base_branch.lookup_revision(base_revision[1])
288
277
            if base_rev_id is not None:
289
278
                base_is_ancestor = is_ancestor(this_rev_id, base_rev_id,