comparison tests/test-import-eol.t @ 22947:c63a09b6b337

tests: use $PYTHON instead of hardcoding python This makes running the testsuite with pypy possible.
author Augie Fackler <raf@durin42.com>
date Wed, 15 Oct 2014 15:35:59 -0400
parents 7439ea4146f8
children 75be14993fda
comparison
equal deleted inserted replaced
22946:77c121da6143 22947:c63a09b6b337
23 $ echo '\.diff' > .hgignore 23 $ echo '\.diff' > .hgignore
24 24
25 25
26 Test different --eol values 26 Test different --eol values
27 27
28 $ python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")' 28 $ $PYTHON -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
29 $ hg ci -Am adda 29 $ hg ci -Am adda
30 adding .hgignore 30 adding .hgignore
31 adding a 31 adding a
32 $ python ../makepatch.py 32 $ python ../makepatch.py
33 33
87 $ hg st 87 $ hg st
88 88
89 89
90 auto EOL on CRLF file 90 auto EOL on CRLF file
91 91
92 $ python -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")' 92 $ $PYTHON -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")'
93 $ hg commit -m 'switch EOLs in a' 93 $ hg commit -m 'switch EOLs in a'
94 $ hg --traceback --config patch.eol='auto' import eol.diff 94 $ hg --traceback --config patch.eol='auto' import eol.diff
95 applying eol.diff 95 applying eol.diff
96 $ cat a 96 $ cat a
97 a\r (esc) 97 a\r (esc)
103 $ hg st 103 $ hg st
104 104
105 105
106 auto EOL on new file or source without any EOL 106 auto EOL on new file or source without any EOL
107 107
108 $ python -c 'file("noeol", "wb").write("noeol")' 108 $ $PYTHON -c 'file("noeol", "wb").write("noeol")'
109 $ hg add noeol 109 $ hg add noeol
110 $ hg commit -m 'add noeol' 110 $ hg commit -m 'add noeol'
111 $ python -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")' 111 $ $PYTHON -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")'
112 $ python -c 'file("neweol", "wb").write("neweol\nneweol\r\n")' 112 $ $PYTHON -c 'file("neweol", "wb").write("neweol\nneweol\r\n")'
113 $ hg add neweol 113 $ hg add neweol
114 $ hg diff --git > noeol.diff 114 $ hg diff --git > noeol.diff
115 $ hg revert --no-backup noeol neweol 115 $ hg revert --no-backup noeol neweol
116 $ rm neweol 116 $ rm neweol
117 $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff 117 $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
125 $ hg st 125 $ hg st
126 126
127 127
128 Test --eol and binary patches 128 Test --eol and binary patches
129 129
130 $ python -c 'file("b", "wb").write("a\x00\nb\r\nd")' 130 $ $PYTHON -c 'file("b", "wb").write("a\x00\nb\r\nd")'
131 $ hg ci -Am addb 131 $ hg ci -Am addb
132 adding b 132 adding b
133 $ python -c 'file("b", "wb").write("a\x00\nc\r\nd")' 133 $ $PYTHON -c 'file("b", "wb").write("a\x00\nc\r\nd")'
134 $ hg diff --git > bin.diff 134 $ hg diff --git > bin.diff
135 $ hg revert --no-backup b 135 $ hg revert --no-backup b
136 136
137 binary patch with --eol 137 binary patch with --eol
138 138