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