comparison tests/test-import-eol @ 8817:6c9dce20ed70

Fixed patch.eol bug that truncated all patched lines to one character Also updated the import-eol test to test with lines longer than one character, and also empty lines.
author Colin Caughie <c.caughie@indigovision.com>
date Tue, 16 Jun 2009 16:22:42 +0100
parents ac92775b3b80
children 1720d70cd6d4
comparison
equal deleted inserted replaced
8816:a7c4eb0cc0ed 8817:6c9dce20ed70
7 w('diff --git a/a b/a\n') 7 w('diff --git a/a b/a\n')
8 w('--- a/a\n') 8 w('--- a/a\n')
9 w('+++ b/a\n') 9 w('+++ b/a\n')
10 w('@@ -1,5 +1,5 @@\n') 10 w('@@ -1,5 +1,5 @@\n')
11 w(' a\n') 11 w(' a\n')
12 w('-b\r\n') 12 w('-bbb\r\n')
13 w('+y\r\n') 13 w('+yyyy\r\n')
14 w(' c\r\n') 14 w(' cc\r\n')
15 w(' \n')
15 w(' d\n') 16 w(' d\n')
16 w('-e\n') 17 w('-e\n')
17 w('\ No newline at end of file\n') 18 w('\ No newline at end of file\n')
18 w('+z\r\n') 19 w('+z\r\n')
19 w('\ No newline at end of file\r\n') 20 w('\ No newline at end of file\r\n')
22 hg init repo 23 hg init repo
23 cd repo 24 cd repo
24 echo '\.diff' > .hgignore 25 echo '\.diff' > .hgignore
25 26
26 # Test different --eol values 27 # Test different --eol values
27 python -c 'file("a", "wb").write("a\nb\nc\nd\ne")' 28 python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
28 hg ci -Am adda 29 hg ci -Am adda
29 python ../makepatch.py 30 python ../makepatch.py
30 echo % invalid eol 31 echo % invalid eol
31 hg --config patch.eol='LFCR' import eol.diff 32 hg --config patch.eol='LFCR' import eol.diff
32 hg revert -a 33 hg revert -a