[Request] [+ ] D8932: commit: clear mergestate also with --amend (issue6304)
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Tue Aug 18 22:38:47 UTC 2020
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
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`.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8932
AFFECTED FILES
mercurial/cmdutil.py
tests/test-amend.t
CHANGE DETAILS
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
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)
To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200818/d44f717c/attachment.html>
More information about the Mercurial-patches
mailing list