[Bug 4793] New: revert -i leaves behind .orig files for no-op reverts

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Aug 24 22:45:55 UTC 2015


http://bz.selenic.com/show_bug.cgi?id=4793

          Priority: normal
            Bug ID: 4793
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: revert -i leaves behind .orig files for no-op reverts
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: nathan12343 at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.5
         Component: Mercurial
           Product: Mercurial

The new "hg revert -i" command will leave behind .orig files for hunks that
were not reverted.  Here's a short example illustrating the behavior:

$ mkdir test_repo
$ cd test_repo
$ hg init
$ echo "revert bug" > a
$ hg add a
$ hg commit -m "adding file to no-op revert"
$ echo " revert bug" > a
$ hg revert -i
< enter record interface >
$ y
$ n
< exit record interface >

The working directory should now contain both a file named "a" and a file named
"a.orig" with the same content as "a".

I'd argue that for no-op reverts, we shouldn't generate a .orig file, since it
adds unnecessary noise to "hg status". This behavior confused me and led me to
file the report in the first place, since I thought that the reverts I didn't
want applied *were* in fact applied since .orig files were generated.

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


More information about the Mercurial-devel mailing list