--- a/mercurial/cmdutil.py Fri Sep 01 20:28:26 2017 +0000
+++ b/mercurial/cmdutil.py Fri Sep 01 15:08:54 2017 -0700
@@ -3173,13 +3173,14 @@
newid = repo.commitctx(new)
finally:
repo.ui.setconfig('phases', 'new-commit', ph, 'amend')
- if newid != old.node():
- # Reroute the working copy parent to the new changeset
- repo.setparents(newid, nullid)
- mapping = {old.node(): (newid,)}
- if node:
- mapping[node] = ()
- scmutil.cleanupnodes(repo, mapping, 'amend')
+
+ # Reroute the working copy parent to the new changeset
+ repo.setparents(newid, nullid)
+ mapping = {old.node(): (newid,)}
+ if node:
+ mapping[node] = ()
+ scmutil.cleanupnodes(repo, mapping, 'amend')
+
return newid
def commiteditor(repo, ctx, subs, editform=''):