Show More
@@ -1,426 +1,426 b'' | |||
|
1 | 1 | Test that qpush cleans things up if it doesn't complete |
|
2 | 2 | |
|
3 | 3 | $ echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | $ echo "mq=" >> $HGRCPATH |
|
5 | 5 | $ hg init repo |
|
6 | 6 | $ cd repo |
|
7 | 7 | $ echo foo > foo |
|
8 | 8 | $ hg ci -Am 'add foo' |
|
9 | 9 | adding foo |
|
10 | 10 | $ touch untracked-file |
|
11 | 11 | $ echo 'syntax: glob' > .hgignore |
|
12 | 12 | $ echo '.hgignore' >> .hgignore |
|
13 | 13 | $ hg qinit |
|
14 | 14 | |
|
15 | 15 | test qpush on empty series |
|
16 | 16 | |
|
17 | 17 | $ hg qpush |
|
18 | 18 | no patches in series |
|
19 | 19 | $ hg qnew patch1 |
|
20 | 20 | $ echo >> foo |
|
21 | 21 | $ hg qrefresh -m 'patch 1' |
|
22 | 22 | $ hg qnew patch2 |
|
23 | 23 | $ echo bar > bar |
|
24 | 24 | $ hg add bar |
|
25 | 25 | $ hg qrefresh -m 'patch 2' |
|
26 | 26 | $ hg qnew --config 'mq.plain=true' bad-patch |
|
27 | 27 | $ echo >> foo |
|
28 | 28 | $ hg qrefresh |
|
29 | 29 | $ hg qpop -a |
|
30 | 30 | popping bad-patch |
|
31 | 31 | popping patch2 |
|
32 | 32 | popping patch1 |
|
33 | 33 | patch queue now empty |
|
34 | 34 | $ python -c 'print "\xe9"' > message |
|
35 | 35 | $ cat .hg/patches/bad-patch >> message |
|
36 | 36 | $ mv message .hg/patches/bad-patch |
|
37 | $ hg qpush -a && echo 'qpush succeded?!' | |
|
37 | $ hg qpush -a && echo 'qpush succeeded?!' | |
|
38 | 38 | applying patch1 |
|
39 | 39 | applying patch2 |
|
40 | 40 | applying bad-patch |
|
41 | 41 | transaction abort! |
|
42 | 42 | rollback completed |
|
43 | 43 | cleaning up working directory...done |
|
44 | 44 | abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc) |
|
45 | 45 | [255] |
|
46 | 46 | $ hg parents |
|
47 | 47 | changeset: 0:bbd179dfa0a7 |
|
48 | 48 | tag: tip |
|
49 | 49 | user: test |
|
50 | 50 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
51 | 51 | summary: add foo |
|
52 | 52 | |
|
53 | 53 | |
|
54 | 54 | test corrupt status file |
|
55 | 55 | $ hg qpush |
|
56 | 56 | applying patch1 |
|
57 | 57 | now at: patch1 |
|
58 | 58 | $ cp .hg/patches/status .hg/patches/status.orig |
|
59 | 59 | $ hg qpop |
|
60 | 60 | popping patch1 |
|
61 | 61 | patch queue now empty |
|
62 | 62 | $ cp .hg/patches/status.orig .hg/patches/status |
|
63 | 63 | $ hg qpush |
|
64 | 64 | mq status file refers to unknown node * (glob) |
|
65 | 65 | abort: working directory revision is not qtip |
|
66 | 66 | [255] |
|
67 | 67 | $ rm .hg/patches/status .hg/patches/status.orig |
|
68 | 68 | |
|
69 | 69 | |
|
70 | 70 | bar should be gone; other unknown/ignored files should still be around |
|
71 | 71 | |
|
72 | 72 | $ hg status -A |
|
73 | 73 | ? untracked-file |
|
74 | 74 | I .hgignore |
|
75 | 75 | C foo |
|
76 | 76 | |
|
77 | 77 | preparing qpush of a missing patch |
|
78 | 78 | |
|
79 | 79 | $ hg qpop -a |
|
80 | 80 | no patches applied |
|
81 | 81 | $ hg qpush |
|
82 | 82 | applying patch1 |
|
83 | 83 | now at: patch1 |
|
84 | 84 | $ rm .hg/patches/patch2 |
|
85 | 85 | |
|
86 | 86 | now we expect the push to fail, but it should NOT complain about patch1 |
|
87 | 87 | |
|
88 | 88 | $ hg qpush |
|
89 | 89 | applying patch2 |
|
90 | 90 | unable to read patch2 |
|
91 | 91 | now at: patch1 |
|
92 | 92 | [1] |
|
93 | 93 | |
|
94 | 94 | preparing qpush of missing patch with no patch applied |
|
95 | 95 | |
|
96 | 96 | $ hg qpop -a |
|
97 | 97 | popping patch1 |
|
98 | 98 | patch queue now empty |
|
99 | 99 | $ rm .hg/patches/patch1 |
|
100 | 100 | |
|
101 | 101 | qpush should fail the same way as below |
|
102 | 102 | |
|
103 | 103 | $ hg qpush |
|
104 | 104 | applying patch1 |
|
105 | 105 | unable to read patch1 |
|
106 | 106 | [1] |
|
107 | 107 | |
|
108 | 108 | Test qpush to a patch below the currently applied patch. |
|
109 | 109 | |
|
110 | 110 | $ hg qq -c guardedseriesorder |
|
111 | 111 | $ hg qnew a |
|
112 | 112 | $ hg qguard +block |
|
113 | 113 | $ hg qnew b |
|
114 | 114 | $ hg qnew c |
|
115 | 115 | |
|
116 | 116 | $ hg qpop -a |
|
117 | 117 | popping c |
|
118 | 118 | popping b |
|
119 | 119 | popping a |
|
120 | 120 | patch queue now empty |
|
121 | 121 | |
|
122 | 122 | try to push and pop while a is guarded |
|
123 | 123 | |
|
124 | 124 | $ hg qpush a |
|
125 | 125 | cannot push 'a' - guarded by '+block' |
|
126 | 126 | [1] |
|
127 | 127 | $ hg qpush -a |
|
128 | 128 | applying b |
|
129 | 129 | patch b is empty |
|
130 | 130 | applying c |
|
131 | 131 | patch c is empty |
|
132 | 132 | now at: c |
|
133 | 133 | |
|
134 | 134 | now try it when a is unguarded, and we're at the top of the queue |
|
135 | 135 | $ hg qsel block |
|
136 | 136 | number of guarded, applied patches has changed from 1 to 0 |
|
137 | 137 | $ hg qpush b |
|
138 | 138 | abort: cannot push to a previous patch: b |
|
139 | 139 | [255] |
|
140 | 140 | $ hg qpush a |
|
141 | 141 | abort: cannot push to a previous patch: a |
|
142 | 142 | [255] |
|
143 | 143 | |
|
144 | 144 | and now we try it one more time with a unguarded, while we're not at the top of the queue |
|
145 | 145 | |
|
146 | 146 | $ hg qpop b |
|
147 | 147 | popping c |
|
148 | 148 | now at: b |
|
149 | 149 | $ hg qpush a |
|
150 | 150 | abort: cannot push to a previous patch: a |
|
151 | 151 | [255] |
|
152 | 152 | |
|
153 | 153 | test qpop --force and backup files |
|
154 | 154 | |
|
155 | 155 | $ hg qpop -a |
|
156 | 156 | popping b |
|
157 | 157 | patch queue now empty |
|
158 | 158 | $ hg qq --create force |
|
159 | 159 | $ echo a > a |
|
160 | 160 | $ echo b > b |
|
161 | 161 | $ echo c > c |
|
162 | 162 | $ hg ci -Am add a b c |
|
163 | 163 | $ echo a >> a |
|
164 | 164 | $ hg rm b |
|
165 | 165 | $ hg rm c |
|
166 | 166 | $ hg qnew p1 |
|
167 | 167 | $ echo a >> a |
|
168 | 168 | $ echo bb > b |
|
169 | 169 | $ hg add b |
|
170 | 170 | $ echo cc > c |
|
171 | 171 | $ hg add c |
|
172 | 172 | $ hg qpop --force --verbose |
|
173 | 173 | saving current version of a as a.orig |
|
174 | 174 | saving current version of b as b.orig |
|
175 | 175 | saving current version of c as c.orig |
|
176 | 176 | popping p1 |
|
177 | 177 | patch queue now empty |
|
178 | 178 | $ hg st |
|
179 | 179 | ? a.orig |
|
180 | 180 | ? b.orig |
|
181 | 181 | ? c.orig |
|
182 | 182 | ? untracked-file |
|
183 | 183 | $ cat a.orig |
|
184 | 184 | a |
|
185 | 185 | a |
|
186 | 186 | a |
|
187 | 187 | $ cat b.orig |
|
188 | 188 | bb |
|
189 | 189 | $ cat c.orig |
|
190 | 190 | cc |
|
191 | 191 | |
|
192 | 192 | test qpop --force --no-backup |
|
193 | 193 | |
|
194 | 194 | $ hg qpush |
|
195 | 195 | applying p1 |
|
196 | 196 | now at: p1 |
|
197 | 197 | $ rm a.orig |
|
198 | 198 | $ echo a >> a |
|
199 | 199 | $ hg qpop --force --no-backup --verbose |
|
200 | 200 | popping p1 |
|
201 | 201 | patch queue now empty |
|
202 | 202 | $ test -f a.orig && echo 'error: backup with --no-backup' |
|
203 | 203 | [1] |
|
204 | 204 | |
|
205 | 205 | test qpop --keep-changes |
|
206 | 206 | |
|
207 | 207 | $ hg qpush |
|
208 | 208 | applying p1 |
|
209 | 209 | now at: p1 |
|
210 | 210 | $ hg qpop --keep-changes --force |
|
211 | 211 | abort: cannot use both --force and --keep-changes |
|
212 | 212 | [255] |
|
213 | 213 | $ echo a >> a |
|
214 | 214 | $ hg qpop --keep-changes |
|
215 | 215 | abort: local changes found, refresh first |
|
216 | 216 | [255] |
|
217 | 217 | $ hg revert -qa a |
|
218 | 218 | $ rm a |
|
219 | 219 | $ hg qpop --keep-changes |
|
220 | 220 | abort: local changes found, refresh first |
|
221 | 221 | [255] |
|
222 | 222 | $ hg rm -A a |
|
223 | 223 | $ hg qpop --keep-changes |
|
224 | 224 | abort: local changes found, refresh first |
|
225 | 225 | [255] |
|
226 | 226 | $ hg revert -qa a |
|
227 | 227 | $ echo b > b |
|
228 | 228 | $ hg add b |
|
229 | 229 | $ hg qpop --keep-changes |
|
230 | 230 | abort: local changes found, refresh first |
|
231 | 231 | [255] |
|
232 | 232 | $ hg forget b |
|
233 | 233 | $ echo d > d |
|
234 | 234 | $ hg add d |
|
235 | 235 | $ hg qpop --keep-changes |
|
236 | 236 | popping p1 |
|
237 | 237 | patch queue now empty |
|
238 | 238 | $ hg forget d |
|
239 | 239 | $ rm d |
|
240 | 240 | |
|
241 | 241 | test qpush --force and backup files |
|
242 | 242 | |
|
243 | 243 | $ echo a >> a |
|
244 | 244 | $ hg qnew p2 |
|
245 | 245 | $ echo b >> b |
|
246 | 246 | $ echo d > d |
|
247 | 247 | $ echo e > e |
|
248 | 248 | $ hg add d e |
|
249 | 249 | $ hg rm c |
|
250 | 250 | $ hg qnew p3 |
|
251 | 251 | $ hg qpop -a |
|
252 | 252 | popping p3 |
|
253 | 253 | popping p2 |
|
254 | 254 | patch queue now empty |
|
255 | 255 | $ echo a >> a |
|
256 | 256 | $ echo b1 >> b |
|
257 | 257 | $ echo d1 > d |
|
258 | 258 | $ hg add d |
|
259 | 259 | $ echo e1 > e |
|
260 | 260 | $ hg qpush -a --force --verbose |
|
261 | 261 | applying p2 |
|
262 | 262 | saving current version of a as a.orig |
|
263 | 263 | patching file a |
|
264 | 264 | a |
|
265 | 265 | applying p3 |
|
266 | 266 | saving current version of b as b.orig |
|
267 | 267 | saving current version of d as d.orig |
|
268 | 268 | patching file b |
|
269 | 269 | patching file c |
|
270 | 270 | patching file d |
|
271 | 271 | file d already exists |
|
272 | 272 | 1 out of 1 hunks FAILED -- saving rejects to file d.rej |
|
273 | 273 | patching file e |
|
274 | 274 | file e already exists |
|
275 | 275 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
276 | 276 | patch failed to apply |
|
277 | 277 | b |
|
278 | 278 | patch failed, rejects left in working dir |
|
279 | 279 | errors during apply, please fix and refresh p3 |
|
280 | 280 | [2] |
|
281 | 281 | $ cat a.orig |
|
282 | 282 | a |
|
283 | 283 | a |
|
284 | 284 | $ cat b.orig |
|
285 | 285 | b |
|
286 | 286 | b1 |
|
287 | 287 | $ cat d.orig |
|
288 | 288 | d1 |
|
289 | 289 | |
|
290 | 290 | test qpush --force --no-backup |
|
291 | 291 | |
|
292 | 292 | $ hg revert -qa |
|
293 | 293 | $ hg qpop -a |
|
294 | 294 | popping p3 |
|
295 | 295 | popping p2 |
|
296 | 296 | patch queue now empty |
|
297 | 297 | $ echo a >> a |
|
298 | 298 | $ rm a.orig |
|
299 | 299 | $ hg qpush --force --no-backup --verbose |
|
300 | 300 | applying p2 |
|
301 | 301 | patching file a |
|
302 | 302 | a |
|
303 | 303 | now at: p2 |
|
304 | 304 | $ test -f a.orig && echo 'error: backup with --no-backup' |
|
305 | 305 | [1] |
|
306 | 306 | |
|
307 | 307 | test qgoto --force --no-backup |
|
308 | 308 | |
|
309 | 309 | $ hg qpop |
|
310 | 310 | popping p2 |
|
311 | 311 | patch queue now empty |
|
312 | 312 | $ echo a >> a |
|
313 | 313 | $ hg qgoto --force --no-backup p2 --verbose |
|
314 | 314 | applying p2 |
|
315 | 315 | patching file a |
|
316 | 316 | a |
|
317 | 317 | now at: p2 |
|
318 | 318 | $ test -f a.orig && echo 'error: backup with --no-backup' |
|
319 | 319 | [1] |
|
320 | 320 | |
|
321 | 321 | test qpush --keep-changes |
|
322 | 322 | |
|
323 | 323 | $ hg qpush --keep-changes --force |
|
324 | 324 | abort: cannot use both --force and --keep-changes |
|
325 | 325 | [255] |
|
326 | 326 | $ hg qpush --keep-changes --exact |
|
327 | 327 | abort: cannot use --exact and --keep-changes together |
|
328 | 328 | [255] |
|
329 | 329 | $ echo b >> b |
|
330 | 330 | $ hg qpush --keep-changes |
|
331 | 331 | applying p3 |
|
332 | 332 | errors during apply, please fix and refresh p2 |
|
333 | 333 | [2] |
|
334 | 334 | $ rm b |
|
335 | 335 | $ hg qpush --keep-changes |
|
336 | 336 | applying p3 |
|
337 | 337 | errors during apply, please fix and refresh p2 |
|
338 | 338 | [2] |
|
339 | 339 | $ hg rm -A b |
|
340 | 340 | $ hg qpush --keep-changes |
|
341 | 341 | applying p3 |
|
342 | 342 | errors during apply, please fix and refresh p2 |
|
343 | 343 | [2] |
|
344 | 344 | $ hg revert -aq b |
|
345 | 345 | $ echo d > d |
|
346 | 346 | $ hg add d |
|
347 | 347 | $ hg qpush --keep-changes |
|
348 | 348 | applying p3 |
|
349 | 349 | errors during apply, please fix and refresh p2 |
|
350 | 350 | [2] |
|
351 | 351 | $ hg forget d |
|
352 | 352 | $ rm d |
|
353 | 353 | $ hg qpop |
|
354 | 354 | popping p2 |
|
355 | 355 | patch queue now empty |
|
356 | 356 | $ echo b >> b |
|
357 | 357 | $ hg qpush -a --keep-changes |
|
358 | 358 | applying p2 |
|
359 | 359 | applying p3 |
|
360 | 360 | errors during apply, please fix and refresh p2 |
|
361 | 361 | [2] |
|
362 | 362 | $ hg qtop |
|
363 | 363 | p2 |
|
364 | 364 | $ hg parents --template "{rev} {desc}\n" |
|
365 | 365 | 2 imported patch p2 |
|
366 | 366 | $ hg st b |
|
367 | 367 | M b |
|
368 | 368 | $ cat b |
|
369 | 369 | b |
|
370 | 370 | b |
|
371 | 371 | |
|
372 | 372 | test qgoto --keep-changes |
|
373 | 373 | |
|
374 | 374 | $ hg revert -aq b |
|
375 | 375 | $ rm e |
|
376 | 376 | $ hg qgoto --keep-changes --force p3 |
|
377 | 377 | abort: cannot use both --force and --keep-changes |
|
378 | 378 | [255] |
|
379 | 379 | $ echo a >> a |
|
380 | 380 | $ hg qgoto --keep-changes p3 |
|
381 | 381 | applying p3 |
|
382 | 382 | now at: p3 |
|
383 | 383 | $ hg st a |
|
384 | 384 | M a |
|
385 | 385 | $ hg qgoto --keep-changes p2 |
|
386 | 386 | popping p3 |
|
387 | 387 | now at: p2 |
|
388 | 388 | $ hg st a |
|
389 | 389 | M a |
|
390 | 390 | |
|
391 | 391 | test mq.keepchanges setting |
|
392 | 392 | |
|
393 | 393 | $ hg --config mq.keepchanges=1 qpush |
|
394 | 394 | applying p3 |
|
395 | 395 | now at: p3 |
|
396 | 396 | $ hg st a |
|
397 | 397 | M a |
|
398 | 398 | $ hg --config mq.keepchanges=1 qpop |
|
399 | 399 | popping p3 |
|
400 | 400 | now at: p2 |
|
401 | 401 | $ hg st a |
|
402 | 402 | M a |
|
403 | 403 | $ hg --config mq.keepchanges=1 qgoto p3 |
|
404 | 404 | applying p3 |
|
405 | 405 | now at: p3 |
|
406 | 406 | $ hg st a |
|
407 | 407 | M a |
|
408 | 408 | $ echo b >> b |
|
409 | 409 | $ hg --config mq.keepchanges=1 qpop --force |
|
410 | 410 | popping p3 |
|
411 | 411 | now at: p2 |
|
412 | 412 | $ hg st b |
|
413 | 413 | $ hg --config mq.keepchanges=1 qpush --exact |
|
414 | 414 | abort: local changes found, refresh first |
|
415 | 415 | [255] |
|
416 | 416 | $ hg revert -qa a |
|
417 | 417 | $ hg qpop |
|
418 | 418 | popping p2 |
|
419 | 419 | patch queue now empty |
|
420 | 420 | $ echo a >> a |
|
421 | 421 | $ hg --config mq.keepchanges=1 qpush --force |
|
422 | 422 | applying p2 |
|
423 | 423 | now at: p2 |
|
424 | 424 | $ hg st a |
|
425 | 425 | |
|
426 | 426 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now