Thread: "[PATCH RFC] revert: add --force option" Prior to 1.9, when running 'hg revert' on an uncommitted merge, you had to (a) pass either -a or some files, (b) and pass '-r .'. Now as of afe0d4c24866 someone can revert some files in the working copy to the first merge parent and then commit, effectively backing out all work done in those files, without any warnings being displayed. This is a particular risk for novice users encountering merge conflicts and becoming confused by uncommitted modifications coming from the second merge parent. At least before, they would get an error message and be forced to pass '-r .'.
Fixed by http://selenic.com/repo/hg/rev/a934b9249574 Matt Mackall <mpm@selenic.com> revert: restore check for uncommitted merge (issue2915) (BC) (please test the fix)
Backout does appear to restore pre-1.9 behavior as expected. Would still suggest an explicit warning about the possible consequences from revert on a merge (even with -r. file...) and accompanying help text, but this would be a separate issue.
It works for me: $ hg sum parent: 2:053c740ae2ab tip 2 parent: 1:74c87a2fdc75 1 branch: default commit: 1 modified, 1 removed (merge) update: (current) $ hg revert -a abort: uncommitted merge with no revision specified (use "hg update" or see "hg help revert")
how does this solve the "for every do there must be an undo" which is so appreciated by novice users? the workflow now is again back to: 1. hg merge 2. hg revert --> error message 3. hg update --> error message 4. hg help revert --> long text not specific to the situation before 5. swear and contact support if there is one there should be a better way to cope with the problem, better help text or just accept that nonsense can be committed. then stripe it from the repository if you did not publish it, or revert this commit.
The issues relevant to this bug are resolved, closing. Other issues need their own bug reports.
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:21 EDT --- This bug was previously known as _bug_ 2915 at http://mercurial.selenic.com/bts/issue2915