##// END OF EJS Templates
test-export: be more aggressive about quoting ^...
Augie Fackler -
r29516:e5c61e74 default
parent child Browse files
Show More
@@ -1,224 +1,224 b''
1 1 $ hg init repo
2 2 $ cd repo
3 3 $ touch foo
4 4 $ hg add foo
5 5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
6 6 > echo "foo-$i" >> foo
7 7 > hg ci -m "foo-$i"
8 8 > done
9 9
10 10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do
11 11 > echo
12 12 > echo "# foo-$out.patch"
13 13 > hg export -v -o "foo-$out.patch" 2:tip
14 14 > done
15 15
16 16 # foo-%nof%N.patch
17 17 exporting patches:
18 18 foo-01of10.patch
19 19 foo-02of10.patch
20 20 foo-03of10.patch
21 21 foo-04of10.patch
22 22 foo-05of10.patch
23 23 foo-06of10.patch
24 24 foo-07of10.patch
25 25 foo-08of10.patch
26 26 foo-09of10.patch
27 27 foo-10of10.patch
28 28
29 29 # foo-%%%H.patch
30 30 exporting patches:
31 31 foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
32 32 foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
33 33 foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
34 34 foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
35 35 foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
36 36 foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
37 37 foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
38 38 foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
39 39 foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
40 40 foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
41 41
42 42 # foo-%b-%R.patch
43 43 exporting patches:
44 44 foo-repo-2.patch
45 45 foo-repo-3.patch
46 46 foo-repo-4.patch
47 47 foo-repo-5.patch
48 48 foo-repo-6.patch
49 49 foo-repo-7.patch
50 50 foo-repo-8.patch
51 51 foo-repo-9.patch
52 52 foo-repo-10.patch
53 53 foo-repo-11.patch
54 54
55 55 # foo-%h.patch
56 56 exporting patches:
57 57 foo-617188a1c80f.patch
58 58 foo-dd41a5ff707a.patch
59 59 foo-f95a5410f866.patch
60 60 foo-4346bcfde53b.patch
61 61 foo-afda8c3a009c.patch
62 62 foo-35284ce2b6b9.patch
63 63 foo-9688c41894e6.patch
64 64 foo-747d3c68f8ec.patch
65 65 foo-5f17a83f5fbd.patch
66 66 foo-f3acbafac161.patch
67 67
68 68 # foo-%r.patch
69 69 exporting patches:
70 70 foo-02.patch
71 71 foo-03.patch
72 72 foo-04.patch
73 73 foo-05.patch
74 74 foo-06.patch
75 75 foo-07.patch
76 76 foo-08.patch
77 77 foo-09.patch
78 78 foo-10.patch
79 79 foo-11.patch
80 80
81 81 # foo-%m.patch
82 82 exporting patches:
83 83 foo-foo_2.patch
84 84 foo-foo_3.patch
85 85 foo-foo_4.patch
86 86 foo-foo_5.patch
87 87 foo-foo_6.patch
88 88 foo-foo_7.patch
89 89 foo-foo_8.patch
90 90 foo-foo_9.patch
91 91 foo-foo_10.patch
92 92 foo-foo_11.patch
93 93
94 94 Doing it again clobbers the files rather than appending:
95 95 $ hg export -v -o "foo-%m.patch" 2:3
96 96 exporting patches:
97 97 foo-foo_2.patch
98 98 foo-foo_3.patch
99 99 $ grep HG foo-foo_2.patch | wc -l
100 100 \s*1 (re)
101 101 $ grep HG foo-foo_3.patch | wc -l
102 102 \s*1 (re)
103 103
104 104 Exporting 4 changesets to a file:
105 105
106 106 $ hg export -o export_internal 1 2 3 4
107 107 $ grep HG export_internal | wc -l
108 108 \s*4 (re)
109 109
110 110 Doing it again clobbers the file rather than appending:
111 111 $ hg export -o export_internal 1 2 3 4
112 112 $ grep HG export_internal | wc -l
113 113 \s*4 (re)
114 114
115 115 Exporting 4 changesets to stdout:
116 116
117 117 $ hg export 1 2 3 4 | grep HG | wc -l
118 118 \s*4 (re)
119 119
120 120 Exporting revision -2 to a file:
121 121
122 122 $ hg export -- -2
123 123 # HG changeset patch
124 124 # User test
125 125 # Date 0 0
126 126 # Thu Jan 01 00:00:00 1970 +0000
127 127 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
128 128 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
129 129 foo-10
130 130
131 131 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
132 132 --- a/foo Thu Jan 01 00:00:00 1970 +0000
133 133 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
134 134 @@ -8,3 +8,4 @@
135 135 foo-7
136 136 foo-8
137 137 foo-9
138 138 +foo-10
139 139
140 140 No filename should be printed if stdout is specified explicitly:
141 141
142 142 $ hg export -v 1 -o -
143 143 exporting patch:
144 144 # HG changeset patch
145 145 # User test
146 146 # Date 0 0
147 147 # Thu Jan 01 00:00:00 1970 +0000
148 148 # Node ID d1c9656e973cfb5aebd5499bbd2cb350e3b12266
149 149 # Parent 871558de6af2e8c244222f8eea69b782c94ce3df
150 150 foo-1
151 151
152 152 diff -r 871558de6af2 -r d1c9656e973c foo
153 153 --- a/foo Thu Jan 01 00:00:00 1970 +0000
154 154 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
155 155 @@ -1,1 +1,2 @@
156 156 foo-0
157 157 +foo-1
158 158
159 159 Checking if only alphanumeric characters are used in the file name (%m option):
160 160
161 161 $ echo "line" >> foo
162 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
162 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"'^'"_\`abcdefghijklmnopqrstuvwxyz{|}~"
163 163 $ hg export -v -o %m.patch tip
164 164 exporting patch:
165 165 ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch
166 166
167 167 Catch exporting unknown revisions (especially empty revsets, see issue3353)
168 168
169 169 $ hg export
170 170 # HG changeset patch
171 171 # User test
172 172 # Date 0 0
173 173 # Thu Jan 01 00:00:00 1970 +0000
174 174 # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47
175 175 # Parent f3acbafac161ec68f1598af38f794f28847ca5d3
176 176 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
177 177
178 178 diff -r f3acbafac161 -r 197ecd81a57f foo
179 179 --- a/foo Thu Jan 01 00:00:00 1970 +0000
180 180 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
181 181 @@ -10,3 +10,4 @@
182 182 foo-9
183 183 foo-10
184 184 foo-11
185 185 +line
186 186
187 187 $ hg export ""
188 188 hg: parse error: empty query
189 189 [255]
190 190 $ hg export 999
191 191 abort: unknown revision '999'!
192 192 [255]
193 193 $ hg export "not all()"
194 194 abort: export requires at least one changeset
195 195 [255]
196 196
197 197 Check for color output
198 198 $ cat <<EOF >> $HGRCPATH
199 199 > [color]
200 200 > mode = ansi
201 201 > [extensions]
202 202 > color =
203 203 > EOF
204 204
205 205 $ hg export --color always --nodates tip
206 206 # HG changeset patch
207 207 # User test
208 208 # Date 0 0
209 209 # Thu Jan 01 00:00:00 1970 +0000
210 210 # Node ID * (glob)
211 211 # Parent * (glob)
212 212 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
213 213
214 214 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc)
215 215 \x1b[0;31;1m--- a/foo\x1b[0m (esc)
216 216 \x1b[0;32;1m+++ b/foo\x1b[0m (esc)
217 217 \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc)
218 218 foo-9
219 219 foo-10
220 220 foo-11
221 221 \x1b[0;32m+line\x1b[0m (esc)
222 222
223 223
224 224 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now