1
Description: fix patchbomb test
2
Origin: backported from 3.1.1
4
Index: mercurial-2.8.2/tests/test-patchbomb.t
5
===================================================================
6
--- mercurial-2.8.2.orig/tests/test-patchbomb.t 2015-06-17 15:20:05.254972546 -0400
7
+++ mercurial-2.8.2/tests/test-patchbomb.t 2015-06-17 15:20:21.699148136 -0400
9
+Note for future hackers of patchbomb: this file is a bit heavy on
10
+wildcards in test expectations due to how many things like hostnames
11
+tend to make it into outputs. As a result, you may need to perform the
12
+following regular expression substitutions:
13
+@$HOSTNAME> -> @*> (glob)
14
+Mercurial-patchbomb/.* -> Mercurial-patchbomb/* (glob)
15
+/mixed; boundary="===+[0-9]+==" -> /mixed; boundary="===*== (glob)"
16
+--===+[0-9]+=+--$ -> --===*=-- (glob)
17
+--===+[0-9]+=+$ -> --===*= (glob)
19
+ $ cat > prune-blank-after-boundary.py <<EOF
22
+ > trim = lambda x: x.strip(' \r\n')
23
+ > for l in sys.stdin:
24
+ > if trim(l).endswith('=--') or trim(l).endswith('=='):
28
+ > if not trim(l) and skipblank:
33
+ $ FILTERBOUNDARY="python `pwd`/prune-blank-after-boundary.py"
34
$ echo "[extensions]" >> $HGRCPATH
35
$ echo "patchbomb=" >> $HGRCPATH
39
test bundle and description:
40
$ hg email --date '1970-1-1 0:3' -n -f quux -t foo \
41
- > -c bar -s test -r tip -b --desc description
42
+ > -c bar -s test -r tip -b --desc description | $FILTERBOUNDARY
47
- Content-Type: multipart/mixed; boundary="===*" (glob)
48
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
51
Message-Id: <patchbomb.180@*> (glob)
58
Content-Type: text/plain; charset="us-ascii"
60
Content-Transfer-Encoding: 7bit
67
Content-Type: application/x-mercurial-bundle
69
Content-Disposition: attachment; filename="bundle.hg"
71
SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
72
sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
78
$ python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
82
test inline for single patch:
83
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
84
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | $FILTERBOUNDARY
85
this patch series consists of 1 patches.
88
displaying [PATCH] test ...
89
- Content-Type: multipart/mixed; boundary="===*" (glob)
90
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
93
X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
100
Content-Type: text/x-patch; charset="us-ascii"
102
Content-Transfer-Encoding: 7bit
103
@@ -682,16 +707,16 @@
111
test inline for single patch (quoted-printable):
112
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4
113
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | $FILTERBOUNDARY
114
this patch series consists of 1 patches.
117
displaying [PATCH] test ...
118
- Content-Type: multipart/mixed; boundary="===*" (glob)
119
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
121
Subject: [PATCH] test
122
X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
129
Content-Type: text/x-patch; charset="us-ascii"
131
Content-Transfer-Encoding: quoted-printable
132
@@ -738,11 +763,11 @@
139
test inline for multiple patches:
140
$ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
142
+ > -r 0:1 -r 4 | $FILTERBOUNDARY
143
this patch series consists of 3 patches.
149
displaying [PATCH 1 of 3] a ...
150
- Content-Type: multipart/mixed; boundary="===*" (glob)
151
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
153
Subject: [PATCH 1 of 3] a
154
X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
161
Content-Type: text/x-patch; charset="us-ascii"
163
Content-Transfer-Encoding: 7bit
170
displaying [PATCH 2 of 3] b ...
171
- Content-Type: multipart/mixed; boundary="===*" (glob)
172
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
174
Subject: [PATCH 2 of 3] b
175
X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
182
Content-Type: text/x-patch; charset="us-ascii"
184
Content-Transfer-Encoding: 7bit
191
displaying [PATCH 3 of 3] long line ...
192
- Content-Type: multipart/mixed; boundary="===*" (glob)
193
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
195
Subject: [PATCH 3 of 3] long line
196
X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
203
Content-Type: text/x-patch; charset="us-ascii"
205
Content-Transfer-Encoding: quoted-printable
206
@@ -882,15 +907,15 @@
213
test attach for single patch:
214
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2
215
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | $FILTERBOUNDARY
216
this patch series consists of 1 patches.
219
displaying [PATCH] test ...
220
- Content-Type: multipart/mixed; boundary="===*" (glob)
221
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
223
Subject: [PATCH] test
224
X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
231
Content-Type: text/plain; charset="us-ascii"
233
Content-Transfer-Encoding: 7bit
240
Content-Type: text/x-patch; charset="us-ascii"
242
Content-Transfer-Encoding: 7bit
243
@@ -930,15 +955,15 @@
250
test attach for single patch (quoted-printable):
251
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4
252
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | $FILTERBOUNDARY
253
this patch series consists of 1 patches.
256
displaying [PATCH] test ...
257
- Content-Type: multipart/mixed; boundary="===*" (glob)
258
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
260
Subject: [PATCH] test
261
X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
268
Content-Type: text/plain; charset="us-ascii"
270
Content-Transfer-Encoding: 7bit
277
Content-Type: text/x-patch; charset="us-ascii"
279
Content-Transfer-Encoding: quoted-printable
280
@@ -994,15 +1019,15 @@
287
test attach and body for single patch:
288
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2
289
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2 | $FILTERBOUNDARY
290
this patch series consists of 1 patches.
293
displaying [PATCH] test ...
294
- Content-Type: multipart/mixed; boundary="===*" (glob)
295
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
297
Subject: [PATCH] test
298
X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
299
@@ -1013,7 +1038,7 @@
305
Content-Type: text/plain; charset="us-ascii"
307
Content-Transfer-Encoding: 7bit
308
@@ -1032,7 +1057,7 @@
314
Content-Type: text/x-patch; charset="us-ascii"
316
Content-Transfer-Encoding: 7bit
317
@@ -1052,11 +1077,11 @@
324
test attach for multiple patches:
325
$ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
327
+ > -r 0:1 -r 4 | $FILTERBOUNDARY
328
this patch series consists of 3 patches.
331
@@ -1077,7 +1102,7 @@
334
displaying [PATCH 1 of 3] a ...
335
- Content-Type: multipart/mixed; boundary="===*" (glob)
336
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
338
Subject: [PATCH 1 of 3] a
339
X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
340
@@ -1090,7 +1115,7 @@
346
Content-Type: text/plain; charset="us-ascii"
348
Content-Transfer-Encoding: 7bit
349
@@ -1099,7 +1124,7 @@
355
Content-Type: text/x-patch; charset="us-ascii"
357
Content-Transfer-Encoding: 7bit
358
@@ -1119,9 +1144,9 @@
364
displaying [PATCH 2 of 3] b ...
365
- Content-Type: multipart/mixed; boundary="===*" (glob)
366
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
368
Subject: [PATCH 2 of 3] b
369
X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
370
@@ -1134,7 +1159,7 @@
376
Content-Type: text/plain; charset="us-ascii"
378
Content-Transfer-Encoding: 7bit
379
@@ -1143,7 +1168,7 @@
385
Content-Type: text/x-patch; charset="us-ascii"
387
Content-Transfer-Encoding: 7bit
388
@@ -1163,9 +1188,9 @@
394
displaying [PATCH 3 of 3] long line ...
395
- Content-Type: multipart/mixed; boundary="===*" (glob)
396
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
398
Subject: [PATCH 3 of 3] long line
399
X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
400
@@ -1178,7 +1203,7 @@
406
Content-Type: text/plain; charset="us-ascii"
408
Content-Transfer-Encoding: 7bit
409
@@ -1187,7 +1212,7 @@
415
Content-Type: text/x-patch; charset="us-ascii"
417
Content-Transfer-Encoding: quoted-printable
418
@@ -1223,7 +1248,7 @@
425
test intro for single patch:
426
$ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
427
@@ -1485,12 +1510,13 @@
428
$ hg tag -r2 two two.diff
430
test inline for single named patch:
431
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
432
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
433
+ > -r 2 | $FILTERBOUNDARY
434
this patch series consists of 1 patches.
437
displaying [PATCH] test ...
438
- Content-Type: multipart/mixed; boundary="===*" (glob)
439
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
441
Subject: [PATCH] test
442
X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
443
@@ -1501,7 +1527,7 @@
449
Content-Type: text/x-patch; charset="us-ascii"
451
Content-Transfer-Encoding: 7bit
452
@@ -1521,10 +1547,11 @@
459
test inline for multiple named/unnamed patches:
460
- $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1
461
+ $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
462
+ > -r 0:1 | $FILTERBOUNDARY
463
this patch series consists of 2 patches.
466
@@ -1545,7 +1572,7 @@
469
displaying [PATCH 1 of 2] a ...
470
- Content-Type: multipart/mixed; boundary="===*" (glob)
471
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
473
Subject: [PATCH 1 of 2] a
474
X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
475
@@ -1558,7 +1585,7 @@
481
Content-Type: text/x-patch; charset="us-ascii"
483
Content-Transfer-Encoding: 7bit
484
@@ -1578,9 +1605,9 @@
490
displaying [PATCH 2 of 2] b ...
491
- Content-Type: multipart/mixed; boundary="===*" (glob)
492
+ Content-Type: multipart/mixed; boundary="===*==" (glob)
494
Subject: [PATCH 2 of 2] b
495
X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
496
@@ -1593,7 +1620,7 @@
502
Content-Type: text/x-patch; charset="us-ascii"
504
Content-Transfer-Encoding: 7bit
505
@@ -1613,7 +1640,7 @@
514
@@ -1805,9 +1832,11 @@
518
-test single flag for single patch:
519
+test single flag for single patch (and no warning when not mailing dirty rev):
522
$ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
524
+ > -r 2 | $FILTERBOUNDARY
525
this patch series consists of 1 patches.
528
@@ -1839,7 +1868,7 @@
532
-test single flag for multiple patches:
533
+test single flag for multiple patches (and warning when mailing dirty rev):
534
$ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
536
this patch series consists of 2 patches.
537
@@ -1919,6 +1948,8 @@
541
+ $ hg revert --no-b a
544
test multiple flags for single patch:
545
$ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
546
@@ -2127,7 +2158,7 @@
549
$ hg ci -mdd -d '5 0'
550
- $ hg --config extensions.graphlog= glog --template "{rev}:{node|short} {desc|firstline}\n"
551
+ $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"