Mercurial > evolve
comparison tests/test-topic.t @ 4074:eb4d07a0b19f mercurial-4.6
test-compat: merge stable into mercurial-4.6
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 03 Sep 2018 21:59:24 +0200 |
parents | 299748f72527 a93b74f745a6 |
children | dc247e648f43 e541acefbaa5 |
comparison
equal
deleted
inserted
replaced
4030:9871809aa348 | 4074:eb4d07a0b19f |
---|---|
38 | 38 |
39 The 'stack' will show you information about the stack of commit belonging to | 39 The 'stack' will show you information about the stack of commit belonging to |
40 your current topic. | 40 your current topic. |
41 | 41 |
42 Topic is offering you aliases reference to changeset in your current topic | 42 Topic is offering you aliases reference to changeset in your current topic |
43 stack as 't#'. For example, 't1' refers to the root of your stack, 't2' to the | 43 stack as 's#'. For example, 's1' refers to the root of your stack, 's2' to the |
44 second commits, etc. The 'hg stack' command show these number. | 44 second commits, etc. The 'hg stack' command show these number. 's0' can be |
45 used to refer to the parent of the topic root. Updating using 'hg up s0' will | |
46 keep the topic active. | |
45 | 47 |
46 Push behavior will change a bit with topic. When pushing to a publishing | 48 Push behavior will change a bit with topic. When pushing to a publishing |
47 repository the changesets will turn public and the topic data on them will | 49 repository the changesets will turn public and the topic data on them will |
48 fade away. The logic regarding pushing new heads will behave has before, | 50 fade away. The logic regarding pushing new heads will behave has before, |
49 ignore any topic related data. When pushing to a non-publishing repository | 51 ignore any topic related data. When pushing to a non-publishing repository |
269 * narf (on branch: default, 0 changesets) | 271 * narf (on branch: default, 0 changesets) |
270 $ hg stack | 272 $ hg stack |
271 ### topic: narf | 273 ### topic: narf |
272 ### target: default (branch) | 274 ### target: default (branch) |
273 (stack is empty) | 275 (stack is empty) |
274 t0^ Add file delta (base current) | 276 s0^ Add file delta (base current) |
275 | 277 |
276 Add commits to topic | 278 Add commits to topic |
277 | 279 |
278 $ echo topic work >> alpha | 280 $ echo topic work >> alpha |
279 $ hg ci -m 'start on narf' | 281 $ hg ci -m 'start on narf' |
693 user: test | 695 user: test |
694 date: Thu Jan 01 00:00:00 1970 +0000 | 696 date: Thu Jan 01 00:00:00 1970 +0000 |
695 summary: Add file alpha | 697 summary: Add file alpha |
696 | 698 |
697 No matches because narf is already closed: | 699 No matches because narf is already closed: |
698 $ hg log -r 'topic(narf)' -G | 700 $ hg log -r 'topic("narf")' -G |
699 This regexp should match the topic `fran`: | 701 This regexp should match the topic `fran`: |
700 $ hg log -r 'topic("re:.ra.")' -G | 702 $ hg log -r 'topic("re:.ra.")' -G |
701 o changeset: 9:0469d521db49 | 703 o changeset: 9:0469d521db49 |
702 | tag: tip | 704 | tag: tip |
703 | topic: fran | 705 | topic: fran |
733 user: test | 735 user: test |
734 date: Thu Jan 01 00:00:00 1970 +0000 | 736 date: Thu Jan 01 00:00:00 1970 +0000 |
735 summary: start on fran | 737 summary: start on fran |
736 | 738 |
737 | 739 |
740 Using revsets in topic() | |
741 $ tlog() { | |
742 > hg log -T '{rev}: {topic}\n' -r "$1" | |
743 > } | |
744 | |
745 $ tlog 'topic(9)' | |
746 9: fran | |
747 $ tlog 'topic(8)' | |
748 $ tlog 'topic(head())' | |
749 9: fran | |
750 $ tlog 'topic(:)' | |
751 9: fran | |
752 $ tlog 'topic(all())' | |
753 9: fran | |
754 $ tlog 'topic(topic(fran))' | |
755 9: fran | |
756 $ tlog 'topic(wdir())' | |
757 9: fran | |
758 $ tlog 'topic(nonsense)' | |
759 abort: unknown revision 'nonsense'! | |
760 [255] | |
761 | |
762 Pattern matching in topic() revset | |
763 $ tlog 'topic("re:nonsense")' | |
764 $ tlog 'topic("literal:nonsense")' | |
765 abort: topic 'nonsense' does not exist! | |
766 [255] | |
767 | |
738 Deactivate the topic. | 768 Deactivate the topic. |
739 $ hg topics | 769 $ hg topics |
740 * fran (1 changesets) | 770 * fran (1 changesets) |
741 $ hg topics --clear | 771 $ hg topics --clear |
772 $ hg log -r 'topic(wdir())' | |
742 $ echo fran? >> beta | 773 $ echo fran? >> beta |
743 $ hg ci -m 'fran?' | 774 $ hg ci -m 'fran?' |
744 created new head | 775 created new head |
745 (consider using topic for lightweight branches. See 'hg help topic') | 776 (consider using topic for lightweight branches. See 'hg help topic') |
746 $ hg log -Gr 'draft()' | 777 $ hg log -Gr 'draft()' |
759 | | 790 | |
760 | 791 |
761 $ hg topics | 792 $ hg topics |
762 fran (1 changesets) | 793 fran (1 changesets) |
763 | 794 |
764 Testing for updating to t0 | 795 Testing for updating to s0 |
765 ========================== | 796 ========================== |
766 | 797 |
767 $ hg up fran | 798 $ hg up fran |
768 switching to topic fran | 799 switching to topic fran |
769 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 800 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
770 $ hg stack | 801 $ hg stack |
771 ### topic: fran | 802 ### topic: fran |
772 ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads | 803 ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads |
773 t1@ start on fran (current) | 804 s1@ start on fran (current) |
774 t0^ Add file delta (base) | 805 s0^ Add file delta (base) |
775 | 806 |
776 $ hg up t0 | 807 $ hg up s0 |
777 preserving the current topic 'fran' | 808 preserving the current topic 'fran' |
778 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 809 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
779 | 810 |
780 $ hg topic | 811 $ hg topic |
781 * fran (1 changesets) | 812 * fran (1 changesets) |
782 $ hg stack | 813 $ hg stack |
783 ### topic: fran | 814 ### topic: fran |
784 ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads | 815 ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads |
785 t1: start on fran | 816 s1: start on fran |
786 t0^ Add file delta (base current) | 817 s0^ Add file delta (base current) |
787 | 818 |
788 $ hg topics --age | 819 $ hg topics --age |
789 * fran (1970-01-01 by test) | 820 * fran (1970-01-01 by test) |
790 | 821 |
791 $ cd .. | 822 $ cd .. |