comparison tests/test-split.t @ 6418:50c4ed02ac6d stable

topic: make hg split preserve topic namespace
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 21 Feb 2023 16:54:29 +0400
parents 60daa7887c49
children 25e910a0136b 45689da4ed41
comparison
equal deleted inserted replaced
6417:c37754bb02d4 6418:50c4ed02ac6d
409 409
410 Add topic to the hgrc 410 Add topic to the hgrc
411 411
412 $ echo "[extensions]" >> $HGRCPATH 412 $ echo "[extensions]" >> $HGRCPATH
413 $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH 413 $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH
414 $ hg debug-topic-namespace mynamespace
415 marked working directory as topic namespace: mynamespace
414 $ hg topic mytopic 416 $ hg topic mytopic
415 marked working directory as topic: mytopic 417 marked working directory as topic: mytopic
416 $ echo babar > babar 418 $ echo babar > babar
417 $ echo celeste > celeste 419 $ echo celeste > celeste
418 $ hg add babar celeste 420 $ hg add babar celeste
419 $ hg commit -m "Works on mytopic" babar celeste --user victor 421 $ hg commit -m "Works on mytopic" babar celeste --user victor
420 active topic 'mytopic' grew its first changeset 422 active topic 'mytopic' grew its first changeset
421 (see 'hg help topics' for more information) 423 (see 'hg help topics' for more information)
422 $ hg log -r . 424 $ hg log -r .
423 changeset: 18:cdda6d69812b 425 changeset: 18:4f0e158045aa
424 branch: double//slash 426 branch: double//slash
425 tag: tip 427 tag: tip
426 topic: mytopic 428 topic: mytopic
427 user: victor 429 user: victor
428 date: Thu Jan 01 00:00:00 1970 +0000 430 date: Thu Jan 01 00:00:00 1970 +0000
429 summary: Works on mytopic 431 summary: Works on mytopic
430 432
431 $ hg summary 433 $ hg summary
432 parent: 18:cdda6d69812b tip 434 parent: 18:4f0e158045aa tip
433 Works on mytopic 435 Works on mytopic
434 branch: double//slash//mytopic 436 branch: double//slash//mynamespace/mytopic
435 commit: (clean) 437 commit: (clean)
436 update: (current) 438 update: (current)
437 phases: 9 draft 439 phases: 9 draft
438 topic: mytopic 440 topic: mytopic
441
442 $ hg log -r . -T '{rev}: {fqbn}\n'
443 18: double//slash//mynamespace/mytopic
439 444
440 Split it 445 Split it
441 446
442 $ hg split -U << EOF 447 $ hg split -U << EOF
443 > Y 448 > Y
468 continue splitting? [Ycdq?] c 473 continue splitting? [Ycdq?] c
469 474
470 Check that the topic is still here 475 Check that the topic is still here
471 476
472 $ hg log -r "tip~1::" 477 $ hg log -r "tip~1::"
473 changeset: 19:a12d854b94a2 478 changeset: 19:d8d795e8424a
474 branch: double//slash 479 branch: double//slash
475 topic: mytopic 480 topic: mytopic
476 parent: 17:db45bd0f0e52 481 parent: 17:db45bd0f0e52
477 user: test 482 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000 483 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: split7 484 summary: split7
480 485
481 changeset: 20:98274aae3990 486 changeset: 20:d6d47657e765
482 branch: double//slash 487 branch: double//slash
483 tag: tip 488 tag: tip
484 topic: mytopic 489 topic: mytopic
485 user: test 490 user: test
486 date: Thu Jan 01 00:00:00 1970 +0000 491 date: Thu Jan 01 00:00:00 1970 +0000
487 summary: split8 492 summary: split8
488 493
489 $ hg topic 494 $ hg topic
490 * mytopic (2 changesets) 495 * mytopic (2 changesets)
491 496
497 $ hg log -r "tip~1::" -T '{rev}: {fqbn}\n'
498 19: double//slash//mynamespace/mytopic
499 20: double//slash//mynamespace/mytopic
500
492 Check commit extras 501 Check commit extras
493 502
494 $ hg log -r "tip~1::" -T '{rev}: {join(extras, " ")}\n' 503 $ hg log -r "tip~1::" -T '{rev}: {join(extras, " ")}\n'
495 19: branch=double//slash topic=mytopic 504 19: branch=double//slash topic=mytopic topic-namespace=mynamespace
496 20: branch=double//slash topic=mytopic 505 20: branch=double//slash topic=mytopic topic-namespace=mynamespace
497 506
498 Test split the first commit on a branch 507 Test split the first commit on a branch
499 508
500 $ touch SPLIT1 SPLIT2 509 $ touch SPLIT1 SPLIT2
501 $ hg add SPLIT1 SPLIT2 510 $ hg add SPLIT1 SPLIT2
502 $ hg branch another-branch 511 $ hg branch another-branch
503 marked working directory as branch another-branch 512 marked working directory as branch another-branch
504 $ hg commit -m "To be split" 513 $ hg commit -m "To be split"
505 $ hg log -G -l 3 514 $ hg log -G -l 3
506 @ changeset: 21:1b89fbf4d770 515 @ changeset: 21:94981e5d988e
507 | branch: another-branch 516 | branch: another-branch
508 | tag: tip 517 | tag: tip
509 | topic: mytopic 518 | topic: mytopic
510 | user: test 519 | user: test
511 | date: Thu Jan 01 00:00:00 1970 +0000 520 | date: Thu Jan 01 00:00:00 1970 +0000
512 | summary: To be split 521 | summary: To be split
513 | 522 |
514 o changeset: 20:98274aae3990 523 o changeset: 20:d6d47657e765
515 | branch: double//slash 524 | branch: double//slash
516 | topic: mytopic 525 | topic: mytopic
517 | user: test 526 | user: test
518 | date: Thu Jan 01 00:00:00 1970 +0000 527 | date: Thu Jan 01 00:00:00 1970 +0000
519 | summary: split8 528 | summary: split8
520 | 529 |
521 o changeset: 19:a12d854b94a2 530 o changeset: 19:d8d795e8424a
522 | branch: double//slash 531 | branch: double//slash
523 ~ topic: mytopic 532 ~ topic: mytopic
524 parent: 17:db45bd0f0e52 533 parent: 17:db45bd0f0e52
525 user: test 534 user: test
526 date: Thu Jan 01 00:00:00 1970 +0000 535 date: Thu Jan 01 00:00:00 1970 +0000
530 # HG changeset patch 539 # HG changeset patch
531 # User test 540 # User test
532 # Date 0 0 541 # Date 0 0
533 # Thu Jan 01 00:00:00 1970 +0000 542 # Thu Jan 01 00:00:00 1970 +0000
534 # Branch another-branch 543 # Branch another-branch
535 # Node ID 1b89fbf4d770c8fad85b73aada92425c00ad3a58 544 # Node ID 94981e5d988ea23cf2b17f6c07c39edc0f174b01
536 # Parent 98274aae39908fc11c1cf42c381935cfbe94695e 545 # Parent d6d47657e765570283ec03fc68836d9eb297c4b3
537 # EXP-Topic mytopic 546 # EXP-Topic mytopic
538 To be split 547 To be split
539 548
540 diff --git a/SPLIT1 b/SPLIT1 549 diff --git a/SPLIT1 b/SPLIT1
541 new file mode 100644 550 new file mode 100644
569 578
570 no more changes to split 579 no more changes to split
571 580
572 The split changesets should be on the 'another-branch' 581 The split changesets should be on the 'another-branch'
573 $ hg log -G -l 3 582 $ hg log -G -l 3
574 @ changeset: 23:492ea8acc08d 583 @ changeset: 23:61661257a937
575 | branch: another-branch 584 | branch: another-branch
576 | tag: tip 585 | tag: tip
577 | topic: mytopic 586 | topic: mytopic
578 | user: test 587 | user: test
579 | date: Thu Jan 01 00:00:00 1970 +0000 588 | date: Thu Jan 01 00:00:00 1970 +0000
580 | summary: split10 589 | summary: split10
581 | 590 |
582 o changeset: 22:35c3b7b7f830 591 o changeset: 22:a05395d0b421
583 | branch: another-branch 592 | branch: another-branch
584 | topic: mytopic 593 | topic: mytopic
585 | parent: 20:98274aae3990 594 | parent: 20:d6d47657e765
586 | user: test 595 | user: test
587 | date: Thu Jan 01 00:00:00 1970 +0000 596 | date: Thu Jan 01 00:00:00 1970 +0000
588 | summary: split9 597 | summary: split9
589 | 598 |
590 o changeset: 20:98274aae3990 599 o changeset: 20:d6d47657e765
591 | branch: double//slash 600 | branch: double//slash
592 ~ topic: mytopic 601 ~ topic: mytopic
593 user: test 602 user: test
594 date: Thu Jan 01 00:00:00 1970 +0000 603 date: Thu Jan 01 00:00:00 1970 +0000
595 summary: split8 604 summary: split8
605 614
606 $ hg up "tip~1" 615 $ hg up "tip~1"
607 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 616 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
608 617
609 $ hg log -G -l 2 618 $ hg log -G -l 2
610 o changeset: 24:5e7c5b766d1e 619 o changeset: 24:cffbaf700768
611 | branch: yet-another-branch 620 | branch: yet-another-branch
612 | tag: tip 621 | tag: tip
613 | topic: mytopic 622 | topic: mytopic
614 | user: test 623 | user: test
615 | date: Thu Jan 01 00:00:00 1970 +0000 624 | date: Thu Jan 01 00:00:00 1970 +0000
616 | summary: To be split again 625 | summary: To be split again
617 | 626 |
618 @ changeset: 23:492ea8acc08d 627 @ changeset: 23:61661257a937
619 | branch: another-branch 628 | branch: another-branch
620 ~ topic: mytopic 629 ~ topic: mytopic
621 user: test 630 user: test
622 date: Thu Jan 01 00:00:00 1970 +0000 631 date: Thu Jan 01 00:00:00 1970 +0000
623 summary: split10 632 summary: split10
647 656
648 $ hg branch 657 $ hg branch
649 another-branch 658 another-branch
650 659
651 $ hg log -G -l 2 660 $ hg log -G -l 2
652 o changeset: 24:5e7c5b766d1e 661 o changeset: 24:cffbaf700768
653 | branch: yet-another-branch 662 | branch: yet-another-branch
654 | tag: tip 663 | tag: tip
655 | topic: mytopic 664 | topic: mytopic
656 | user: test 665 | user: test
657 | date: Thu Jan 01 00:00:00 1970 +0000 666 | date: Thu Jan 01 00:00:00 1970 +0000
658 | summary: To be split again 667 | summary: To be split again
659 | 668 |
660 @ changeset: 23:492ea8acc08d 669 @ changeset: 23:61661257a937
661 | branch: another-branch 670 | branch: another-branch
662 ~ topic: mytopic 671 ~ topic: mytopic
663 user: test 672 user: test
664 date: Thu Jan 01 00:00:00 1970 +0000 673 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: split10 674 summary: split10
726 # HG changeset patch 735 # HG changeset patch
727 # User test 736 # User test
728 # Date 0 0 737 # Date 0 0
729 # Thu Jan 01 00:00:00 1970 +0000 738 # Thu Jan 01 00:00:00 1970 +0000
730 # Branch another-branch 739 # Branch another-branch
731 # Node ID 492ea8acc08dae0fce72cc459218dba9043e0481 740 # Node ID 61661257a93759374255a4c05fcd9b8a78bbe399
732 # Parent 35c3b7b7f83057a63307bb44ec59aebbba33c0f1 741 # Parent a05395d0b42120af8bfb222d19f01008b1342c15
733 # EXP-Topic mytopic 742 # EXP-Topic mytopic
734 split10 743 split10
735 744
736 diff --git a/SPLIT2 b/SPLIT2 745 diff --git a/SPLIT2 b/SPLIT2
737 new file mode 100644 746 new file mode 100644
742 # HG changeset patch 751 # HG changeset patch
743 # User test 752 # User test
744 # Date 0 0 753 # Date 0 0
745 # Thu Jan 01 00:00:00 1970 +0000 754 # Thu Jan 01 00:00:00 1970 +0000
746 # Branch another-branch 755 # Branch another-branch
747 # Node ID 1110f02dec0746d3b0493e7a09051816f7bc3179 756 # Node ID e6ca7ba1372dc452769c51a56d853c8ede26d9fa
748 # Parent 35c3b7b7f83057a63307bb44ec59aebbba33c0f1 757 # Parent a05395d0b42120af8bfb222d19f01008b1342c15
749 # EXP-Topic mytopic 758 # EXP-Topic mytopic
750 split10 759 split10
751 760
752 diff --git a/SPLIT2 b/SPLIT2 761 diff --git a/SPLIT2 b/SPLIT2
753 new file mode 100644 762 new file mode 100644
778 # HG changeset patch 787 # HG changeset patch
779 # User test 788 # User test
780 # Date 0 0 789 # Date 0 0
781 # Thu Jan 01 00:00:00 1970 +0000 790 # Thu Jan 01 00:00:00 1970 +0000
782 # Branch another-branch 791 # Branch another-branch
783 # Node ID 5aa51c542c1b03435a7b5b602a4953bbe3321511 792 # Node ID bb8f1c282ddf89515bd07bd63a84962ab51ac277
784 # Parent 35c3b7b7f83057a63307bb44ec59aebbba33c0f1 793 # Parent a05395d0b42120af8bfb222d19f01008b1342c15
785 # EXP-Topic mytopic 794 # EXP-Topic mytopic
786 split12 795 split12
787 796
788 diff --git a/SPLIT2 b/SPLIT2 797 diff --git a/SPLIT2 b/SPLIT2
789 new file mode 100644 798 new file mode 100644