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

            Bug ID: 5917
           Summary: record (e.g. `hg ci -i` and `hg split`) crashes with
                    "bad hunk #1" if diff makes a file empty
           Product: Mercurial
           Version: 4.6
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzi...@mercurial-scm.org
          Reporter: martinv...@google.com
                CC: mercurial-devel@mercurial-scm.org

Here's a patch showing a test case that passes:

diff --git a/tests/test-commit-interactive-curses.t
b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -214,6 +214,16 @@ Amend option works
   @@ -0,0 +1,1 @@
   +hello world

+Make file empty
+  $ echo -n > x
+  $ cat <<EOF >testModeCommands
+  > X
+  > EOF
+  $ hg ci -i -m emptify -d "0 0"
+  abort: bad hunk #1
+  [255]
+  $ hg revert x
+
 Editing a hunk puts you back on that hunk when done editing (issue5041)
 To do that, we change two lines in a file, pretend to edit the second line,
 exit, toggle the line selected at the end of the edit and commit.

-- 
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