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:
265
o_revno = other_revision[1]
262
base_rev_id = common_ancestor(this_rev_id, other_basis,
264
if base_rev_id is None:
266
265
raise UnrelatedBranches()
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,
266
base_tree = get_revid_tree(this_branch, base_rev_id, tempdir,
274
268
base_is_ancestor = True
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
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,