##// END OF EJS Templates
patchbomb: fix 'echo -en' bashism in test-patchbomb...
Marti Raudsepp -
r9730:732fc0e9 default
parent child Browse files
Show More
@@ -1,179 +1,179 b''
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/\(References:.*@\).*/\1/' \
7 -e 's/\(References:.*@\).*/\1/' \
8 -e 's/\(User-Agent:.*\)\/.*/\1/' \
8 -e 's/\(User-Agent:.*\)\/.*/\1/' \
9 -e 's/===.*/===/'
9 -e 's/===.*/===/'
10 }
10 }
11
11
12 echo "[extensions]" >> $HGRCPATH
12 echo "[extensions]" >> $HGRCPATH
13 echo "patchbomb=" >> $HGRCPATH
13 echo "patchbomb=" >> $HGRCPATH
14
14
15 COLUMNS=80; export COLUMNS
15 COLUMNS=80; export COLUMNS
16
16
17 hg init t
17 hg init t
18 cd t
18 cd t
19 echo a > a
19 echo a > a
20 hg commit -Ama -d '1 0'
20 hg commit -Ama -d '1 0'
21
21
22 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip | \
22 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip | \
23 fixheaders
23 fixheaders
24
24
25 echo b > b
25 echo b > b
26 hg commit -Amb -d '2 0'
26 hg commit -Amb -d '2 0'
27
27
28 hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip | \
28 hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip | \
29 fixheaders
29 fixheaders
30
30
31 hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip
31 hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip
32
32
33 cd ..
33 cd ..
34
34
35 hg clone -q t t2
35 hg clone -q t t2
36 cd t2
36 cd t2
37 echo c > c
37 echo c > c
38 hg commit -Amc -d '3 0'
38 hg commit -Amc -d '3 0'
39
39
40 cat > description <<EOF
40 cat > description <<EOF
41 a multiline
41 a multiline
42
42
43 description
43 description
44 EOF
44 EOF
45
45
46 echo "% test bundle and description"
46 echo "% test bundle and description"
47 hg email --date '1970-1-1 0:3' -n -f quux -t foo \
47 hg email --date '1970-1-1 0:3' -n -f quux -t foo \
48 -c bar -s test -r tip -b --desc description | \
48 -c bar -s test -r tip -b --desc description | \
49 fixheaders
49 fixheaders
50
50
51 echo "% utf-8 patch"
51 echo "% utf-8 patch"
52 python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
52 python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
53 hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64'
53 hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64'
54
54
55 echo "% no mime encoding for email --test"
55 echo "% no mime encoding for email --test"
56 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
56 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
57 fixheaders > mailtest
57 fixheaders > mailtest
58 echo "% md5sum of 8-bit output"
58 echo "% md5sum of 8-bit output"
59 $TESTDIR/md5sum.py mailtest
59 $TESTDIR/md5sum.py mailtest
60 rm mailtest
60 rm mailtest
61
61
62 echo "% mime encoded mbox (base64)"
62 echo "% mime encoded mbox (base64)"
63 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
63 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
64 cat mbox | fixheaders
64 cat mbox | fixheaders
65 rm mbox
65 rm mbox
66
66
67 echo "% mime encoded mbox (quoted-printable)"
67 echo "% mime encoded mbox (quoted-printable)"
68 python -c 'fp = open("qp", "wb"); fp.write("%s\nfoo\n\nbar\n" % \
68 python -c 'fp = open("qp", "wb"); fp.write("%s\nfoo\n\nbar\n" % \
69 ("x" * 1024)); fp.close();'
69 ("x" * 1024)); fp.close();'
70 hg commit -A -d '4 0' -m \
70 hg commit -A -d '4 0' -m \
71 'charset=utf-8; content-transfer-encoding: quoted-printable'
71 'charset=utf-8; content-transfer-encoding: quoted-printable'
72
72
73 echo "% no mime encoding for email --test"
73 echo "% no mime encoding for email --test"
74 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
74 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
75 fixheaders > mailtest
75 fixheaders > mailtest
76 echo "% md5sum of qp output"
76 echo "% md5sum of qp output"
77 $TESTDIR/md5sum.py mailtest
77 $TESTDIR/md5sum.py mailtest
78 rm mailtest
78 rm mailtest
79
79
80 echo "% mime encoded mbox (quoted-printable)"
80 echo "% mime encoded mbox (quoted-printable)"
81 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
81 hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
82 cat mbox | fixheaders
82 cat mbox | fixheaders
83 rm mbox
83 rm mbox
84
84
85 echo "% iso-8859-1 patch"
85 echo "% iso-8859-1 patch"
86 python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
86 python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
87 hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit'
87 hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit'
88
88
89 echo "% fake ascii mbox"
89 echo "% fake ascii mbox"
90 hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
90 hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
91 fixheaders < mbox > mboxfix
91 fixheaders < mbox > mboxfix
92 echo "% md5sum of 8-bit output"
92 echo "% md5sum of 8-bit output"
93 $TESTDIR/md5sum.py mboxfix
93 $TESTDIR/md5sum.py mboxfix
94
94
95 echo "% test diffstat for single patch"
95 echo "% test diffstat for single patch"
96 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2 | \
96 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2 | \
97 fixheaders
97 fixheaders
98
98
99 echo "% test diffstat for multiple patches"
99 echo "% test diffstat for multiple patches"
100 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
100 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
101 -r 0:1 | fixheaders
101 -r 0:1 | fixheaders
102
102
103 echo "% test inline for single patch"
103 echo "% test inline for single patch"
104 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
104 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
105 fixheaders
105 fixheaders
106
106
107 echo "% test inline for single patch (quoted-printable)"
107 echo "% test inline for single patch (quoted-printable)"
108 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | \
108 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | \
109 fixheaders
109 fixheaders
110
110
111 echo "% test inline for multiple patches"
111 echo "% test inline for multiple patches"
112 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
112 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
113 -r 0:1 -r 4 | fixheaders
113 -r 0:1 -r 4 | fixheaders
114
114
115 echo "% test attach for single patch"
115 echo "% test attach for single patch"
116 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | \
116 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | \
117 fixheaders
117 fixheaders
118
118
119 echo "% test attach for single patch (quoted-printable)"
119 echo "% test attach for single patch (quoted-printable)"
120 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | \
120 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | \
121 fixheaders
121 fixheaders
122
122
123 echo "% test attach for multiple patches"
123 echo "% test attach for multiple patches"
124 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
124 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
125 -r 0:1 -r 4 | fixheaders
125 -r 0:1 -r 4 | fixheaders
126
126
127 echo "% test intro for single patch"
127 echo "% test intro for single patch"
128 hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
128 hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
129 -r 2 | fixheaders
129 -r 2 | fixheaders
130
130
131 echo "% test intro for multiple patches"
131 echo "% test intro for multiple patches"
132 hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
132 hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
133 -r 0:1 | fixheaders
133 -r 0:1 | fixheaders
134
134
135 echo "% tagging csets"
135 echo "% tagging csets"
136 hg tag -r0 zero zero.foo
136 hg tag -r0 zero zero.foo
137 hg tag -r1 one one.patch
137 hg tag -r1 one one.patch
138 hg tag -r2 two two.diff
138 hg tag -r2 two two.diff
139
139
140 echo "% test inline for single named patch"
140 echo "% test inline for single named patch"
141 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
141 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
142 fixheaders
142 fixheaders
143
143
144 echo "% test inline for multiple named/unnamed patches"
144 echo "% test inline for multiple named/unnamed patches"
145 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1 | \
145 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1 | \
146 fixheaders
146 fixheaders
147
147
148 echo "% test inreplyto"
148 echo "% test inreplyto"
149 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
149 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
150 -r tip | fixheaders
150 -r tip | fixheaders
151
151
152 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
152 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
153 -r 0:1 | fixheaders
153 -r 0:1 | fixheaders
154
154
155 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
155 hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
156 -s test -r 0:1 | fixheaders
156 -s test -r 0:1 | fixheaders
157
157
158 echo "% test single flag for single patch"
158 echo "% test single flag for single patch"
159 hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
159 hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
160 -r 2 | fixheaders
160 -r 2 | fixheaders
161
161
162 echo "% test single flag for multiple patches"
162 echo "% test single flag for multiple patches"
163 hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
163 hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
164 -r 0:1 | fixheaders
164 -r 0:1 | fixheaders
165
165
166 echo "% test mutiple flags for single patch"
166 echo "% test mutiple flags for single patch"
167 hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
167 hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
168 -c bar -s test -r 2 | fixheaders
168 -c bar -s test -r 2 | fixheaders
169
169
170 echo "% test multiple flags for multiple patches"
170 echo "% test multiple flags for multiple patches"
171 hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
171 hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
172 -c bar -s test -r 0:1 | fixheaders
172 -c bar -s test -r 0:1 | fixheaders
173
173
174 echo "% test multi-byte domain parsing"
174 echo "% test multi-byte domain parsing"
175 UUML=`echo -en '\xfc'`
175 UUML=`printf '\374'`
176 export HGENCODING=iso-8859-1
176 export HGENCODING=iso-8859-1
177 hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" \
177 hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" \
178 -s test -r 0
178 -s test -r 0
179 cat tmp.mbox | fixheaders
179 cat tmp.mbox | fixheaders
General Comments 0
You need to be logged in to leave comments. Login now