##// END OF EJS Templates
test-patchbomb: write in binary mode, force non-interactive mode (win32)
Patrick Mezard -
r7265:0cf3442e default
parent child Browse files
Show More
@@ -1,70 +1,70
1 1 #!/bin/sh
2 2
3 3 fixheaders()
4 4 {
5 5 sed -e 's/\(Message-Id:.*@\).*/\1/' \
6 6 -e 's/\(In-Reply-To:.*@\).*/\1/' \
7 7 -e 's/===.*/===/'
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "patchbomb=" >> $HGRCPATH
12 12
13 13 hg init t
14 14 cd t
15 15 echo a > a
16 16 hg commit -Ama -d '1 0'
17 17
18 18 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar tip | \
19 19 fixheaders
20 20
21 21 echo b > b
22 22 hg commit -Amb -d '2 0'
23 23
24 24 hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test 0:tip | \
25 25 fixheaders
26 26
27 27 hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip
28 28
29 29 cd ..
30 30
31 31 hg clone -q t t2
32 32 cd t2
33 33 echo c > c
34 34 hg commit -Amc -d '3 0'
35 35
36 36 cat > description <<EOF
37 37 a multiline
38 38
39 39 description
40 40 EOF
41 41
42 42 echo % test bundle and description
43 43 hg email --date '1970-1-1 0:3' -n -f quux -t foo \
44 44 -c bar -s test -r tip -b --desc description | \
45 45 fixheaders
46 46
47 47 echo % utf-8 patch
48 python -c 'fp = open("utf", "w"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
48 python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
49 49 hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64'
50 50
51 51 echo % no mime encoding for email --test
52 hg email --date '1970-1-1 0:4' -f quux -t foo -r tip -n | fixheaders > mailtest
52 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | fixheaders > mailtest
53 53 echo % md5sum of 8-bit output
54 54 $TESTDIR/md5sum.py mailtest
55 55 rm mailtest
56 56
57 57 echo % mime encoded mbox
58 hg email --date '1970-1-1 0:4' -f quux -t foo -r tip -m mbox
58 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
59 59 cat mbox | fixheaders
60 60 rm mbox
61 61
62 62 echo % iso-8859-1 patch
63 python -c 'fp = open("isolatin", "w"); fp.write("h\xF6mma!\n"); fp.close();'
63 python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
64 64 hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit'
65 65
66 66 echo % fake ascii mbox
67 hg email --date '1970-1-1 0:5' -f quux -t foo -r tip -m mbox
67 hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
68 68 fixheaders < mbox > mboxfix
69 69 echo % md5sum of 8-bit output
70 70 $TESTDIR/md5sum.py mboxfix
@@ -1,190 +1,191
1 1 adding a
2 2 This patch series consists of 1 patches.
3 3
4 4
5 5 Displaying [PATCH] a ...
6 6 Content-Type: text/plain; charset="us-ascii"
7 7 MIME-Version: 1.0
8 8 Content-Transfer-Encoding: 7bit
9 9 Subject: [PATCH] a
10 10 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
11 11 Message-Id: <8580ff50825a50c8f716.60@
12 12 Date: Thu, 01 Jan 1970 00:01:00 +0000
13 13 From: quux
14 14 To: foo
15 15 Cc: bar
16 16
17 17 # HG changeset patch
18 18 # User test
19 19 # Date 1 0
20 20 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
21 21 # Parent 0000000000000000000000000000000000000000
22 22 a
23 23
24 24 diff -r 000000000000 -r 8580ff50825a a
25 25 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26 26 +++ b/a Thu Jan 01 00:00:01 1970 +0000
27 27 @@ -0,0 +1,1 @@
28 28 +a
29 29
30 30 adding b
31 31 This patch series consists of 2 patches.
32 32
33 33
34 34 Write the introductory message for the patch series.
35 35
36 36
37 37 Displaying [PATCH 0 of 2] test ...
38 38 Content-Type: text/plain; charset="us-ascii"
39 39 MIME-Version: 1.0
40 40 Content-Transfer-Encoding: 7bit
41 41 Subject: [PATCH 0 of 2] test
42 42 Message-Id: <patchbomb.120@
43 43 Date: Thu, 01 Jan 1970 00:02:00 +0000
44 44 From: quux
45 45 To: foo
46 46 Cc: bar
47 47
48 48
49 49 Displaying [PATCH 1 of 2] a ...
50 50 Content-Type: text/plain; charset="us-ascii"
51 51 MIME-Version: 1.0
52 52 Content-Transfer-Encoding: 7bit
53 53 Subject: [PATCH 1 of 2] a
54 54 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
55 55 Message-Id: <8580ff50825a50c8f716.121@
56 56 In-Reply-To: <patchbomb.120@
57 57 Date: Thu, 01 Jan 1970 00:02:01 +0000
58 58 From: quux
59 59 To: foo
60 60 Cc: bar
61 61
62 62 # HG changeset patch
63 63 # User test
64 64 # Date 1 0
65 65 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
66 66 # Parent 0000000000000000000000000000000000000000
67 67 a
68 68
69 69 diff -r 000000000000 -r 8580ff50825a a
70 70 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71 71 +++ b/a Thu Jan 01 00:00:01 1970 +0000
72 72 @@ -0,0 +1,1 @@
73 73 +a
74 74
75 75 Displaying [PATCH 2 of 2] b ...
76 76 Content-Type: text/plain; charset="us-ascii"
77 77 MIME-Version: 1.0
78 78 Content-Transfer-Encoding: 7bit
79 79 Subject: [PATCH 2 of 2] b
80 80 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
81 81 Message-Id: <97d72e5f12c7e84f8506.122@
82 82 In-Reply-To: <patchbomb.120@
83 83 Date: Thu, 01 Jan 1970 00:02:02 +0000
84 84 From: quux
85 85 To: foo
86 86 Cc: bar
87 87
88 88 # HG changeset patch
89 89 # User test
90 90 # Date 2 0
91 91 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
92 92 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
93 93 b
94 94
95 95 diff -r 8580ff50825a -r 97d72e5f12c7 b
96 96 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
97 97 +++ b/b Thu Jan 01 00:00:02 1970 +0000
98 98 @@ -0,0 +1,1 @@
99 99 +b
100 100
101 101 This patch series consists of 2 patches.
102 102
103 103
104 104 Write the introductory message for the patch series.
105 105
106 106
107 107 Writing [PATCH 0 of 2] test ...
108 108 Writing [PATCH 1 of 2] a ...
109 109 Writing [PATCH 2 of 2] b ...
110 110 adding c
111 111 % test bundle and description
112 112 searching for changes
113 113 1 changesets found
114 114
115 115 Displaying test ...
116 116 Content-Type: multipart/mixed; boundary="===
117 117 MIME-Version: 1.0
118 118 Subject: test
119 119 Message-Id: <patchbomb.180@
120 120 Date: Thu, 01 Jan 1970 00:03:00 +0000
121 121 From: quux
122 122 To: foo
123 123 Cc: bar
124 124
125 125 --===
126 126 Content-Type: text/plain; charset="us-ascii"
127 127 MIME-Version: 1.0
128 128 Content-Transfer-Encoding: 7bit
129 129
130 130 a multiline
131 131
132 132 description
133 133
134 134 --===
135 135 Content-Type: application/x-mercurial-bundle
136 136 MIME-Version: 1.0
137 137 Content-Disposition: attachment; filename="bundle.hg"
138 138 Content-Transfer-Encoding: base64
139 139
140 140 SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
141 141 2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
142 142 oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
143 143 Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
144 144 SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
145 145 sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
146 146 Q70eyNw=
147 147 --===
148 148 % utf-8 patch
149 149 adding description
150 150 adding utf
151 151 % no mime encoding for email --test
152 152 % md5sum of 8-bit output
153 a6a3c6b9b6009cea23871a7727a282ab mailtest
153 ad877786716d09fd7843cf0ed5e3d2a8 mailtest
154 154 % mime encoded mbox
155 155 This patch series consists of 1 patches.
156 156
157 157
158 158 Writing [PATCH] charset=utf-8; content-transfer-encoding: base64 ...
159 159 From quux Thu Jan 01 00:04:01 1970
160 160 Content-Type: text/plain; charset="utf-8"
161 161 MIME-Version: 1.0
162 162 Content-Transfer-Encoding: base64
163 163 Subject: [PATCH] charset=utf-8; content-transfer-encoding: base64
164 164 X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
165 165 Message-Id: <c3c9e37db9f4fe4882cd.240@
166 166 Date: Thu, 01 Jan 1970 00:04:00 +0000
167 167 From: quux
168 168 To: foo
169 Cc: bar
169 170
170 171 IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgYzNj
171 172 OWUzN2RiOWY0ZmU0ODgyY2RhMzliYWY0MmZlZDZiYWQ4YjE1YQojIFBhcmVudCAgZmYyYzlmYTIw
172 173 MThiMTVmYTc0YjMzMzYzYmRhOTUyNzMyM2UyYTk5ZgpjaGFyc2V0PXV0Zi04OyBjb250ZW50LXRy
173 174 YW5zZmVyLWVuY29kaW5nOiBiYXNlNjQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIGMzYzllMzdk
174 175 YjlmNCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3MCAr
175 176 MDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
176 177 LTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5ZmEy
177 178 MDE4YiAtciBjM2M5ZTM3ZGI5ZjQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDowMDow
178 179 MCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
179 180 LTAsMCArMSwxIEBACitow7ZtbWEhCg==
180 181
181 182
182 183 % iso-8859-1 patch
183 184 adding isolatin
184 185 % fake ascii mbox
185 186 This patch series consists of 1 patches.
186 187
187 188
188 189 Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ...
189 190 % md5sum of 8-bit output
190 45cb4b77e02f39eb91955f5c95913d66 mboxfix
191 90fae277a4a85255e8262174fcefb59f mboxfix
General Comments 0
You need to be logged in to leave comments. Login now