tests/test-import-eol
changeset 10127 d8214e944b84
parent 10102 1720d70cd6d4
child 10130 7936cd261dc9
--- a/tests/test-import-eol	Wed Dec 23 19:18:03 2009 +0100
+++ b/tests/test-import-eol	Wed Dec 23 19:31:47 2009 +0100
@@ -57,6 +57,21 @@
 python -c 'print repr(file("a","rb").read())'
 hg st
 
+echo % auto EOL on new file or source without any EOL
+python -c 'file("noeol", "wb").write("noeol")'
+hg add noeol
+hg commit -m 'add noeol'
+python -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")'
+python -c 'file("neweol", "wb").write("neweol\nneweol\r\n")'
+hg add neweol
+hg diff --git > noeol.diff
+hg revert --no-backup noeol neweol
+rm neweol
+hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
+python -c 'print repr(file("noeol","rb").read())'
+python -c 'print repr(file("neweol","rb").read())'
+hg st
+
 # Test --eol and binary patches
 python -c 'file("b", "wb").write("a\x00\nb")'
 hg ci -Am addb