Mercurial > hg
comparison tests/test-transplant.t @ 42762:ac6121a24f27
transplant: added support for --stop flag
This adds fuctionality for `--stop` flag to `transplant`.
A new method `stop` is added to `transplanter` class
containing logic to abort transplant.
Tests are updated as shown.
Differential Revision: https://phab.mercurial-scm.org/D6695
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Fri, 26 Jul 2019 01:19:43 +0530 |
parents | 0a4303c77637 |
children | d7304434390f |
comparison
equal
deleted
inserted
replaced
42761:5c285c8e4f98 | 42762:ac6121a24f27 |
---|---|
1 #testcases commandmode continueflag | 1 #testcases commandmode continueflag |
2 $ cat <<EOF >> $HGRCPATH | 2 $ cat <<EOF >> $HGRCPATH |
3 > [extensions] | 3 > [extensions] |
4 > transplant= | 4 > transplant= |
5 > graphlog= | |
5 > EOF | 6 > EOF |
6 | 7 |
7 #if continueflag | 8 #if continueflag |
8 $ cat >> $HGRCPATH <<EOF | 9 $ cat >> $HGRCPATH <<EOF |
9 > [alias] | 10 > [alias] |
16 $ hg transplant | 17 $ hg transplant |
17 abort: no source URL, branch revision, or revision list provided | 18 abort: no source URL, branch revision, or revision list provided |
18 [255] | 19 [255] |
19 $ hg transplant --continue --all | 20 $ hg transplant --continue --all |
20 abort: --continue is incompatible with --branch, --all and --merge | 21 abort: --continue is incompatible with --branch, --all and --merge |
22 [255] | |
23 $ hg transplant --stop --all | |
24 abort: --stop is incompatible with --branch, --all and --merge | |
21 [255] | 25 [255] |
22 $ hg transplant --all tip | 26 $ hg transplant --all tip |
23 abort: --all requires a branch revision | 27 abort: --all requires a branch revision |
24 [255] | 28 [255] |
25 $ hg transplant --all --branch default tip | 29 $ hg transplant --all --branch default tip |
374 $ hg transplant -s http://localhost:$HGPORT/ 8d9279348abb 722f4667af76 | 378 $ hg transplant -s http://localhost:$HGPORT/ 8d9279348abb 722f4667af76 |
375 skipping already applied revision 2:8d9279348abb | 379 skipping already applied revision 2:8d9279348abb |
376 applying 722f4667af76 | 380 applying 722f4667af76 |
377 722f4667af76 transplanted to 76e321915884 | 381 722f4667af76 transplanted to 76e321915884 |
378 | 382 |
379 transplant --continue | 383 |
384 transplant --continue and --stop behaviour | |
380 | 385 |
381 $ hg init ../tc | 386 $ hg init ../tc |
382 $ cd ../tc | 387 $ cd ../tc |
383 $ cat <<EOF > foo | 388 $ cat <<EOF > foo |
384 > foo | 389 > foo |
414 $ hg up 0 | 419 $ hg up 0 |
415 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | 420 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
416 $ echo foobar > foo | 421 $ echo foobar > foo |
417 $ hg ci -mfoobar | 422 $ hg ci -mfoobar |
418 created new head | 423 created new head |
424 | |
425 Repo log before transplant | |
426 $ hg glog | |
427 @ changeset: 4:e8643552fde5 | |
428 | tag: tip | |
429 | parent: 0:493149fa1541 | |
430 | user: test | |
431 | date: Thu Jan 01 00:00:00 1970 +0000 | |
432 | summary: foobar | |
433 | | |
434 | o changeset: 3:1dab759070cf | |
435 | | user: test | |
436 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
437 | | summary: bar2 | |
438 | | | |
439 | o changeset: 2:9d6d6b5a8275 | |
440 | | user: test | |
441 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
442 | | summary: bar | |
443 | | | |
444 | o changeset: 1:46ae92138f3c | |
445 |/ user: test | |
446 | date: Thu Jan 01 00:00:00 1970 +0000 | |
447 | summary: foo2 | |
448 | | |
449 o changeset: 0:493149fa1541 | |
450 user: test | |
451 date: Thu Jan 01 00:00:00 1970 +0000 | |
452 summary: foo | |
453 | |
419 $ hg transplant 1:3 | 454 $ hg transplant 1:3 |
420 applying 46ae92138f3c | 455 applying 46ae92138f3c |
456 patching file foo | |
457 Hunk #1 FAILED at 0 | |
458 1 out of 1 hunks FAILED -- saving rejects to file foo.rej | |
459 patch failed to apply | |
460 abort: fix up the working directory and run hg transplant --continue | |
461 [255] | |
462 | |
463 $ hg transplant --stop | |
464 stopped the interrupted transplant | |
465 working directory is now at e8643552fde5 | |
466 Repo log after abort | |
467 $ hg glog | |
468 @ changeset: 4:e8643552fde5 | |
469 | tag: tip | |
470 | parent: 0:493149fa1541 | |
471 | user: test | |
472 | date: Thu Jan 01 00:00:00 1970 +0000 | |
473 | summary: foobar | |
474 | | |
475 | o changeset: 3:1dab759070cf | |
476 | | user: test | |
477 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
478 | | summary: bar2 | |
479 | | | |
480 | o changeset: 2:9d6d6b5a8275 | |
481 | | user: test | |
482 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
483 | | summary: bar | |
484 | | | |
485 | o changeset: 1:46ae92138f3c | |
486 |/ user: test | |
487 | date: Thu Jan 01 00:00:00 1970 +0000 | |
488 | summary: foo2 | |
489 | | |
490 o changeset: 0:493149fa1541 | |
491 user: test | |
492 date: Thu Jan 01 00:00:00 1970 +0000 | |
493 summary: foo | |
494 | |
495 $ hg transplant 1:3 | |
496 applying 46ae92138f3c | |
497 file added already exists | |
498 1 out of 1 hunks FAILED -- saving rejects to file added.rej | |
421 patching file foo | 499 patching file foo |
422 Hunk #1 FAILED at 0 | 500 Hunk #1 FAILED at 0 |
423 1 out of 1 hunks FAILED -- saving rejects to file foo.rej | 501 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
424 patch failed to apply | 502 patch failed to apply |
425 abort: fix up the working directory and run hg transplant --continue | 503 abort: fix up the working directory and run hg transplant --continue |
433 1 other heads for branch "default" | 511 1 other heads for branch "default" |
434 $ rm added | 512 $ rm added |
435 $ hg continue | 513 $ hg continue |
436 abort: no transplant to continue (continueflag !) | 514 abort: no transplant to continue (continueflag !) |
437 abort: no operation in progress (no-continueflag !) | 515 abort: no operation in progress (no-continueflag !) |
516 [255] | |
517 $ hg transplant --stop | |
518 abort: no interrupted transplant found | |
438 [255] | 519 [255] |
439 $ hg transplant 1 | 520 $ hg transplant 1 |
440 applying 46ae92138f3c | 521 applying 46ae92138f3c |
441 patching file foo | 522 patching file foo |
442 Hunk #1 FAILED at 0 | 523 Hunk #1 FAILED at 0 |
487 patch failed to apply | 568 patch failed to apply |
488 abort: fix up the working directory and run hg transplant --continue | 569 abort: fix up the working directory and run hg transplant --continue |
489 [255] | 570 [255] |
490 $ hg transplant 1:3 | 571 $ hg transplant 1:3 |
491 abort: transplant in progress | 572 abort: transplant in progress |
492 (use 'hg transplant --continue' or 'hg update' to abort) | 573 (use 'hg transplant --continue' or 'hg transplant --stop') |
493 [255] | 574 [255] |
494 $ hg status -v | 575 $ hg status -v |
495 A bar | 576 A bar |
577 ? added.rej | |
496 ? baz.rej | 578 ? baz.rej |
497 ? foo.rej | 579 ? foo.rej |
498 # The repository is in an unfinished *transplant* state. | 580 # The repository is in an unfinished *transplant* state. |
499 | 581 |
500 # To continue: hg transplant --continue | 582 # To continue: hg transplant --continue |
501 # To abort: hg update | 583 # To stop: hg transplant --stop |
502 | 584 |
503 $ echo fixed > baz | 585 $ echo fixed > baz |
504 $ hg continue | 586 $ hg continue |
505 9d6d6b5a8275 transplanted as d80c49962290 | 587 9d6d6b5a8275 transplanted as d80c49962290 |
506 applying 1dab759070cf | 588 applying 1dab759070cf |
507 1dab759070cf transplanted to aa0ffe6bd5ae | 589 1dab759070cf transplanted to aa0ffe6bd5ae |
508 | |
509 $ cd .. | 590 $ cd .. |
510 | 591 |
511 Issue1111: Test transplant --merge | 592 Issue1111: Test transplant --merge |
512 | 593 |
513 $ hg init t1111 | 594 $ hg init t1111 |