Amend may fail with "Nothing changed" when trying to cancel change
Using TortoiseHg 6.5.1, if one accidentally includes changes to file x in a commit and tries using Amend to cancel changes to x, the commit can keep the unwanted changes. If the amendment only consists of such cancellations, the amendment attempt can fail with a dialog titled "Nothing Committed" which contains:
Nothing changed.
This is because the way to cancel a change is unintuitive/inefficient/confusing. The user will most likely try something like the following:
-
Create a commit with (for example) modifications to 2 files
-
Select the * Working Directory * line (top)
-
Click on the arrow to the right of Commit
-
Select Amend current revision
-
Uncheck a file (left)
-
Activate the Amend button (right)
To properly cancel a change to a file, one can either:
- Instead of step #4 (closed), modify the mistakenly changed file to bring its contents back to its earlier state. This could for example be done with a text editor.
- or strip the incorrect commit using Strip's
--keep
option and perform a new commit to replace it.
This is related to ticket #3251 .