diff tests/test-import @ 6179:36ab165abbe2

patch: fix iterhunks() with trailing binary file removal Like some renames or copy operations, binary file removal does not generate any "file" or "hunk" action, but was not tagged as such and let iterhunk() assume no hunk was applied for the deleted file.
author Patrick Mezard <pmezard@gmail.com>
date Thu, 28 Feb 2008 00:07:37 +0100
parents 30d2fecaab76
children bace1990ab12
line wrap: on
line diff
--- a/tests/test-import	Wed Feb 27 14:58:44 2008 -0800
+++ b/tests/test-import	Thu Feb 28 00:07:37 2008 +0100
@@ -207,3 +207,21 @@
 done
 cd ..
 
+# Test importing a patch ending with a binary file removal
+echo % test trailing binary removal
+hg init binaryremoval
+cd binaryremoval
+echo a > a
+python -c "file('b', 'wb').write('a\x00b')"
+hg ci -Am addall
+hg rm a
+hg rm b
+hg st
+hg ci -m remove
+hg export --git . > remove.diff
+cat remove.diff | grep git
+hg up -C 0
+hg import remove.diff
+hg manifest
+cd ..
+