changeset 45388:6ba7190ff863

commit: clear mergestate also with --amend (issue6304) The `hg commit --amend` uses the in-memory code, which naturally doesn't touch the merge state (well, it shouldn't anyway; I think I've fixed bugs in that area recently). We therefore need to clear the mergestate after calling `repo.commitctx()` since we expect that from `hg commit --amend`. Differential Revision: https://phab.mercurial-scm.org/D8932
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 18 Aug 2020 15:03:57 -0700
parents cf21cda4281f
children 7d24201b6447
files mercurial/cmdutil.py tests/test-amend.t
diffstat 2 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Aug 18 14:26:49 2020 -0700
+++ b/mercurial/cmdutil.py	Tue Aug 18 15:03:57 2020 -0700
@@ -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)
--- a/tests/test-amend.t	Tue Aug 18 14:26:49 2020 -0700
+++ b/tests/test-amend.t	Tue Aug 18 15:03:57 2020 -0700
@@ -113,7 +113,6 @@
   $ hg ci --amend --config experimental.evolution.allowunstable=True
   1 new orphan changesets
   $ hg resolve -l
-  R f
   $ cd ..
 #endif