[Bug 4965] New: hg shelve/revert -i gets confused by line-based patch selection.

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Nov 23 18:28:21 UTC 2015


https://bz.mercurial-scm.org/show_bug.cgi?id=4965

            Bug ID: 4965
           Summary: hg shelve/revert -i gets confused by line-based patch
                    selection.
           Product: Mercurial
           Version: 3.5
          Hardware: Macintosh
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: behrends at gmail.com
                CC: mercurial-devel at selenic.com

When using "hg shelve -i" with "experimental.crecord" enabled, then selecting
only individual lines of a hunk will trigger a merge with a conflict.

Example:

$ hg init tmp
$ cd tmp
$ cat >example.txt
a
b
$ hg commit -A -m example
$ cat >example.txt
a
x
y
b
$ hg shelve --config experimental.crecord=true --config ui.merge=:merge -i
# select either the line containing "x" or the one containing "y".
# Once confirmed, a merge will be attempted and result in a conflict.
$ hg resolve -m example.txt
$ cat example.txt
$ hg inc -p .hg/shelved/default.hg

At this point, example.txt will contain the result of the merge (with :merge as
the tool, this should be both an empty section and another containing both "x"
and "y" lines with conflict markers surrounding them). The expected result
would be for one line to end up on the shelf, and the other remaining in the
working directory.

A similar problem affects "hg revert -i", where selecting only part of a hunk
will act as though the entire hunk had been selected (e.g., try "hg revert -i"
instead of "hg shelve -i" above).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list