##// END OF EJS Templates
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich -
r12943:7439ea41 stable
parent child Browse files
Show More
@@ -117,11 +117,11 b' Unfortunately, non-conflicting changes, '
117 117 "c" file in p1.1 patch are reverted too.
118 118 Just to say that manifest not listing "c" here is a bug.
119 119
120 $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6 | "$TESTDIR"/printrepr.py
121 o 6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc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3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h (esc)
122 122 |
123 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5 | "$TESTDIR"/printrepr.py
124 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g
123 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5
124 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g (esc)
125 125 |
126 126 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
127 127 |
@@ -128,8 +128,8 b' Convert while testing all possible outpu'
128 128
129 129 Check tags are in UTF-8
130 130
131 $ python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
132 '221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e\n'
133 '7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9\n'
131 $ cat .hgtags
132 221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e (esc)
133 7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9 (esc)
134 134
135 135 $ cd ..
@@ -48,7 +48,7 b' Test adding .hgeol'
48 48 > echo '% hg status'
49 49 > hg status
50 50 > echo '% hg tip -p'
51 > hg tip -p | python $TESTDIR/printrepr.py
51 > hg tip -p
52 52 > cd ..
53 53 > rm -r repo-$1
54 54 > }
@@ -118,8 +118,8 b' Test adding .hgeol'
118 118 -first
119 119 -second
120 120 -third
121 +first\r
122 +second\r
123 +third\r
121 +first\r (esc)
122 +second\r (esc)
123 +third\r (esc)
124 124
125 125 $ rm -r repo
@@ -31,11 +31,11 b' Clone'
31 31 updating to branch default
32 32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 33 $ cd repo-2
34 $ python $TESTDIR/printrepr.py < a.txt
35 first\r
36 second\r
37 third\r
38 $ hg cat a.txt | python $TESTDIR/printrepr.py
34 $ cat a.txt
35 first\r (esc)
36 second\r (esc)
37 third\r (esc)
38 $ hg cat a.txt
39 39 first
40 40 second
41 41 third
@@ -51,7 +51,7 b' Test clone of repo with .hgeol in workin'
51 51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 52 $ cd repo-3
53 53
54 $ python $TESTDIR/printrepr.py < a.txt
54 $ cat a.txt
55 55 first
56 56 second
57 57 third
@@ -71,7 +71,7 b' Test clone of revision with .hgeol'
71 71 [patterns]
72 72 **.txt = native
73 73
74 $ python $TESTDIR/printrepr.py < a.txt
75 first\r
76 second\r
77 third\r
74 $ cat a.txt
75 first\r (esc)
76 second\r (esc)
77 third\r (esc)
@@ -50,30 +50,30 b' Set up helpers'
50 50 > native = $1
51 51 > EOF
52 52 > hg update
53 > echo '% printrepr.py native.txt'
54 > python $TESTDIR/printrepr.py < native.txt
55 > echo '% printrepr.py unix.txt'
56 > python $TESTDIR/printrepr.py < unix.txt
57 > echo '% printrepr.py win.txt'
58 > python $TESTDIR/printrepr.py < win.txt
53 > echo '% native.txt'
54 > cat native.txt
55 > echo '% unix.txt'
56 > cat unix.txt
57 > echo '% win.txt'
58 > cat win.txt
59 59 > printf "first${EOL}third${EOL}" > native.txt
60 60 > printf "first\r\nthird\r\n" > win.txt
61 61 > printf "first\nthird\n" > unix.txt
62 62 > echo '% hg diff'
63 63 > hg diff > p
64 > python $TESTDIR/printrepr.py < p
64 > cat p
65 65 > echo '% hg revert'
66 66 > hg revert --all
67 67 > echo '% hg import'
68 68 > hg import -m 'patch' p
69 > echo '% printrepr.py native.txt'
70 > python $TESTDIR/printrepr.py < native.txt
71 > echo '% printrepr.py unix.txt'
72 > python $TESTDIR/printrepr.py < unix.txt
73 > echo '% printrepr.py win.txt'
74 > python $TESTDIR/printrepr.py < win.txt
69 > echo '% native.txt'
70 > cat native.txt
71 > echo '% unix.txt'
72 > cat unix.txt
73 > echo '% win.txt'
74 > cat win.txt
75 75 > echo '% hg diff -c tip'
76 > hg diff -c tip | python $TESTDIR/printrepr.py
76 > hg diff -c tip
77 77 > cd ..
78 78 > rm -r repo-$1
79 79 > }
@@ -92,18 +92,18 b' Run tests'
92 92
93 93 % hg clone repo repo-LF
94 94 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 % printrepr.py native.txt
95 % native.txt
96 96 first
97 97 second
98 98 third
99 % printrepr.py unix.txt
99 % unix.txt
100 100 first
101 101 second
102 102 third
103 % printrepr.py win.txt
104 first\r
105 second\r
106 third\r
103 % win.txt
104 first\r (esc)
105 second\r (esc)
106 third\r (esc)
107 107 % hg diff
108 108 diff --git a/native.txt b/native.txt
109 109 --- a/native.txt
@@ -123,24 +123,24 b' Run tests'
123 123 --- a/win.txt
124 124 +++ b/win.txt
125 125 @@ -1,3 +1,2 @@
126 first\r
127 -second\r
128 third\r
126 first\r (esc)
127 -second\r (esc)
128 third\r (esc)
129 129 % hg revert
130 130 reverting native.txt
131 131 reverting unix.txt
132 132 reverting win.txt
133 133 % hg import
134 134 applying p
135 % printrepr.py native.txt
135 % native.txt
136 136 first
137 137 third
138 % printrepr.py unix.txt
138 % unix.txt
139 139 first
140 140 third
141 % printrepr.py win.txt
142 first\r
143 third\r
141 % win.txt
142 first\r (esc)
143 third\r (esc)
144 144 % hg diff -c tip
145 145 diff --git a/native.txt b/native.txt
146 146 --- a/native.txt
@@ -160,25 +160,25 b' Run tests'
160 160 --- a/win.txt
161 161 +++ b/win.txt
162 162 @@ -1,3 +1,2 @@
163 first\r
164 -second\r
165 third\r
163 first\r (esc)
164 -second\r (esc)
165 third\r (esc)
166 166 $ dotest CRLF
167 167
168 168 % hg clone repo repo-CRLF
169 169 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 % printrepr.py native.txt
171 first\r
172 second\r
173 third\r
174 % printrepr.py unix.txt
170 % native.txt
171 first\r (esc)
172 second\r (esc)
173 third\r (esc)
174 % unix.txt
175 175 first
176 176 second
177 177 third
178 % printrepr.py win.txt
179 first\r
180 second\r
181 third\r
178 % win.txt
179 first\r (esc)
180 second\r (esc)
181 third\r (esc)
182 182 % hg diff
183 183 diff --git a/native.txt b/native.txt
184 184 --- a/native.txt
@@ -198,24 +198,24 b' Run tests'
198 198 --- a/win.txt
199 199 +++ b/win.txt
200 200 @@ -1,3 +1,2 @@
201 first\r
202 -second\r
203 third\r
201 first\r (esc)
202 -second\r (esc)
203 third\r (esc)
204 204 % hg revert
205 205 reverting native.txt
206 206 reverting unix.txt
207 207 reverting win.txt
208 208 % hg import
209 209 applying p
210 % printrepr.py native.txt
211 first\r
212 third\r
213 % printrepr.py unix.txt
210 % native.txt
211 first\r (esc)
212 third\r (esc)
213 % unix.txt
214 214 first
215 215 third
216 % printrepr.py win.txt
217 first\r
218 third\r
216 % win.txt
217 first\r (esc)
218 third\r (esc)
219 219 % hg diff -c tip
220 220 diff --git a/native.txt b/native.txt
221 221 --- a/native.txt
@@ -235,9 +235,9 b' Run tests'
235 235 --- a/win.txt
236 236 +++ b/win.txt
237 237 @@ -1,3 +1,2 @@
238 first\r
239 -second\r
240 third\r
238 first\r (esc)
239 -second\r (esc)
240 third\r (esc)
241 241 $ rm -r repo
242 242 $ makerepo CRLF
243 243
@@ -251,26 +251,26 b' Run tests'
251 251
252 252 % hg clone repo repo-LF
253 253 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 % printrepr.py native.txt
254 % native.txt
255 255 first
256 256 second
257 257 third
258 % printrepr.py unix.txt
258 % unix.txt
259 259 first
260 260 second
261 261 third
262 % printrepr.py win.txt
263 first\r
264 second\r
265 third\r
262 % win.txt
263 first\r (esc)
264 second\r (esc)
265 third\r (esc)
266 266 % hg diff
267 267 diff --git a/native.txt b/native.txt
268 268 --- a/native.txt
269 269 +++ b/native.txt
270 270 @@ -1,3 +1,2 @@
271 first\r
272 -second\r
273 third\r
271 first\r (esc)
272 -second\r (esc)
273 third\r (esc)
274 274 diff --git a/unix.txt b/unix.txt
275 275 --- a/unix.txt
276 276 +++ b/unix.txt
@@ -282,32 +282,32 b' Run tests'
282 282 --- a/win.txt
283 283 +++ b/win.txt
284 284 @@ -1,3 +1,2 @@
285 first\r
286 -second\r
287 third\r
285 first\r (esc)
286 -second\r (esc)
287 third\r (esc)
288 288 % hg revert
289 289 reverting native.txt
290 290 reverting unix.txt
291 291 reverting win.txt
292 292 % hg import
293 293 applying p
294 % printrepr.py native.txt
294 % native.txt
295 295 first
296 296 third
297 % printrepr.py unix.txt
297 % unix.txt
298 298 first
299 299 third
300 % printrepr.py win.txt
301 first\r
302 third\r
300 % win.txt
301 first\r (esc)
302 third\r (esc)
303 303 % hg diff -c tip
304 304 diff --git a/native.txt b/native.txt
305 305 --- a/native.txt
306 306 +++ b/native.txt
307 307 @@ -1,3 +1,2 @@
308 first\r
309 -second\r
310 third\r
308 first\r (esc)
309 -second\r (esc)
310 third\r (esc)
311 311 diff --git a/unix.txt b/unix.txt
312 312 --- a/unix.txt
313 313 +++ b/unix.txt
@@ -319,33 +319,33 b' Run tests'
319 319 --- a/win.txt
320 320 +++ b/win.txt
321 321 @@ -1,3 +1,2 @@
322 first\r
323 -second\r
324 third\r
322 first\r (esc)
323 -second\r (esc)
324 third\r (esc)
325 325 $ dotest CRLF
326 326
327 327 % hg clone repo repo-CRLF
328 328 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 % printrepr.py native.txt
330 first\r
331 second\r
332 third\r
333 % printrepr.py unix.txt
329 % native.txt
330 first\r (esc)
331 second\r (esc)
332 third\r (esc)
333 % unix.txt
334 334 first
335 335 second
336 336 third
337 % printrepr.py win.txt
338 first\r
339 second\r
340 third\r
337 % win.txt
338 first\r (esc)
339 second\r (esc)
340 third\r (esc)
341 341 % hg diff
342 342 diff --git a/native.txt b/native.txt
343 343 --- a/native.txt
344 344 +++ b/native.txt
345 345 @@ -1,3 +1,2 @@
346 first\r
347 -second\r
348 third\r
346 first\r (esc)
347 -second\r (esc)
348 third\r (esc)
349 349 diff --git a/unix.txt b/unix.txt
350 350 --- a/unix.txt
351 351 +++ b/unix.txt
@@ -357,32 +357,32 b' Run tests'
357 357 --- a/win.txt
358 358 +++ b/win.txt
359 359 @@ -1,3 +1,2 @@
360 first\r
361 -second\r
362 third\r
360 first\r (esc)
361 -second\r (esc)
362 third\r (esc)
363 363 % hg revert
364 364 reverting native.txt
365 365 reverting unix.txt
366 366 reverting win.txt
367 367 % hg import
368 368 applying p
369 % printrepr.py native.txt
370 first\r
371 third\r
372 % printrepr.py unix.txt
369 % native.txt
370 first\r (esc)
371 third\r (esc)
372 % unix.txt
373 373 first
374 374 third
375 % printrepr.py win.txt
376 first\r
377 third\r
375 % win.txt
376 first\r (esc)
377 third\r (esc)
378 378 % hg diff -c tip
379 379 diff --git a/native.txt b/native.txt
380 380 --- a/native.txt
381 381 +++ b/native.txt
382 382 @@ -1,3 +1,2 @@
383 first\r
384 -second\r
385 third\r
383 first\r (esc)
384 -second\r (esc)
385 third\r (esc)
386 386 diff --git a/unix.txt b/unix.txt
387 387 --- a/unix.txt
388 388 +++ b/unix.txt
@@ -394,7 +394,7 b' Run tests'
394 394 --- a/win.txt
395 395 +++ b/win.txt
396 396 @@ -1,3 +1,2 @@
397 first\r
398 -second\r
399 third\r
397 first\r (esc)
398 -second\r (esc)
399 third\r (esc)
400 400 $ rm -r repo
@@ -54,23 +54,23 b' Test EOL update'
54 54 >
55 55 > hg update
56 56 >
57 > echo '% printrepr.py a.txt (before)'
58 > python $TESTDIR/printrepr.py < a.txt
57 > echo '% a.txt (before)'
58 > cat a.txt
59 59 >
60 60 > printf "first${EOL}third${EOL}" > a.txt
61 61 >
62 > echo '% printrepr.py a.txt (after)'
63 > python $TESTDIR/printrepr.py < a.txt
62 > echo '% a.txt (after)'
63 > cat a.txt
64 64 > echo '% hg diff'
65 > hg diff | python $TESTDIR/printrepr.py
65 > hg diff
66 66 >
67 67 > echo '% hg update 0'
68 68 > hg update 0
69 69 >
70 > echo '% printrepr.py a.txt'
71 > python $TESTDIR/printrepr.py < a.txt
70 > echo '% a.txt'
71 > cat a.txt
72 72 > echo '% hg diff'
73 > hg diff | python $TESTDIR/printrepr.py
73 > hg diff
74 74 >
75 75 >
76 76 > cd ..
@@ -87,11 +87,11 b' Test EOL update'
87 87
88 88 % hg clone repo repo-LF
89 89 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 % printrepr.py a.txt (before)
91 first\r
92 second\r
93 third\r
94 % printrepr.py a.txt (after)
90 % a.txt (before)
91 first\r (esc)
92 second\r (esc)
93 third\r (esc)
94 % a.txt (after)
95 95 first
96 96 third
97 97 % hg diff
@@ -99,13 +99,13 b' Test EOL update'
99 99 --- a/a.txt
100 100 +++ b/a.txt
101 101 @@ -1,3 +1,2 @@
102 first\r
103 -second\r
104 third\r
102 first\r (esc)
103 -second\r (esc)
104 third\r (esc)
105 105 % hg update 0
106 106 merging a.txt
107 107 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
108 % printrepr.py a.txt
108 % a.txt
109 109 first
110 110 third
111 111 % hg diff
@@ -120,25 +120,25 b' Test EOL update'
120 120
121 121 % hg clone repo repo-CRLF
122 122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 % printrepr.py a.txt (before)
124 first\r
125 second\r
126 third\r
127 % printrepr.py a.txt (after)
128 first\r
129 third\r
123 % a.txt (before)
124 first\r (esc)
125 second\r (esc)
126 third\r (esc)
127 % a.txt (after)
128 first\r (esc)
129 third\r (esc)
130 130 % hg diff
131 131 diff --git a/a.txt b/a.txt
132 132 --- a/a.txt
133 133 +++ b/a.txt
134 134 @@ -1,3 +1,2 @@
135 first\r
136 -second\r
137 third\r
135 first\r (esc)
136 -second\r (esc)
137 third\r (esc)
138 138 % hg update 0
139 139 merging a.txt
140 140 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
141 % printrepr.py a.txt
141 % a.txt
142 142 first
143 143 third
144 144 % hg diff
@@ -61,20 +61,20 b' Set up helpers'
61 61 > native = $1
62 62 > EOF
63 63 > hg update
64 > echo '% printrepr.py a.txt'
65 > python $TESTDIR/printrepr.py < a.txt
64 > echo '% a.txt'
65 > cat a.txt
66 66 > echo '% hg cat a.txt'
67 > hg cat a.txt | python $TESTDIR/printrepr.py
67 > hg cat a.txt
68 68 > printf "fourth${EOL}" >> a.txt
69 > echo '% printrepr.py a.txt'
70 > python $TESTDIR/printrepr.py < a.txt
71 > hg diff | python $TESTDIR/printrepr.py
69 > echo '% a.txt'
70 > cat a.txt
71 > hg diff
72 72 > python ../switch-eol.py $1 a.txt
73 73 > echo '% hg diff only reports a single changed line:'
74 > hg diff | python $TESTDIR/printrepr.py
74 > hg diff
75 75 > echo "% reverting back to $1 format"
76 76 > hg revert a.txt
77 > python $TESTDIR/printrepr.py < a.txt
77 > cat a.txt
78 78 > printf "first\r\nsecond\n" > mixed.txt
79 79 > hg add mixed.txt
80 80 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
@@ -144,7 +144,7 b' Basic tests'
144 144 $ dotest LF
145 145 % hg clone repo repo-LF
146 146 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 % printrepr.py a.txt
147 % a.txt
148 148 first
149 149 second
150 150 third
@@ -152,7 +152,7 b' Basic tests'
152 152 first
153 153 second
154 154 third
155 % printrepr.py a.txt
155 % a.txt
156 156 first
157 157 second
158 158 third
@@ -188,19 +188,19 b' Basic tests'
188 188 $ dotest CRLF
189 189 % hg clone repo repo-CRLF
190 190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 % printrepr.py a.txt
192 first\r
193 second\r
194 third\r
191 % a.txt
192 first\r (esc)
193 second\r (esc)
194 third\r (esc)
195 195 % hg cat a.txt
196 196 first
197 197 second
198 198 third
199 % printrepr.py a.txt
200 first\r
201 second\r
202 third\r
203 fourth\r
199 % a.txt
200 first\r (esc)
201 second\r (esc)
202 third\r (esc)
203 fourth\r (esc)
204 204 diff --git a/a.txt b/a.txt
205 205 --- a/a.txt
206 206 +++ b/a.txt
@@ -220,9 +220,9 b' Basic tests'
220 220 third
221 221 +fourth
222 222 % reverting back to CRLF format
223 first\r
224 second\r
225 third\r
223 first\r (esc)
224 second\r (esc)
225 third\r (esc)
226 226 % hg commit of inconsistent .txt file marked as binary (should work)
227 227 % hg commit of inconsistent .txt file marked as native (should fail)
228 228 abort: inconsistent newline style in a.txt
@@ -238,15 +238,15 b' Basic tests'
238 238 $ dotest LF
239 239 % hg clone repo repo-LF
240 240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 % printrepr.py a.txt
241 % a.txt
242 242 first
243 243 second
244 244 third
245 245 % hg cat a.txt
246 first\r
247 second\r
248 third\r
249 % printrepr.py a.txt
246 first\r (esc)
247 second\r (esc)
248 third\r (esc)
249 % a.txt
250 250 first
251 251 second
252 252 third
@@ -255,20 +255,20 b' Basic tests'
255 255 --- a/a.txt
256 256 +++ b/a.txt
257 257 @@ -1,3 +1,4 @@
258 first\r
259 second\r
260 third\r
261 +fourth\r
258 first\r (esc)
259 second\r (esc)
260 third\r (esc)
261 +fourth\r (esc)
262 262 % switching encoding from '\n' to '\r\n'
263 263 % hg diff only reports a single changed line:
264 264 diff --git a/a.txt b/a.txt
265 265 --- a/a.txt
266 266 +++ b/a.txt
267 267 @@ -1,3 +1,4 @@
268 first\r
269 second\r
270 third\r
271 +fourth\r
268 first\r (esc)
269 second\r (esc)
270 third\r (esc)
271 +fourth\r (esc)
272 272 % reverting back to LF format
273 273 first
274 274 second
@@ -282,41 +282,41 b' Basic tests'
282 282 $ dotest CRLF
283 283 % hg clone repo repo-CRLF
284 284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 % printrepr.py a.txt
286 first\r
287 second\r
288 third\r
285 % a.txt
286 first\r (esc)
287 second\r (esc)
288 third\r (esc)
289 289 % hg cat a.txt
290 first\r
291 second\r
292 third\r
293 % printrepr.py a.txt
294 first\r
295 second\r
296 third\r
297 fourth\r
290 first\r (esc)
291 second\r (esc)
292 third\r (esc)
293 % a.txt
294 first\r (esc)
295 second\r (esc)
296 third\r (esc)
297 fourth\r (esc)
298 298 diff --git a/a.txt b/a.txt
299 299 --- a/a.txt
300 300 +++ b/a.txt
301 301 @@ -1,3 +1,4 @@
302 first\r
303 second\r
304 third\r
305 +fourth\r
302 first\r (esc)
303 second\r (esc)
304 third\r (esc)
305 +fourth\r (esc)
306 306 % switching encoding from '\r\n' to '\n'
307 307 % hg diff only reports a single changed line:
308 308 diff --git a/a.txt b/a.txt
309 309 --- a/a.txt
310 310 +++ b/a.txt
311 311 @@ -1,3 +1,4 @@
312 first\r
313 second\r
314 third\r
315 +fourth\r
312 first\r (esc)
313 second\r (esc)
314 third\r (esc)
315 +fourth\r (esc)
316 316 % reverting back to CRLF format
317 first\r
318 second\r
319 third\r
317 first\r (esc)
318 second\r (esc)
319 third\r (esc)
320 320 % hg commit of inconsistent .txt file marked as binary (should work)
321 321 % hg commit of inconsistent .txt file marked as native (should fail)
322 322 abort: inconsistent newline style in a.txt
@@ -352,10 +352,10 b' Move text file and patch as binary'
352 352 > EOF
353 353 applying patch from stdin
354 354
355 $ python $TESTDIR/printrepr.py < binary2
355 $ cat binary2
356 356 a
357 357 b
358 \x00
358 \x00 (no-eol) (esc)
359 359
360 360 $ hg st --copies --change .
361 361 A binary2
@@ -919,15 +919,13 b' branches'
919 919
920 920 changegroup
921 921
922 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' \
923 > | $TESTDIR/printrepr.py
922 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000'
924 923 200 Script output follows
925 924
926 x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82
927 4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0TM\xc7\xf4BO\xcf\xde\xae\xe5\xae#\x1frM(K\x97`F\x19\x16s\x05GD\xb9\x01\xc1\x00+\x8c|\x9fp\xc11\xf0\x14\x00\x9cJ\x82<\xe0\x12\x9f\xc1\x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf\'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00\t_\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc
925 x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82 (esc)
926 4\x11KP2m\x95\xad*\xabE\x05AP\xd0\xc22Z\x14\xf9\x03\xb9j\xa3\x9b$\xa4MJ\xb4\x90\xc0\x9a\x9bO0\x10\xdf\x13\xa2\x81\x0f\x869g\xe6|\xe7\x9c\xef\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\\n\xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe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\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00 _\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc (no-eol) (esc)
931 929
932 930 stream_out
933 931
@@ -583,19 +583,19 b' errors encountered'
583 583 >
584 584 > echo % hgweb filerevision, html
585 585 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
586 > | grep '<div class="parity0 source">' | $TESTDIR/printrepr.py
586 > | grep '<div class="parity0 source">'
587 587 > echo % errors encountered
588 588 > cat errors.log
589 589 > }
590 590 $ hgserveget euc-jp eucjp.txt
591 591 % HGENCODING=euc-jp hg serve
592 592 % hgweb filerevision, html
593 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xb5\xfe</div>
593 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xb5\xfe</div> (esc)
594 594 % errors encountered
595 595 $ hgserveget utf-8 eucjp.txt
596 596 % HGENCODING=utf-8 hg serve
597 597 % hgweb filerevision, html
598 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xef\xbf\xbd\xef\xbf\xbd</div>
598 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xef\xbf\xbd\xef\xbf\xbd</div> (esc)
599 599 % errors encountered
600 600 $ hgserveget us-ascii eucjp.txt
601 601 % HGENCODING=us-ascii hg serve
@@ -45,8 +45,13 b' force LF'
45 45
46 46 $ hg --traceback --config patch.eol='LF' import eol.diff
47 47 applying eol.diff
48 $ python -c 'print repr(file("a","rb").read())'
49 'a\nyyyy\ncc\n\nd\ne'
48 $ cat a
49 a
50 yyyy
51 cc
52
53 d
54 e (no-eol)
50 55 $ hg st
51 56
52 57
@@ -56,8 +61,13 b' force CRLF'
56 61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 62 $ hg --traceback --config patch.eol='CRLF' import eol.diff
58 63 applying eol.diff
59 $ python -c 'print repr(file("a","rb").read())'
60 'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
64 $ cat a
65 a\r (esc)
66 yyyy\r (esc)
67 cc\r (esc)
68 \r (esc)
69 d\r (esc)
70 e (no-eol)
61 71 $ hg st
62 72
63 73
@@ -67,8 +77,13 b' auto EOL on LF file'
67 77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 78 $ hg --traceback --config patch.eol='auto' import eol.diff
69 79 applying eol.diff
70 $ python -c 'print repr(file("a","rb").read())'
71 'a\nyyyy\ncc\n\nd\ne'
80 $ cat a
81 a
82 yyyy
83 cc
84
85 d
86 e (no-eol)
72 87 $ hg st
73 88
74 89
@@ -78,8 +93,13 b' auto EOL on CRLF file'
78 93 $ hg commit -m 'switch EOLs in a'
79 94 $ hg --traceback --config patch.eol='auto' import eol.diff
80 95 applying eol.diff
81 $ python -c 'print repr(file("a","rb").read())'
82 'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
96 $ cat a
97 a\r (esc)
98 yyyy\r (esc)
99 cc\r (esc)
100 \r (esc)
101 d\r (esc)
102 e (no-eol)
83 103 $ hg st
84 104
85 105
@@ -96,10 +116,12 b' auto EOL on new file or source without a'
96 116 $ rm neweol
97 117 $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
98 118 applying noeol.diff
99 $ python -c 'print repr(file("noeol","rb").read())'
100 'noeol\r\nnoeol\n'
101 $ python -c 'print repr(file("neweol","rb").read())'
102 'neweol\nneweol\r\n'
119 $ cat noeol
120 noeol\r (esc)
121 noeol
122 $ cat neweol
123 neweol
124 neweol\r (esc)
103 125 $ hg st
104 126
105 127
@@ -116,7 +138,9 b' binary patch with --eol'
116 138
117 139 $ hg import --config patch.eol='CRLF' -m changeb bin.diff
118 140 applying bin.diff
119 $ python -c 'print repr(file("b","rb").read())'
120 'a\x00\nc\r\nd'
141 $ cat b
142 a\x00 (esc)
143 c\r (esc)
144 d (no-eol)
121 145 $ hg st
122 146 $ cd ..
@@ -104,9 +104,9 b' binary file'
104 104
105 105 binary file --text
106 106
107 $ python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
107 $ python simplemerge -a -p binary-local base other 2>&1
108 108 warning: binary-local looks like a binary file.
109 \x00local
109 \x00local (esc)
110 110 base
111 111 other
112 112
@@ -357,6 +357,7 b' test with a win32ext like setup (differi'
357 357 $ hg transplant -s ../twin1 tip
358 358 applying 2e849d776c17
359 359 2e849d776c17 transplanted to 589cea8ba85b
360 $ python -c "print repr(file('b', 'rb').read())"
361 'a\r\nb\r\n'
360 $ cat b
361 a\r (esc)
362 b\r (esc)
362 363 $ cd ..
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now