diff tests/test-import @ 5852:03ce5a919ae3

patch: handle empty vs no file in git patches (issue906)
author Patrick Mezard <pmezard@gmail.com>
date Sat, 12 Jan 2008 19:35:11 +0100
parents 1fb38ef1f113
children deb0d3518674 a732eebf1958
line wrap: on
line diff
--- a/tests/test-import	Sat Jan 12 20:43:09 2008 +0100
+++ b/tests/test-import	Sat Jan 12 19:35:11 2008 +0100
@@ -153,3 +153,31 @@
 hg ci -m brancha
 hg import -v tip.patch
 cd ..
+
+# Test hunk touching empty files (issue906)
+hg init empty
+cd empty
+touch a
+touch b1
+touch c1
+echo d > d
+hg ci -Am init
+echo a > a
+echo b > b1
+hg mv b1 b2
+echo c > c1
+hg copy c1 c2
+rm d
+touch d
+hg diff --git
+hg ci -m empty
+hg export --git tip > empty.diff
+hg up -C 0
+hg import empty.diff
+for name in a b1 b2 c1 c2 d;
+do
+    echo % $name file
+    test -f $name && cat $name
+done
+cd ..
+