diff -r a76395713691 -r deb0d3518674 tests/test-import --- a/tests/test-import Fri Jan 11 18:33:10 2008 -0800 +++ b/tests/test-import Sat Jan 12 20:49:07 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 .. +