diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3259,6 +3259,7 @@ if opts.get(b'secret'): commitphase = phases.secret newid = repo.commitctx(new) + ms.reset() # Reroute the working copy parent to the new changeset repo.setparents(newid, nullid) diff --git a/tests/test-amend.t b/tests/test-amend.t --- a/tests/test-amend.t +++ b/tests/test-amend.t @@ -113,7 +113,6 @@ $ hg ci --amend --config experimental.evolution.allowunstable=True 1 new orphan changesets $ hg resolve -l - R f $ cd .. #endif