comparison tests/test-mq-eol.t @ 39707:5abc47d4ca6b

tests: quote PYTHON usage Python3 defaults to installing under "Program Files".
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 18 Sep 2018 23:47:21 -0400
parents a67b144ef74f
children 84707d9e77a0
comparison
equal deleted inserted replaced
39706:030d558c6456 39707:5abc47d4ca6b
42 $ echo '\.rej' >> .hgignore 42 $ echo '\.rej' >> .hgignore
43 43
44 44
45 Test different --eol values 45 Test different --eol values
46 46
47 $ $PYTHON -c 'open("a", "wb").write(b"a\nb\nc\nd\ne")' 47 $ "$PYTHON" -c 'open("a", "wb").write(b"a\nb\nc\nd\ne")'
48 $ hg ci -Am adda 48 $ hg ci -Am adda
49 adding .hgignore 49 adding .hgignore
50 adding a 50 adding a
51 $ $PYTHON ../makepatch.py 51 $ "$PYTHON" ../makepatch.py
52 $ hg qimport eol.diff 52 $ hg qimport eol.diff
53 adding eol.diff to series file 53 adding eol.diff to series file
54 54
55 should fail in strict mode 55 should fail in strict mode
56 56
83 83
84 $ hg --config patch.eol='CRLF' qpush 84 $ hg --config patch.eol='CRLF' qpush
85 applying eol.diff 85 applying eol.diff
86 now at: eol.diff 86 now at: eol.diff
87 $ hg qrefresh 87 $ hg qrefresh
88 $ $PYTHON ../cateol.py .hg/patches/eol.diff 88 $ "$PYTHON" ../cateol.py .hg/patches/eol.diff
89 # HG changeset patch<LF> 89 # HG changeset patch<LF>
90 # Parent 0d0bf99a8b7a3842c6f8ef09e34f69156c4bd9d0<LF> 90 # Parent 0d0bf99a8b7a3842c6f8ef09e34f69156c4bd9d0<LF>
91 test message<LF> 91 test message<LF>
92 <LF> 92 <LF>
93 diff -r 0d0bf99a8b7a a<LF> 93 diff -r 0d0bf99a8b7a a<LF>
104 +y<CR><LF> 104 +y<CR><LF>
105 +c<CR><LF> 105 +c<CR><LF>
106 +d<CR><LF> 106 +d<CR><LF>
107 +z<LF> 107 +z<LF>
108 \ No newline at end of file<LF> 108 \ No newline at end of file<LF>
109 $ $PYTHON ../cateol.py a 109 $ "$PYTHON" ../cateol.py a
110 a<CR><LF> 110 a<CR><LF>
111 y<CR><LF> 111 y<CR><LF>
112 c<CR><LF> 112 c<CR><LF>
113 d<CR><LF> 113 d<CR><LF>
114 z 114 z
119 push again forcing LF and compare revisions 119 push again forcing LF and compare revisions
120 120
121 $ hg --config patch.eol='CRLF' qpush 121 $ hg --config patch.eol='CRLF' qpush
122 applying eol.diff 122 applying eol.diff
123 now at: eol.diff 123 now at: eol.diff
124 $ $PYTHON ../cateol.py a 124 $ "$PYTHON" ../cateol.py a
125 a<CR><LF> 125 a<CR><LF>
126 y<CR><LF> 126 y<CR><LF>
127 c<CR><LF> 127 c<CR><LF>
128 d<CR><LF> 128 d<CR><LF>
129 z 129 z
134 push again without LF and compare revisions 134 push again without LF and compare revisions
135 135
136 $ hg qpush 136 $ hg qpush
137 applying eol.diff 137 applying eol.diff
138 now at: eol.diff 138 now at: eol.diff
139 $ $PYTHON ../cateol.py a 139 $ "$PYTHON" ../cateol.py a
140 a<CR><LF> 140 a<CR><LF>
141 y<CR><LF> 141 y<CR><LF>
142 c<CR><LF> 142 c<CR><LF>
143 d<CR><LF> 143 d<CR><LF>
144 z 144 z
150 150
151 Test .rej file EOL are left unchanged 151 Test .rej file EOL are left unchanged
152 152
153 $ hg init testeol 153 $ hg init testeol
154 $ cd testeol 154 $ cd testeol
155 $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n3\r\n4')" 155 $ "$PYTHON" -c "open('a', 'wb').write(b'1\r\n2\r\n3\r\n4')"
156 $ hg ci -Am adda 156 $ hg ci -Am adda
157 adding a 157 adding a
158 $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n33\r\n4')" 158 $ "$PYTHON" -c "open('a', 'wb').write(b'1\r\n2\r\n33\r\n4')"
159 $ hg qnew patch1 159 $ hg qnew patch1
160 $ hg qpop 160 $ hg qpop
161 popping patch1 161 popping patch1
162 patch queue now empty 162 patch queue now empty
163 $ $PYTHON -c "open('a', 'wb').write(b'1\r\n22\r\n33\r\n4')" 163 $ "$PYTHON" -c "open('a', 'wb').write(b'1\r\n22\r\n33\r\n4')"
164 $ hg ci -m changea 164 $ hg ci -m changea
165 165
166 $ hg --config 'patch.eol=LF' qpush 166 $ hg --config 'patch.eol=LF' qpush
167 applying patch1 167 applying patch1
168 patching file a 168 patching file a