--- a/hgext/rebase.py Mon Jan 13 11:11:20 2020 -0800
+++ b/hgext/rebase.py Mon Jan 13 11:18:29 2020 -0800
@@ -1486,15 +1486,16 @@
repo.ui.debug(b" merge against %d:%s\n" % (rev, ctx))
if base is not None:
repo.ui.debug(b" detach base %d:%s\n" % (base, repo[base]))
- # When collapsing in-place, the parent is the common ancestor, we
- # have to allow merging with it.
+
+ # See explanation in merge.graft()
+ mergeancestor = repo.changelog.isancestor(p1ctx.node(), ctx.node())
stats = mergemod.update(
repo,
rev,
branchmerge=True,
force=True,
ancestor=base,
- mergeancestor=collapse,
+ mergeancestor=mergeancestor,
labels=[b'dest', b'source'],
wc=wctx,
)