Bug 5805 - Amend doesn't check for outstanding merge conflicts
Summary: Amend doesn't check for outstanding merge conflicts
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 4.4.2
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-25 01:03 UTC by Matt Harbison
Modified: 2018-03-21 00:00 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Harbison 2018-02-25 01:03 UTC
I tweaked some code and ran a test a couple of revisions prior to the tip, accepting the changes.  I then did an update, but bailed on resolving the test conflicts because there were too many, and simply reran the test.  I totally forgot about the unmerged state until I tried updating elsewhere.  But in the meantime, it let me (evolve) amend, and `hg ci --amend` (with evolve disabled).  The working directory is clean (and summary agrees, though it notes one unresolved file, as does `hg resolve --list`).  Vanilla commit and update are both blocked.

I can see a selective amend (-I/-X/path) after an update being useful even if there are unresolved files, as long as the selected ones aren't unresolved.  But allowing an unresolved file to be amended feels like a bug.  If not, it should probably clear the unresolved state.
Comment 1 Yuya Nishihara 2018-02-25 08:25 UTC
> allowing an unresolved file to be amended feels like a bug

Yeah, sounds like a bug. I guess the amend would abort before e8a7c1a0565a
"cmdutil: remove the redundant commit during amend."
Comment 2 Sushil khanchi 2018-03-05 02:36 UTC
Hey, I am not able to reproduce this. Can I get some clear understanding of how I can reproduce this?
Comment 3 Sushil khanchi 2018-03-05 08:12 UTC
okay, now I am able to reproduce this.
Comment 4 HG Bot 2018-03-13 03:15 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/eeb87b24aea7
Yuya Nishihara <yuya@tcha.org>
amend: abort if unresolved merge conflicts found (issue5805)

It was checked by repo.commit() before e8a7c1a0565a "cmdutil: remove the
redundant commit during amend."

(please test the fix)
Comment 5 Bugzilla 2018-03-21 00:00 UTC
Bug was set to TESTING for 7 days, resolving