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

            Bug ID: 5925
           Summary: Make it possible to abort an amend --patch by saving
                    an empty file
           Product: Mercurial
           Version: default branch
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: evolution
          Assignee: bugzi...@mercurial-scm.org
          Reporter: paul.more...@octobus.net
                CC: mercurial-devel@mercurial-scm.org,
                    pierre-yves.da...@ens-lyon.org

The following script leads to a broken dirstate when the patch for `hg amend
--patch` is empty.

  $ hg init test
  $ cd test
  $ echo a > a
  $ hg add a
  $ hg commit -m "a"
  $ echo b > b
  $ hg add b
  $ hg commit -m "b"
  $ hg amend --patch // REMOVE EVERYTING
  $ hg log -G
  @  changeset:   2:405e555b85f7
     tag:         tip
     parent:      -1:000000000000
     user:        Paul Morelle <paul.more...@octobus.net>
     date:        Wed Jun 20 19:25:11 2018 +0200

  o  changeset:   0:6e91fe9d36e5
     user:        Paul Morelle <paul.more...@octobus.net>
     date:        Wed Jun 20 19:24:13 2018 +0200
     summary:     a
  $ ls -A
  .hg

My expectation is that, just like saving an empty commit message aborts the
commit or amend, saving an empty patch aborts the amend --patch command.

Instead, my commit is changed, the summary and all the files are removed, and
the parent is set to null.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to