Commit and empty file, add two lines to it, then try to revert one of the added lines using "hg revert -i". Both lines will be reverted. Note that "hg commit -i" can add correctly add either of the lines. This shows the bug: hg init touch f hg add f hg ci -m empty printf 'a\nb\n' > f hg ci -i Select one of the lines and confirm. Both will be reverted.
You example does not list 'hg revert' is the last 'hg ci' supposed to be revert?
Oops, yes, "hg revert -i" was what I meant there.
I think I just fond the same bug. Create a test repo: hg init r2 cd r2 seq 1 5 > a hg ci -A a -m a Add two lines in the working copy: seq 6 7 >> a And try to do the revert: hg revert -i --config ui.interface=curses a Select one line, unselect the other, using crecord: [~] diff --git a/a b/a 1 hunks, 2 lines changed [~] @@ -4,2 +4,4 @@ 3 4 5 [x] +6 [ ] +7 Actual: Both lines gets reverted. Expected: Only 6 or 7 gets reverted. Since "text" record does not allow you to select individual lines, it is only a problem of crecord.
*** Bug 5437 has been marked as a duplicate of this bug. ***
Bug was inactive for 150 days, archiving
I ran into this problem today. With this bug, it's easy to miss a result very different from expected.
Should be fixed by https://www.mercurial-scm.org/repo/hg/rev/66117dae87f9