diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -649,7 +649,7 @@ repo.ui.setconfig( b'ui', b'forcemerge', opts.get(b'tool', b''), b'histedit' ) - stats = mergemod.graft(repo, ctx, ctx.p1(), [b'local', b'histedit']) + stats = mergemod.graft(repo, ctx, labels=[b'local', b'histedit']) finally: repo.ui.setconfig(b'ui', b'forcemerge', b'', b'histedit') return stats diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -2592,7 +2592,7 @@ def graft( repo, ctx, - base, + base=None, labels=None, keepparent=False, keepconflictparent=False, @@ -2607,7 +2607,7 @@ renames/copies appropriately. ctx - changeset to rebase - base - merge base, usually ctx.p1() + base - merge base, or ctx.p1() if not specified labels - merge labels eg ['local', 'graft'] keepparent - keep second parent if any keepconflictparent - if unresolved, keep parent used for the merge @@ -2621,6 +2621,7 @@ # which local deleted". wctx = wctx or repo[None] pctx = wctx.p1() + base = base or ctx.p1() mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node()) stats = update( diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -996,7 +996,6 @@ stats = merge.graft( repo, shelvectx, - shelvectx.p1(), labels=[b'shelve', b'working-copy'], keepconflictparent=True, )