##// END OF EJS Templates
mq: fix test
Matt Mackall -
r11108:8d0cdeaa default
parent child Browse files
Show More
@@ -1,620 +1,620 b''
1 1 #!/bin/sh
2 2
3 3 checkundo()
4 4 {
5 5 if [ -f .hg/store/undo ]; then
6 6 echo ".hg/store/undo still exists after $1"
7 7 fi
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "mq=" >> $HGRCPATH
12 12
13 13 echo "[mq]" >> $HGRCPATH
14 14 echo "plain=true" >> $HGRCPATH
15 15
16 16 echo % help
17 17 hg help mq
18 18
19 19 hg init a
20 20 cd a
21 21 echo a > a
22 22 hg ci -Ama
23 23
24 24 hg clone . ../k
25 25
26 26 mkdir b
27 27 echo z > b/z
28 28 hg ci -Ama
29 29
30 30 echo % qinit
31 31
32 32 hg qinit
33 33
34 34 cd ..
35 35 hg init b
36 36
37 37 echo % -R qinit
38 38
39 39 hg -R b qinit
40 40
41 41 hg init c
42 42
43 43 echo % qinit -c
44 44
45 45 hg --cwd c qinit -c
46 46 hg -R c/.hg/patches st
47 47
48 48 echo '% qinit; qinit -c'
49 49 hg init d
50 50 cd d
51 51 hg qinit
52 52 hg qinit -c
53 53 # qinit -c should create both files if they don't exist
54 54 echo ' .hgignore:'
55 55 cat .hg/patches/.hgignore
56 56 echo ' series:'
57 57 cat .hg/patches/series
58 58 hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
59 59 cd ..
60 60
61 61 echo '% qinit; <stuff>; qinit -c'
62 62 hg init e
63 63 cd e
64 64 hg qnew A
65 65 checkundo qnew
66 66 echo foo > foo
67 67 hg add foo
68 68 hg qrefresh
69 69 hg qnew B
70 70 echo >> foo
71 71 hg qrefresh
72 72 echo status >> .hg/patches/.hgignore
73 73 echo bleh >> .hg/patches/.hgignore
74 74 hg qinit -c
75 75 hg -R .hg/patches status
76 76 # qinit -c shouldn't touch these files if they already exist
77 77 echo ' .hgignore:'
78 78 cat .hg/patches/.hgignore
79 79 echo ' series:'
80 80 cat .hg/patches/series
81 81 cd ..
82 82
83 83 echo '% init --mq without repo'
84 84 mkdir f
85 85 cd f
86 86 hg init --mq
87 87 cd ..
88 88
89 89 echo '% init --mq with repo path'
90 90 hg init g
91 91 hg init --mq g
92 92 test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
93 93
94 94 echo '% init --mq with nonexistent directory'
95 95 hg init --mq nonexistentdir
96 96
97 97 echo '% init --mq with bundle (non "local")'
98 98 hg -R a bundle --all a.bundle >/dev/null
99 99 hg init --mq a.bundle
100 100
101 101 cd a
102 102
103 103 hg qnew -m 'foo bar' test.patch
104 104
105 105 echo % qrefresh
106 106
107 107 echo a >> a
108 108 hg qrefresh
109 109 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
110 110 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
111 111 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
112 112
113 113 echo % empty qrefresh
114 114
115 115 hg qrefresh -X a
116 116 echo 'revision:'
117 117 hg diff -r -2 -r -1
118 118 echo 'patch:'
119 119 cat .hg/patches/test.patch
120 120 echo 'working dir diff:'
121 121 hg diff --nodates -q
122 122 # restore things
123 123 hg qrefresh
124 124 checkundo qrefresh
125 125
126 126 echo % qpop
127 127
128 128 hg qpop
129 129 checkundo qpop
130 130
131 131 echo % qpush with dump of tag cache
132 132
133 133 # Dump the tag cache to ensure that it has exactly one head after qpush.
134 134 rm -f .hg/tags.cache
135 135 hg tags > /dev/null
136 136 echo ".hg/tags.cache (pre qpush):"
137 137 sed 's/ [0-9a-f]*//' .hg/tags.cache
138 138 hg qpush
139 139 hg tags > /dev/null
140 140 echo ".hg/tags.cache (post qpush):"
141 141 sed 's/ [0-9a-f]*//' .hg/tags.cache
142 142
143 143 checkundo qpush
144 144
145 145 cd ..
146 146
147 147 echo % pop/push outside repo
148 148
149 149 hg -R a qpop
150 150 hg -R a qpush
151 151
152 152 cd a
153 153 hg qnew test2.patch
154 154
155 155 echo % qrefresh in subdir
156 156
157 157 cd b
158 158 echo a > a
159 159 hg add a
160 160 hg qrefresh
161 161
162 162 echo % pop/push -a in subdir
163 163
164 164 hg qpop -a
165 165 hg --traceback qpush -a
166 166
167 167 # setting columns & interactive tests truncating (issue1912)
168 168 echo % qseries
169 169 COLUMNS=4 hg qseries --config ui.interactive=true
170 170 COLUMNS=20 hg qseries --config ui.interactive=true -vs
171 171 hg qpop
172 172 hg qseries -vs
173 hg sum
173 hg sum | grep mq
174 174 hg qpush
175 hg sum
175 hg sum | grep mq
176 176
177 177 echo % qapplied
178 178 hg qapplied
179 179
180 180 echo % qtop
181 181 hg qtop
182 182
183 183 echo % prev
184 184 hg qapp -1
185 185
186 186 echo % next
187 187 hg qunapp -1
188 188
189 189 hg qpop
190 190 echo % commit should fail
191 191 hg commit
192 192
193 193 echo % push should fail
194 194 hg push ../../k
195 195
196 196 echo % import should fail
197 197 hg st .
198 198 echo foo >> ../a
199 199 hg diff > ../../import.diff
200 200 hg revert --no-backup ../a
201 201 hg import ../../import.diff
202 202 hg st
203 203 echo % import --no-commit should succeed
204 204 hg import --no-commit ../../import.diff
205 205 hg st
206 206 hg revert --no-backup ../a
207 207
208 208 echo % qunapplied
209 209 hg qunapplied
210 210
211 211 echo % qpush/qpop with index
212 212 hg qnew test1b.patch
213 213 echo 1b > 1b
214 214 hg add 1b
215 215 hg qrefresh
216 216 hg qpush 2
217 217 hg qpop 0
218 218 hg qpush test.patch+1
219 219 hg qpush test.patch+2
220 220 hg qpop test2.patch-1
221 221 hg qpop test2.patch-2
222 222 hg qpush test1b.patch+1
223 223
224 224 echo % qpush --move
225 225 hg qpop -a
226 226 hg qpush --move test2.patch # move to front
227 227 hg qpush --move test1b.patch
228 228 hg qpush --move test.patch # noop move
229 229 hg qseries -v
230 230 hg qpop -a
231 231 hg qpush --move test.patch # cleaning up
232 232 hg qpush --move test1b.patch
233 233 hg qpush --move bogus # nonexistent patch
234 234 hg qpush --move test.patch # already applied
235 235 hg qpush
236 236
237 237 echo % pop, qapplied, qunapplied
238 238 hg qseries -v
239 239 echo % qapplied -1 test.patch
240 240 hg qapplied -1 test.patch
241 241 echo % qapplied -1 test1b.patch
242 242 hg qapplied -1 test1b.patch
243 243 echo % qapplied -1 test2.patch
244 244 hg qapplied -1 test2.patch
245 245 echo % qapplied -1
246 246 hg qapplied -1
247 247 echo % qapplied
248 248 hg qapplied
249 249 echo % qapplied test1b.patch
250 250 hg qapplied test1b.patch
251 251 echo % qunapplied -1
252 252 hg qunapplied -1
253 253 echo % qunapplied
254 254 hg qunapplied
255 255 echo % popping
256 256 hg qpop
257 257 echo % qunapplied -1
258 258 hg qunapplied -1
259 259 echo % qunapplied
260 260 hg qunapplied
261 261 echo % qunapplied test2.patch
262 262 hg qunapplied test2.patch
263 263 echo % qunapplied -1 test2.patch
264 264 hg qunapplied -1 test2.patch
265 265 echo % popping -a
266 266 hg qpop -a
267 267 echo % qapplied
268 268 hg qapplied
269 269 echo % qapplied -1
270 270 hg qapplied -1
271 271 hg qpush
272 272
273 273 echo % push should succeed
274 274 hg qpop -a
275 275 hg push ../../k
276 276
277 277 echo % qpush/qpop error codes
278 278 errorcode()
279 279 {
280 280 hg "$@" && echo " $@ succeeds" || echo " $@ fails"
281 281 }
282 282
283 283 # we want to start with some patches applied
284 284 hg qpush -a
285 285 echo " % pops all patches and succeeds"
286 286 errorcode qpop -a
287 287 echo " % does nothing and succeeds"
288 288 errorcode qpop -a
289 289 echo " % fails - nothing else to pop"
290 290 errorcode qpop
291 291 echo " % pushes a patch and succeeds"
292 292 errorcode qpush
293 293 echo " % pops a patch and succeeds"
294 294 errorcode qpop
295 295 echo " % pushes up to test1b.patch and succeeds"
296 296 errorcode qpush test1b.patch
297 297 echo " % does nothing and succeeds"
298 298 errorcode qpush test1b.patch
299 299 echo " % does nothing and succeeds"
300 300 errorcode qpop test1b.patch
301 301 echo " % fails - can't push to this patch"
302 302 errorcode qpush test.patch
303 303 echo " % fails - can't pop to this patch"
304 304 errorcode qpop test2.patch
305 305 echo " % pops up to test.patch and succeeds"
306 306 errorcode qpop test.patch
307 307 echo " % pushes all patches and succeeds"
308 308 errorcode qpush -a
309 309 echo " % does nothing and succeeds"
310 310 errorcode qpush -a
311 311 echo " % fails - nothing else to push"
312 312 errorcode qpush
313 313 echo " % does nothing and succeeds"
314 314 errorcode qpush test2.patch
315 315
316 316
317 317 echo % strip
318 318 cd ../../b
319 319 echo x>x
320 320 hg ci -Ama
321 321 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
322 322 hg unbundle .hg/strip-backup/*
323 323
324 324 echo % strip with local changes, should complain
325 325 hg up
326 326 echo y>y
327 327 hg add y
328 328 hg strip tip | sed 's/\(saving bundle to \).*/\1/'
329 329 echo % --force strip with local changes
330 330 hg strip -f tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
331 331
332 332 echo '% cd b; hg qrefresh'
333 333 hg init refresh
334 334 cd refresh
335 335 echo a > a
336 336 hg ci -Ama
337 337 hg qnew -mfoo foo
338 338 echo a >> a
339 339 hg qrefresh
340 340 mkdir b
341 341 cd b
342 342 echo f > f
343 343 hg add f
344 344 hg qrefresh
345 345 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
346 346 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
347 347 echo % hg qrefresh .
348 348 hg qrefresh .
349 349 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
350 350 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
351 351 hg status
352 352
353 353 echo % qpush failure
354 354 cd ..
355 355 hg qrefresh
356 356 hg qnew -mbar bar
357 357 echo foo > foo
358 358 echo bar > bar
359 359 hg add foo bar
360 360 hg qrefresh
361 361 hg qpop -a
362 362 echo bar > foo
363 363 hg qpush -a
364 364 hg st
365 365
366 366 echo % mq tags
367 367 hg log --template '{rev} {tags}\n' -r qparent:qtip
368 368
369 369 echo % bad node in status
370 370 hg qpop
371 371 hg strip -qn tip
372 372 hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
373 373 hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
374 374 hg qpop 2>&1 | sed -e 's/unknown node .*/unknown node/'
375 375
376 376 cat >>$HGRCPATH <<EOF
377 377 [diff]
378 378 git = True
379 379 EOF
380 380 cd ..
381 381 hg init git
382 382 cd git
383 383 hg qinit
384 384
385 385 hg qnew -m'new file' new
386 386 echo foo > new
387 387 chmod +x new
388 388 hg add new
389 389 hg qrefresh
390 390 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
391 391 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
392 392
393 393 hg qnew -m'copy file' copy
394 394 hg cp new copy
395 395 hg qrefresh
396 396 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
397 397 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
398 398
399 399 hg qpop
400 400 hg qpush
401 401 hg qdiff
402 402 cat >>$HGRCPATH <<EOF
403 403 [diff]
404 404 git = False
405 405 EOF
406 406 hg qdiff --git
407 407 cd ..
408 408
409 409 echo % test file addition in slow path
410 410 hg init slow
411 411 cd slow
412 412 hg qinit
413 413 echo foo > foo
414 414 hg add foo
415 415 hg ci -m 'add foo'
416 416 hg qnew bar
417 417 echo bar > bar
418 418 hg add bar
419 419 hg mv foo baz
420 420 hg qrefresh --git
421 421 hg up -C 0
422 422 echo >> foo
423 423 hg ci -m 'change foo'
424 424 hg up -C 1
425 425 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
426 426 cat .hg/patches/bar
427 427 hg log -v --template '{rev} {file_copies}\n' -r .
428 428 hg qrefresh --git
429 429 cat .hg/patches/bar
430 430 hg log -v --template '{rev} {file_copies}\n' -r .
431 431 hg qrefresh
432 432 grep 'diff --git' .hg/patches/bar
433 433
434 434 echo % test file move chains in the slow path
435 435 hg up -C 1
436 436 echo >> foo
437 437 hg ci -m 'change foo again'
438 438 hg up -C 2
439 439 hg mv bar quux
440 440 hg mv baz bleh
441 441 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
442 442 cat .hg/patches/bar
443 443 hg log -v --template '{rev} {file_copies}\n' -r .
444 444 hg mv quux fred
445 445 hg mv bleh barney
446 446 hg qrefresh --git
447 447 cat .hg/patches/bar
448 448 hg log -v --template '{rev} {file_copies}\n' -r .
449 449
450 450 echo % refresh omitting an added file
451 451 hg qnew baz
452 452 echo newfile > newfile
453 453 hg add newfile
454 454 hg qrefresh
455 455 hg st -A newfile
456 456 hg qrefresh -X newfile
457 457 hg st -A newfile
458 458 hg revert newfile
459 459 rm newfile
460 460 hg qpop
461 461 hg qdel baz
462 462
463 463 echo % create a git patch
464 464 echo a > alexander
465 465 hg add alexander
466 466 hg qnew -f --git addalexander
467 467 grep diff .hg/patches/addalexander
468 468
469 469 echo % create a git binary patch
470 470 cat > writebin.py <<EOF
471 471 import sys
472 472 path = sys.argv[1]
473 473 open(path, 'wb').write('BIN\x00ARY')
474 474 EOF
475 475 python writebin.py bucephalus
476 476
477 477 python "$TESTDIR/md5sum.py" bucephalus
478 478 hg add bucephalus
479 479 hg qnew -f --git addbucephalus
480 480 grep diff .hg/patches/addbucephalus
481 481
482 482 echo % check binary patches can be popped and pushed
483 483 hg qpop
484 484 test -f bucephalus && echo % bucephalus should not be there
485 485 hg qpush
486 486 test -f bucephalus || echo % bucephalus should be there
487 487 python "$TESTDIR/md5sum.py" bucephalus
488 488
489 489
490 490 echo '% strip again'
491 491 cd ..
492 492 hg init strip
493 493 cd strip
494 494 touch foo
495 495 hg add foo
496 496 hg ci -m 'add foo'
497 497 echo >> foo
498 498 hg ci -m 'change foo 1'
499 499 hg up -C 0
500 500 echo 1 >> foo
501 501 hg ci -m 'change foo 2'
502 502 HGMERGE=true hg merge
503 503 hg ci -m merge
504 504 hg log
505 505 hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
506 506 checkundo strip
507 507 hg log
508 508 cd ..
509 509
510 510 echo '% qclone'
511 511 qlog()
512 512 {
513 513 echo 'main repo:'
514 514 hg log --template ' rev {rev}: {desc}\n'
515 515 echo 'patch repo:'
516 516 hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
517 517 }
518 518 hg init qclonesource
519 519 cd qclonesource
520 520 echo foo > foo
521 521 hg add foo
522 522 hg ci -m 'add foo'
523 523 hg qinit
524 524 hg qnew patch1
525 525 echo bar >> foo
526 526 hg qrefresh -m 'change foo'
527 527 cd ..
528 528
529 529 # repo with unversioned patch dir
530 530 hg qclone qclonesource failure
531 531
532 532 cd qclonesource
533 533 hg qinit -c
534 534 hg qci -m checkpoint
535 535 qlog
536 536 cd ..
537 537
538 538 # repo with patches applied
539 539 hg qclone qclonesource qclonedest
540 540 cd qclonedest
541 541 qlog
542 542 cd ..
543 543
544 544 # repo with patches unapplied
545 545 cd qclonesource
546 546 hg qpop -a
547 547 qlog
548 548 cd ..
549 549 hg qclone qclonesource qclonedest2
550 550 cd qclonedest2
551 551 qlog
552 552 cd ..
553 553
554 554 echo % 'test applying on an empty file (issue 1033)'
555 555 hg init empty
556 556 cd empty
557 557 touch a
558 558 hg ci -Am addempty
559 559 echo a > a
560 560 hg qnew -f -e changea
561 561 hg qpop
562 562 hg qpush
563 563 cd ..
564 564
565 565 echo % test qpush with --force, issue1087
566 566 hg init forcepush
567 567 cd forcepush
568 568 echo hello > hello.txt
569 569 echo bye > bye.txt
570 570 hg ci -Ama
571 571 hg qnew -d '0 0' empty
572 572 hg qpop
573 573 echo world >> hello.txt
574 574
575 575 echo % qpush should fail, local changes
576 576 hg qpush
577 577
578 578 echo % apply force, should not discard changes with empty patch
579 579 hg qpush -f 2>&1 | sed 's,^.*/patch,patch,g'
580 580 hg diff --config diff.nodates=True
581 581 hg qdiff --config diff.nodates=True
582 582 hg log -l1 -p
583 583 hg qref -d '0 0'
584 584 hg qpop
585 585 echo universe >> hello.txt
586 586 echo universe >> bye.txt
587 587
588 588 echo % qpush should fail, local changes
589 589 hg qpush
590 590
591 591 echo % apply force, should discard changes in hello, but not bye
592 592 hg qpush -f
593 593 hg st
594 594 hg diff --config diff.nodates=True
595 595 hg qdiff --config diff.nodates=True
596 596
597 597 echo % test popping revisions not in working dir ancestry
598 598 hg qseries -v
599 599 hg up qparent
600 600 hg qpop
601 601
602 602 cd ..
603 603 hg init deletion-order
604 604 cd deletion-order
605 605
606 606 touch a
607 607 hg ci -Aqm0
608 608
609 609 hg qnew rename-dir
610 610 hg rm a
611 611 hg qrefresh
612 612
613 613 mkdir a b
614 614 touch a/a b/b
615 615 hg add -q a b
616 616 hg qrefresh
617 617
618 618 echo % test popping must remove files added in subdirectories first
619 619 hg qpop
620 620 cd ..
@@ -1,661 +1,651 b''
1 1 % help
2 2 mq extension - manage a stack of patches
3 3
4 4 This extension lets you work with a stack of patches in a Mercurial
5 5 repository. It manages two stacks of patches - all known patches, and applied
6 6 patches (subset of known patches).
7 7
8 8 Known patches are represented as patch files in the .hg/patches directory.
9 9 Applied patches are both patch files and changesets.
10 10
11 11 Common tasks (use "hg help command" for more details):
12 12
13 13 create new patch qnew
14 14 import existing patch qimport
15 15
16 16 print patch series qseries
17 17 print applied patches qapplied
18 18
19 19 add known patch to applied stack qpush
20 20 remove patch from applied stack qpop
21 21 refresh contents of top applied patch qrefresh
22 22
23 23 By default, mq will automatically use git patches when required to avoid
24 24 losing file mode changes, copy records, binary files or empty files creations
25 25 or deletions. This behaviour can be configured with:
26 26
27 27 [mq]
28 28 git = auto/keep/yes/no
29 29
30 30 If set to 'keep', mq will obey the [diff] section configuration while
31 31 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
32 32 will override the [diff] section and always generate git or regular patches,
33 33 possibly losing data in the second case.
34 34
35 35 list of commands:
36 36
37 37 qapplied print the patches already applied
38 38 qclone clone main and patch repository at same time
39 39 qdelete remove patches from queue
40 40 qdiff diff of the current patch and subsequent modifications
41 41 qfinish move applied patches into repository history
42 42 qfold fold the named patches into the current patch
43 43 qgoto push or pop patches until named patch is at top of stack
44 44 qguard set or print guards for a patch
45 45 qheader print the header of the topmost or specified patch
46 46 qimport import a patch
47 47 qnew create a new patch
48 48 qnext print the name of the next patch
49 49 qpop pop the current patch off the stack
50 50 qprev print the name of the previous patch
51 51 qpush push the next patch onto the stack
52 52 qrefresh update the current patch
53 53 qrename rename a patch
54 54 qselect set or print guarded patches to push
55 55 qseries print the entire series file
56 56 qtop print the name of the current patch
57 57 qunapplied print the patches not yet applied
58 58 strip strip a changeset and all its descendants from the repository
59 59
60 60 use "hg -v help mq" to show aliases and global options
61 61 adding a
62 62 updating to branch default
63 63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 64 adding b/z
65 65 % qinit
66 66 % -R qinit
67 67 % qinit -c
68 68 A .hgignore
69 69 A series
70 70 % qinit; qinit -c
71 71 .hgignore:
72 72 ^\.hg
73 73 ^\.mq
74 74 syntax: glob
75 75 status
76 76 guards
77 77 series:
78 78 abort: repository already exists!
79 79 % qinit; <stuff>; qinit -c
80 80 adding .hg/patches/A
81 81 adding .hg/patches/B
82 82 A .hgignore
83 83 A A
84 84 A B
85 85 A series
86 86 .hgignore:
87 87 status
88 88 bleh
89 89 series:
90 90 A
91 91 B
92 92 % init --mq without repo
93 93 abort: There is no Mercurial repository here (.hg not found)
94 94 % init --mq with repo path
95 95 ok
96 96 % init --mq with nonexistent directory
97 97 abort: repository nonexistentdir not found!
98 98 % init --mq with bundle (non "local")
99 99 abort: only a local queue repository may be initialized
100 100 % qrefresh
101 101 foo bar
102 102
103 103 diff -r xa
104 104 --- a/a
105 105 +++ b/a
106 106 @@ -1,1 +1,2 @@
107 107 a
108 108 +a
109 109 % empty qrefresh
110 110 revision:
111 111 patch:
112 112 foo bar
113 113
114 114 working dir diff:
115 115 --- a/a
116 116 +++ b/a
117 117 @@ -1,1 +1,2 @@
118 118 a
119 119 +a
120 120 % qpop
121 121 popping test.patch
122 122 patch queue now empty
123 123 % qpush with dump of tag cache
124 124 .hg/tags.cache (pre qpush):
125 125 1
126 126
127 127 applying test.patch
128 128 now at: test.patch
129 129 .hg/tags.cache (post qpush):
130 130 2
131 131
132 132 % pop/push outside repo
133 133 popping test.patch
134 134 patch queue now empty
135 135 applying test.patch
136 136 now at: test.patch
137 137 % qrefresh in subdir
138 138 % pop/push -a in subdir
139 139 popping test2.patch
140 140 popping test.patch
141 141 patch queue now empty
142 142 applying test.patch
143 143 applying test2.patch
144 144 now at: test2.patch
145 145 % qseries
146 146 test.patch
147 147 test2.patch
148 148 0 A test.patch: f...
149 149 1 A test2.patch:
150 150 popping test2.patch
151 151 now at: test.patch
152 152 0 A test.patch: foo bar
153 153 1 U test2.patch:
154 parent: 2:1d611e5a7244 qbase qtip test.patch tip
155 foo bar
156 branch: default
157 commit: (clean)
158 update: (current)
159 154 mq: 1 applied, 1 unapplied
160 155 applying test2.patch
161 156 now at: test2.patch
162 parent: 3:333b5cb98635 qtip test2.patch tip
163 imported patch test2.patch
164 branch: default
165 commit: (clean)
166 update: (current)
167 157 mq: 2 applied
168 158 % qapplied
169 159 test.patch
170 160 test2.patch
171 161 % qtop
172 162 test2.patch
173 163 % prev
174 164 test.patch
175 165 % next
176 166 all patches applied
177 167 popping test2.patch
178 168 now at: test.patch
179 169 % commit should fail
180 170 abort: cannot commit over an applied mq patch
181 171 % push should fail
182 172 pushing to ../../k
183 173 abort: source has mq patches applied
184 174 % import should fail
185 175 abort: cannot import over an applied patch
186 176 % import --no-commit should succeed
187 177 applying ../../import.diff
188 178 M a
189 179 % qunapplied
190 180 test2.patch
191 181 % qpush/qpop with index
192 182 applying test2.patch
193 183 now at: test2.patch
194 184 popping test2.patch
195 185 popping test1b.patch
196 186 now at: test.patch
197 187 applying test1b.patch
198 188 now at: test1b.patch
199 189 applying test2.patch
200 190 now at: test2.patch
201 191 popping test2.patch
202 192 now at: test1b.patch
203 193 popping test1b.patch
204 194 now at: test.patch
205 195 applying test1b.patch
206 196 applying test2.patch
207 197 now at: test2.patch
208 198 % qpush --move
209 199 popping test2.patch
210 200 popping test1b.patch
211 201 popping test.patch
212 202 patch queue now empty
213 203 applying test2.patch
214 204 now at: test2.patch
215 205 applying test1b.patch
216 206 now at: test1b.patch
217 207 applying test.patch
218 208 now at: test.patch
219 209 0 A test2.patch
220 210 1 A test1b.patch
221 211 2 A test.patch
222 212 popping test.patch
223 213 popping test1b.patch
224 214 popping test2.patch
225 215 patch queue now empty
226 216 applying test.patch
227 217 now at: test.patch
228 218 applying test1b.patch
229 219 now at: test1b.patch
230 220 abort: patch bogus not in series
231 221 abort: cannot push to a previous patch: test.patch
232 222 applying test2.patch
233 223 now at: test2.patch
234 224 % pop, qapplied, qunapplied
235 225 0 A test.patch
236 226 1 A test1b.patch
237 227 2 A test2.patch
238 228 % qapplied -1 test.patch
239 229 only one patch applied
240 230 % qapplied -1 test1b.patch
241 231 test.patch
242 232 % qapplied -1 test2.patch
243 233 test1b.patch
244 234 % qapplied -1
245 235 test1b.patch
246 236 % qapplied
247 237 test.patch
248 238 test1b.patch
249 239 test2.patch
250 240 % qapplied test1b.patch
251 241 test.patch
252 242 test1b.patch
253 243 % qunapplied -1
254 244 all patches applied
255 245 % qunapplied
256 246 % popping
257 247 popping test2.patch
258 248 now at: test1b.patch
259 249 % qunapplied -1
260 250 test2.patch
261 251 % qunapplied
262 252 test2.patch
263 253 % qunapplied test2.patch
264 254 % qunapplied -1 test2.patch
265 255 all patches applied
266 256 % popping -a
267 257 popping test1b.patch
268 258 popping test.patch
269 259 patch queue now empty
270 260 % qapplied
271 261 % qapplied -1
272 262 no patches applied
273 263 applying test.patch
274 264 now at: test.patch
275 265 % push should succeed
276 266 popping test.patch
277 267 patch queue now empty
278 268 pushing to ../../k
279 269 searching for changes
280 270 adding changesets
281 271 adding manifests
282 272 adding file changes
283 273 added 1 changesets with 1 changes to 1 files
284 274 % qpush/qpop error codes
285 275 applying test.patch
286 276 applying test1b.patch
287 277 applying test2.patch
288 278 now at: test2.patch
289 279 % pops all patches and succeeds
290 280 popping test2.patch
291 281 popping test1b.patch
292 282 popping test.patch
293 283 patch queue now empty
294 284 qpop -a succeeds
295 285 % does nothing and succeeds
296 286 no patches applied
297 287 qpop -a succeeds
298 288 % fails - nothing else to pop
299 289 no patches applied
300 290 qpop fails
301 291 % pushes a patch and succeeds
302 292 applying test.patch
303 293 now at: test.patch
304 294 qpush succeeds
305 295 % pops a patch and succeeds
306 296 popping test.patch
307 297 patch queue now empty
308 298 qpop succeeds
309 299 % pushes up to test1b.patch and succeeds
310 300 applying test.patch
311 301 applying test1b.patch
312 302 now at: test1b.patch
313 303 qpush test1b.patch succeeds
314 304 % does nothing and succeeds
315 305 qpush: test1b.patch is already at the top
316 306 qpush test1b.patch succeeds
317 307 % does nothing and succeeds
318 308 qpop: test1b.patch is already at the top
319 309 qpop test1b.patch succeeds
320 310 % fails - can't push to this patch
321 311 abort: cannot push to a previous patch: test.patch
322 312 qpush test.patch fails
323 313 % fails - can't pop to this patch
324 314 abort: patch test2.patch is not applied
325 315 qpop test2.patch fails
326 316 % pops up to test.patch and succeeds
327 317 popping test1b.patch
328 318 now at: test.patch
329 319 qpop test.patch succeeds
330 320 % pushes all patches and succeeds
331 321 applying test1b.patch
332 322 applying test2.patch
333 323 now at: test2.patch
334 324 qpush -a succeeds
335 325 % does nothing and succeeds
336 326 all patches are currently applied
337 327 qpush -a succeeds
338 328 % fails - nothing else to push
339 329 patch series already fully applied
340 330 qpush fails
341 331 % does nothing and succeeds
342 332 qpush: test2.patch is already at the top
343 333 qpush test2.patch succeeds
344 334 % strip
345 335 adding x
346 336 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
347 337 saving bundle to
348 338 adding changesets
349 339 adding manifests
350 340 adding file changes
351 341 added 1 changesets with 1 changes to 1 files
352 342 (run 'hg update' to get a working copy)
353 343 % strip with local changes, should complain
354 344 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 345 abort: local changes found
356 346 % --force strip with local changes
357 347 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
358 348 saving bundle to
359 349 % cd b; hg qrefresh
360 350 adding a
361 351 foo
362 352
363 353 diff -r cb9a9f314b8b a
364 354 --- a/a
365 355 +++ b/a
366 356 @@ -1,1 +1,2 @@
367 357 a
368 358 +a
369 359 diff -r cb9a9f314b8b b/f
370 360 --- /dev/null
371 361 +++ b/b/f
372 362 @@ -0,0 +1,1 @@
373 363 +f
374 364 % hg qrefresh .
375 365 foo
376 366
377 367 diff -r cb9a9f314b8b b/f
378 368 --- /dev/null
379 369 +++ b/b/f
380 370 @@ -0,0 +1,1 @@
381 371 +f
382 372 M a
383 373 % qpush failure
384 374 popping bar
385 375 popping foo
386 376 patch queue now empty
387 377 applying foo
388 378 applying bar
389 379 file foo already exists
390 380 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
391 381 patch failed, unable to continue (try -v)
392 382 patch failed, rejects left in working dir
393 383 errors during apply, please fix and refresh bar
394 384 ? foo
395 385 ? foo.rej
396 386 % mq tags
397 387 0 qparent
398 388 1 foo qbase
399 389 2 bar qtip tip
400 390 % bad node in status
401 391 popping bar
402 392 now at: foo
403 393 changeset: 0:cb9a9f314b8b
404 394 mq status file refers to unknown node
405 395 tag: tip
406 396 user: test
407 397 date: Thu Jan 01 00:00:00 1970 +0000
408 398 summary: a
409 399
410 400 mq status file refers to unknown node
411 401 default 0:cb9a9f314b8b
412 402 abort: trying to pop unknown node
413 403 new file
414 404
415 405 diff --git a/new b/new
416 406 new file mode 100755
417 407 --- /dev/null
418 408 +++ b/new
419 409 @@ -0,0 +1,1 @@
420 410 +foo
421 411 copy file
422 412
423 413 diff --git a/new b/copy
424 414 copy from new
425 415 copy to copy
426 416 popping copy
427 417 now at: new
428 418 applying copy
429 419 now at: copy
430 420 diff --git a/new b/copy
431 421 copy from new
432 422 copy to copy
433 423 diff --git a/new b/copy
434 424 copy from new
435 425 copy to copy
436 426 % test file addition in slow path
437 427 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
438 428 created new head
439 429 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
440 430 adding branch
441 431 adding changesets
442 432 adding manifests
443 433 adding file changes
444 434 added 1 changesets with 1 changes to 1 files
445 435 diff --git a/bar b/bar
446 436 new file mode 100644
447 437 --- /dev/null
448 438 +++ b/bar
449 439 @@ -0,0 +1,1 @@
450 440 +bar
451 441 diff --git a/foo b/baz
452 442 rename from foo
453 443 rename to baz
454 444 2 baz (foo)
455 445 diff --git a/bar b/bar
456 446 new file mode 100644
457 447 --- /dev/null
458 448 +++ b/bar
459 449 @@ -0,0 +1,1 @@
460 450 +bar
461 451 diff --git a/foo b/baz
462 452 rename from foo
463 453 rename to baz
464 454 2 baz (foo)
465 455 diff --git a/bar b/bar
466 456 diff --git a/foo b/baz
467 457 % test file move chains in the slow path
468 458 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
469 459 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
470 460 adding branch
471 461 adding changesets
472 462 adding manifests
473 463 adding file changes
474 464 added 1 changesets with 1 changes to 1 files
475 465 diff --git a/foo b/bleh
476 466 rename from foo
477 467 rename to bleh
478 468 diff --git a/quux b/quux
479 469 new file mode 100644
480 470 --- /dev/null
481 471 +++ b/quux
482 472 @@ -0,0 +1,1 @@
483 473 +bar
484 474 3 bleh (foo)
485 475 diff --git a/foo b/barney
486 476 rename from foo
487 477 rename to barney
488 478 diff --git a/fred b/fred
489 479 new file mode 100644
490 480 --- /dev/null
491 481 +++ b/fred
492 482 @@ -0,0 +1,1 @@
493 483 +bar
494 484 3 barney (foo)
495 485 % refresh omitting an added file
496 486 C newfile
497 487 A newfile
498 488 popping baz
499 489 now at: bar
500 490 % create a git patch
501 491 diff --git a/alexander b/alexander
502 492 % create a git binary patch
503 493 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
504 494 diff --git a/bucephalus b/bucephalus
505 495 % check binary patches can be popped and pushed
506 496 popping addbucephalus
507 497 now at: addalexander
508 498 applying addbucephalus
509 499 now at: addbucephalus
510 500 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
511 501 % strip again
512 502 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
513 503 created new head
514 504 merging foo
515 505 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
516 506 (branch merge, don't forget to commit)
517 507 changeset: 3:99615015637b
518 508 tag: tip
519 509 parent: 2:20cbbe65cff7
520 510 parent: 1:d2871fc282d4
521 511 user: test
522 512 date: Thu Jan 01 00:00:00 1970 +0000
523 513 summary: merge
524 514
525 515 changeset: 2:20cbbe65cff7
526 516 parent: 0:53245c60e682
527 517 user: test
528 518 date: Thu Jan 01 00:00:00 1970 +0000
529 519 summary: change foo 2
530 520
531 521 changeset: 1:d2871fc282d4
532 522 user: test
533 523 date: Thu Jan 01 00:00:00 1970 +0000
534 524 summary: change foo 1
535 525
536 526 changeset: 0:53245c60e682
537 527 user: test
538 528 date: Thu Jan 01 00:00:00 1970 +0000
539 529 summary: add foo
540 530
541 531 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
542 532 saving bundle to
543 533 saving bundle to
544 534 adding branch
545 535 adding changesets
546 536 adding manifests
547 537 adding file changes
548 538 added 1 changesets with 1 changes to 1 files
549 539 changeset: 1:20cbbe65cff7
550 540 tag: tip
551 541 user: test
552 542 date: Thu Jan 01 00:00:00 1970 +0000
553 543 summary: change foo 2
554 544
555 545 changeset: 0:53245c60e682
556 546 user: test
557 547 date: Thu Jan 01 00:00:00 1970 +0000
558 548 summary: add foo
559 549
560 550 % qclone
561 551 abort: versioned patch repository not found (see init --mq)
562 552 adding .hg/patches/patch1
563 553 main repo:
564 554 rev 1: change foo
565 555 rev 0: add foo
566 556 patch repo:
567 557 rev 0: checkpoint
568 558 updating to branch default
569 559 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
570 560 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
571 561 main repo:
572 562 rev 0: add foo
573 563 patch repo:
574 564 rev 0: checkpoint
575 565 popping patch1
576 566 patch queue now empty
577 567 main repo:
578 568 rev 0: add foo
579 569 patch repo:
580 570 rev 0: checkpoint
581 571 updating to branch default
582 572 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 573 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 574 main repo:
585 575 rev 0: add foo
586 576 patch repo:
587 577 rev 0: checkpoint
588 578 % test applying on an empty file (issue 1033)
589 579 adding a
590 580 popping changea
591 581 patch queue now empty
592 582 applying changea
593 583 now at: changea
594 584 % test qpush with --force, issue1087
595 585 adding bye.txt
596 586 adding hello.txt
597 587 popping empty
598 588 patch queue now empty
599 589 % qpush should fail, local changes
600 590 abort: local changes found, refresh first
601 591 % apply force, should not discard changes with empty patch
602 592 applying empty
603 593 patch empty is empty
604 594 now at: empty
605 595 diff -r bf5fc3f07a0a hello.txt
606 596 --- a/hello.txt
607 597 +++ b/hello.txt
608 598 @@ -1,1 +1,2 @@
609 599 hello
610 600 +world
611 601 diff -r 9ecee4f634e3 hello.txt
612 602 --- a/hello.txt
613 603 +++ b/hello.txt
614 604 @@ -1,1 +1,2 @@
615 605 hello
616 606 +world
617 607 changeset: 1:bf5fc3f07a0a
618 608 tag: empty
619 609 tag: qbase
620 610 tag: qtip
621 611 tag: tip
622 612 user: test
623 613 date: Thu Jan 01 00:00:00 1970 +0000
624 614 summary: imported patch empty
625 615
626 616
627 617 popping empty
628 618 patch queue now empty
629 619 % qpush should fail, local changes
630 620 abort: local changes found, refresh first
631 621 % apply force, should discard changes in hello, but not bye
632 622 applying empty
633 623 now at: empty
634 624 M bye.txt
635 625 diff -r ba252371dbc1 bye.txt
636 626 --- a/bye.txt
637 627 +++ b/bye.txt
638 628 @@ -1,1 +1,2 @@
639 629 bye
640 630 +universe
641 631 diff -r 9ecee4f634e3 bye.txt
642 632 --- a/bye.txt
643 633 +++ b/bye.txt
644 634 @@ -1,1 +1,2 @@
645 635 bye
646 636 +universe
647 637 diff -r 9ecee4f634e3 hello.txt
648 638 --- a/hello.txt
649 639 +++ b/hello.txt
650 640 @@ -1,1 +1,3 @@
651 641 hello
652 642 +world
653 643 +universe
654 644 % test popping revisions not in working dir ancestry
655 645 0 A empty
656 646 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
657 647 popping empty
658 648 patch queue now empty
659 649 % test popping must remove files added in subdirectories first
660 650 popping rename-dir
661 651 patch queue now empty
General Comments 0
You need to be logged in to leave comments. Login now