1 ============== |
1 ============== |
2 Topic Tutorial |
2 Topic Tutorial |
3 ============== |
3 ============== |
4 |
4 |
5 .. This test file is also supposed to be able to compile as a rest file. |
5 This Mercurial configuration example is used for testing. |
6 |
6 |
7 |
7 .. Various setup |
8 .. Some Setup:: |
|
9 |
8 |
10 $ . "$TESTDIR/testlib/topic_setup.sh" |
9 $ . "$TESTDIR/testlib/topic_setup.sh" |
|
10 $ cat >> $HGRCPATH << EOF |
|
11 > [experimental] |
|
12 > evolution=all |
|
13 > [extensions] |
|
14 > evolve= |
|
15 > EOF |
|
16 |
11 $ hg init server |
17 $ hg init server |
|
18 |
12 $ cd server |
19 $ cd server |
|
20 |
13 $ cat >> .hg/hgrc << EOF |
21 $ cat >> .hg/hgrc << EOF |
14 > [ui] |
22 > [ui] |
15 > user= Shopping Master |
23 > user= Shopping Master |
16 > EOF |
24 > EOF |
|
25 |
17 $ cat >> shopping << EOF |
26 $ cat >> shopping << EOF |
18 > Spam |
27 > Spam |
19 > Whizzo butter |
28 > Whizzo butter |
20 > Albatross |
29 > Albatross |
21 > Rat (rather a lot) |
30 > Rat (rather a lot) |
22 > Jugged fish |
31 > Jugged fish |
23 > Blancmange |
32 > Blancmange |
24 > Salmon mousse |
33 > Salmon mousse |
25 > EOF |
34 > EOF |
|
35 |
26 $ hg commit -A -m "Shopping list" |
36 $ hg commit -A -m "Shopping list" |
27 adding shopping |
37 adding shopping |
|
38 |
28 $ cd .. |
39 $ cd .. |
29 $ hg clone server client |
40 $ hg clone server client |
30 updating to branch default |
41 updating to branch default |
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
32 $ cd client |
43 $ cd client |
33 $ cat >> .hg/hgrc << EOF |
44 $ cat >> .hg/hgrc << EOF |
34 > [ui] |
45 > [ui] |
35 > user= Tutorial User |
46 > user= Tutorial User |
36 > EOF |
47 > EOF |
|
48 #if docgraph-ext |
|
49 $ . "$TESTDIR/testlib/docgraph_setup.sh" #rest-ignore |
|
50 #endif |
37 |
51 |
38 Topic branches are lightweight branches which disappear when changes are |
52 Topic branches are lightweight branches which disappear when changes are |
39 finalized (move to the public phase). They can help users to organise and share |
53 finalized (moved to the public phase). They can help users to organize and share |
40 their unfinished work. |
54 their unfinished work. |
|
55 |
|
56 In this tutorial, we explain how to use topics for local development. In the first part, |
|
57 there is a central *publishing* server. Anything pushed to the central server will become public and immutable This means no unfinished work should escapes the local repository. |
|
58 |
41 |
59 |
42 Topic Basics |
60 Topic Basics |
43 ============ |
61 ============ |
44 |
62 |
45 Let's say we use Mercurial to manage our shopping list:: |
63 Let's say we use Mercurial to manage our shopping list: |
46 |
64 |
47 $ hg log --graph |
65 $ hg log --graph |
48 @ changeset: 0:38da43f0a2ea |
66 @ changeset: 0:38da43f0a2ea |
49 tag: tip |
67 tag: tip |
50 user: test |
68 user: test |
51 date: Thu Jan 01 00:00:00 1970 +0000 |
69 date: Thu Jan 01 00:00:00 1970 +0000 |
52 summary: Shopping list |
70 summary: Shopping list |
53 |
71 |
|
72 #if docgraph-ext |
|
73 $ hg docgraph -r "all()" --sphinx-directive --rankdir LR #rest-ignore |
|
74 .. graphviz:: |
|
75 |
|
76 strict digraph { |
|
77 graph [rankdir=LR, |
|
78 splines=polyline |
|
79 ]; |
|
80 node [label="\N"]; |
|
81 0 [fillcolor="#9999FF", |
|
82 fixedsize=true, |
|
83 group=default, |
|
84 height=0.5, |
|
85 label=0, |
|
86 pin=true, |
|
87 pos="1,0!", |
|
88 shape=circle, |
|
89 style=filled, |
|
90 width=0.5]; |
|
91 } |
|
92 #endif |
54 |
93 |
55 We are about to make some additions to this list and would like to do them |
94 We are about to make some additions to this list and would like to do them |
56 within a topic. Creating a new topic is done using the ``topic`` command:: |
95 within a topic. Creating a new topic is done using the ``topic`` command: |
57 |
96 |
58 $ hg topic food |
97 $ hg topics food |
|
98 marked working directory as topic: food |
59 |
99 |
60 Much like a named branch, our topic is active but it does not contain any |
100 Much like a named branch, our topic is active but it does not contain any |
61 changesets yet:: |
101 changeset yet: |
62 |
102 |
63 $ hg topic |
103 $ hg topics |
64 * food |
104 * food |
|
105 |
65 $ hg summary |
106 $ hg summary |
66 parent: 0:38da43f0a2ea tip |
107 parent: 0:38da43f0a2ea tip |
67 Shopping list |
108 Shopping list |
68 branch: default |
109 branch: default |
69 commit: (clean) |
110 commit: (clean) |
70 update: (current) |
111 update: (current) |
71 topic: food |
112 topic: food |
|
113 |
72 $ hg log --graph |
114 $ hg log --graph |
73 @ changeset: 0:38da43f0a2ea |
115 @ changeset: 0:38da43f0a2ea |
74 tag: tip |
116 tag: tip |
75 user: test |
117 user: test |
76 date: Thu Jan 01 00:00:00 1970 +0000 |
118 date: Thu Jan 01 00:00:00 1970 +0000 |
77 summary: Shopping list |
119 summary: Shopping list |
78 |
120 |
79 |
121 |
80 Our next commit will be part of the active topic:: |
122 #if docgraph-ext |
|
123 $ hg docgraph -r "all()" --sphinx-directive --rankdir LR #rest-ignore |
|
124 .. graphviz:: |
|
125 |
|
126 strict digraph { |
|
127 graph [rankdir=LR, |
|
128 splines=polyline |
|
129 ]; |
|
130 node [label="\N"]; |
|
131 0 [fillcolor="#9999FF", |
|
132 fixedsize=true, |
|
133 group=default, |
|
134 height=0.5, |
|
135 label=0, |
|
136 pin=true, |
|
137 pos="1,0!", |
|
138 shape=circle, |
|
139 style=filled, |
|
140 width=0.5]; |
|
141 } |
|
142 #endif |
|
143 |
|
144 Our next commit will be part of the active topic: |
81 |
145 |
82 $ cat >> shopping << EOF |
146 $ cat >> shopping << EOF |
83 > Egg |
147 > Egg |
84 > Suggar |
148 > Suggar |
85 > Vinegar |
149 > Vinegar |
86 > Oil |
150 > Oil |
87 > EOF |
151 > EOF |
|
152 |
88 $ hg commit -m "adding condiments" |
153 $ hg commit -m "adding condiments" |
|
154 active topic 'food' grew its first changeset |
|
155 |
89 $ hg log --graph --rev 'topic("food")' |
156 $ hg log --graph --rev 'topic("food")' |
90 @ changeset: 1:13900241408b |
157 @ changeset: 1:13900241408b |
91 | tag: tip |
158 | tag: tip |
92 ~ topic: food |
159 ~ topic: food |
93 user: test |
160 user: test |
94 date: Thu Jan 01 00:00:00 1970 +0000 |
161 date: Thu Jan 01 00:00:00 1970 +0000 |
95 summary: adding condiments |
162 summary: adding condiments |
96 |
163 |
97 |
164 |
98 And future commits will be part of that topic too:: |
165 #if docgraph-ext |
|
166 $ hg docgraph -r "topic("food")" --sphinx-directive --rankdir LR #rest-ignore |
|
167 .. graphviz:: |
|
168 |
|
169 strict digraph { |
|
170 graph [rankdir=LR, |
|
171 splines=polyline |
|
172 ]; |
|
173 node [label="\N"]; |
|
174 1 [fillcolor="#9999FF", |
|
175 fixedsize=true, |
|
176 group=default, |
|
177 height=0.5, |
|
178 label=1, |
|
179 pin=true, |
|
180 pos="1,1!", |
|
181 shape=pentagon, |
|
182 style=filled, |
|
183 width=0.5]; |
|
184 } |
|
185 #endif |
|
186 |
|
187 And future commits will be part of that topic too: |
99 |
188 |
100 $ cat >> shopping << EOF |
189 $ cat >> shopping << EOF |
101 > Bananas |
190 > Bananas |
102 > Pear |
191 > Pear |
103 > Apple |
192 > Apple |
104 > EOF |
193 > EOF |
|
194 |
105 $ hg commit -m "adding fruits" |
195 $ hg commit -m "adding fruits" |
|
196 |
106 $ hg log --graph --rev 'topic("food")' |
197 $ hg log --graph --rev 'topic("food")' |
107 @ changeset: 2:287de11b401f |
198 @ changeset: 2:287de11b401f |
108 | tag: tip |
199 | tag: tip |
109 | topic: food |
200 | topic: food |
110 | user: test |
201 | user: test |
313 o changeset: 0:38da43f0a2ea |
620 o changeset: 0:38da43f0a2ea |
314 user: test |
621 user: test |
315 date: Thu Jan 01 00:00:00 1970 +0000 |
622 date: Thu Jan 01 00:00:00 1970 +0000 |
316 summary: Shopping list |
623 summary: Shopping list |
317 |
624 |
318 $ hg up default |
625 #if docgraph-ext |
|
626 $ hg docgraph -r "all()" --sphinx-directive --rankdir LR #rest-ignore |
|
627 .. graphviz:: |
|
628 |
|
629 strict digraph { |
|
630 graph [rankdir=LR, |
|
631 splines=polyline |
|
632 ]; |
|
633 node [label="\N"]; |
|
634 0 [fillcolor="#9999FF", |
|
635 fixedsize=true, |
|
636 group=default, |
|
637 height=0.5, |
|
638 label=0, |
|
639 pin=true, |
|
640 pos="1,0!", |
|
641 shape=circle, |
|
642 style=filled, |
|
643 width=0.5]; |
|
644 3 [fillcolor="#9999FF", |
|
645 fixedsize=true, |
|
646 group=default, |
|
647 height=0.5, |
|
648 label=3, |
|
649 pin=true, |
|
650 pos="1,3!", |
|
651 shape=circle, |
|
652 style=filled, |
|
653 width=0.5]; |
|
654 0 -> 3 [arrowhead=none, |
|
655 penwidth=2.0]; |
|
656 4 [fillcolor="#9999FF", |
|
657 fixedsize=true, |
|
658 group=default, |
|
659 height=0.5, |
|
660 label=4, |
|
661 pin=true, |
|
662 pos="1,4!", |
|
663 shape=circle, |
|
664 style=filled, |
|
665 width=0.5]; |
|
666 3 -> 4 [arrowhead=none, |
|
667 penwidth=2.0]; |
|
668 5 [fillcolor="#9999FF", |
|
669 fixedsize=true, |
|
670 group=default, |
|
671 height=0.5, |
|
672 label=5, |
|
673 pin=true, |
|
674 pos="1,5!", |
|
675 shape=circle, |
|
676 style=filled, |
|
677 width=0.5]; |
|
678 4 -> 5 [arrowhead=none, |
|
679 penwidth=2.0]; |
|
680 } |
|
681 #endif |
|
682 |
|
683 If we update to the *default* head, we will leave the topic behind, |
|
684 and since it is commit-less, it will vanish. |
|
685 |
|
686 $ hg update default |
|
687 clearing empty topic "food" |
319 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
688 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
689 |
|
690 From there, the topic has been completely forgotten. |
|
691 |
|
692 $ hg topics |
|
693 |
|
694 |
|
695 Keep working within topics |
|
696 ========================== |
|
697 |
|
698 Making sure all your new local commit are made within a topic will help your |
|
699 organise your work. It is possible to ensure this through the Mercurial |
|
700 configuration. |
|
701 |
|
702 For this tutorial, we'll add the config at the repository level: |
|
703 |
|
704 $ cat << EOF >> .hg/hgrc |
|
705 > [experimental] |
|
706 > enforce-topic = yes |
|
707 > EOF |
|
708 |
|
709 You can also use `hg config --edit` to update your mercurial configuration. |
|
710 |
|
711 |
|
712 Once enforcement is turned on. New local commit will be denied if no topic is active. |
|
713 |
|
714 $ echo sickle >> shopping |
|
715 $ hg commit -m 'Adding sickle' |
|
716 abort: no active topic |
|
717 (set a current topic or use '--config experimental.enforce-topic=no' to commit without a topic) |
|
718 [255] |
|
719 |
|
720 Ok, let's clean this up and delve into multiple topics. |
|
721 |
|
722 $ hg revert . |
|
723 reverting shopping |
|
724 |
320 |
725 |
321 Working with Multiple Topics |
726 Working with Multiple Topics |
322 ============================ |
727 ============================ |
323 |
728 |
324 In the above example, topics do not bring much benefit since you only have one |
729 In the above example, topics do not bring much benefits since you only have one |
325 line of development. Topics start to be more useful when you have to work on |
730 line of development. Topics start to be more useful when you have to work on |
326 multiple features at the same time. |
731 multiple features at the same time. |
327 |
732 |
328 We might go shopping in a hardware store in the same go, so let's add some |
733 We might go shopping in a hardware store in the same go, so let's add some |
329 tools to the shopping list within a new topic:: |
734 tools to the shopping list within a new topic: |
330 |
735 |
331 $ hg topic tools |
736 $ hg topics tools |
|
737 marked working directory as topic: tools |
332 $ echo hammer >> shopping |
738 $ echo hammer >> shopping |
333 $ hg ci -m 'Adding hammer' |
739 $ hg commit -m 'Adding hammer' |
|
740 active topic 'tools' grew its first changeset |
|
741 |
334 $ echo saw >> shopping |
742 $ echo saw >> shopping |
335 $ hg ci -m 'Adding saw' |
743 $ hg commit -m 'Adding saw' |
|
744 |
336 $ echo drill >> shopping |
745 $ echo drill >> shopping |
337 $ hg ci -m 'Adding drill' |
746 $ hg commit -m 'Adding drill' |
338 |
747 |
339 But we are not sure we will actually go to the hardware store, so in the |
748 But we are not sure we will actually go to the hardware store, so in the |
340 meantime, we want to extend the list with drinks. We go back to the official |
749 meantime, we want to extend the list with drinks. We go back to the official |
341 default branch and start a new topic:: |
750 default branch and start a new topic: |
342 |
751 |
343 $ hg up default |
752 $ hg update default |
344 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
753 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
345 $ hg topic drinks |
754 |
|
755 $ hg topics drinks |
|
756 marked working directory as topic: drinks |
346 $ echo 'apple juice' >> shopping |
757 $ echo 'apple juice' >> shopping |
347 $ hg ci -m 'Adding apple juice' |
758 $ hg commit -m 'Adding apple juice' |
|
759 active topic 'drinks' grew its first changeset |
|
760 |
348 $ echo 'orange juice' >> shopping |
761 $ echo 'orange juice' >> shopping |
349 $ hg ci -m 'Adding orange juice' |
762 $ hg commit -m 'Adding orange juice' |
350 |
763 |
351 We now have two topics:: |
764 We now have two topics: |
352 |
765 |
353 $ hg topic |
766 $ hg topics |
354 * drinks |
767 * drinks |
355 tools |
768 tools |
356 |
769 |
357 The information displayed by ``hg stack`` adapts to the active topic:: |
770 The information displayed by ``hg stack`` adapts to the active topic: |
358 |
771 |
359 $ hg stack |
772 $ hg stack |
360 ### topic: drinks |
773 ### topic: drinks |
361 ### branch: default |
774 ### target: default (branch) |
362 t2@ Adding orange juice (current) |
775 t2@ Adding orange juice (current) |
363 t1: Adding apple juice |
776 t1: Adding apple juice |
364 t0^ adding fruits (base) |
777 t0^ adding fruits (base) |
365 $ hg up tools |
778 |
|
779 $ hg update tools |
366 switching to topic tools |
780 switching to topic tools |
367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
781 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
782 |
368 $ hg stack |
783 $ hg stack |
369 ### topic: tools |
784 ### topic: tools |
370 ### branch: default |
785 ### target: default (branch) |
371 t3@ Adding drill (current) |
786 t3@ Adding drill (current) |
372 t2: Adding saw |
787 t2: Adding saw |
373 t1: Adding hammer |
788 t1: Adding hammer |
374 t0^ adding fruits (base) |
789 t0^ adding fruits (base) |
375 |
790 |
376 They are seen as independent branches by Mercurial. No rebase or merge |
791 They are seen as independent branches by Mercurial. No rebase or merge |
377 between them will be attempted by default:: |
792 between them will be attempted by default: |
378 |
793 |
379 $ hg rebase |
794 $ hg rebase |
380 nothing to rebase |
795 nothing to rebase |
381 [1] |
796 [1] |
382 |
797 |
383 .. server activity:: |
798 We simulate independant contributions to the repo with this |
|
799 activity: |
384 |
800 |
385 $ cd ../server |
801 $ cd ../server |
386 $ hg up |
802 $ hg update |
387 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
803 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
388 $ mv shopping foo |
804 $ mv shopping foo |
389 $ echo 'Coat' > shopping |
805 $ echo 'Coat' > shopping |
390 $ cat foo >> shopping |
806 $ cat foo >> shopping |
391 $ hg ci -m 'add a coat' |
807 $ hg commit -m 'add a coat' |
392 $ echo 'Coat' > shopping |
808 $ echo 'Coat' > shopping |
393 $ echo 'Shoes' >> shopping |
809 $ echo 'Shoes' >> shopping |
394 $ cat foo >> shopping |
810 $ cat foo >> shopping |
395 $ rm foo |
811 $ rm foo |
396 $ hg ci -m 'add a pair of shoes' |
812 $ hg commit -m 'add a pair of shoes' |
397 $ cd ../client |
813 $ cd ../client |
398 |
814 |
399 Let's see what other people did in the meantime:: |
815 Let's discover what other people did contribute: |
400 |
816 |
401 $ hg pull |
817 $ hg pull |
402 pulling from $TESTTMP/server (glob) |
818 pulling from $TESTTMP/server (glob) |
403 searching for changes |
819 searching for changes |
404 adding changesets |
820 adding changesets |
406 adding file changes |
822 adding file changes |
407 added 2 changesets with 2 changes to 1 files (+1 heads) |
823 added 2 changesets with 2 changes to 1 files (+1 heads) |
408 (run 'hg heads' to see heads) |
824 (run 'hg heads' to see heads) |
409 |
825 |
410 There are new changes! We can simply use ``hg rebase`` to update our |
826 There are new changes! We can simply use ``hg rebase`` to update our |
411 changeset on top of the latest:: |
827 changeset on top of the latest: |
|
828 |
|
829 $ hg log -G |
|
830 o changeset: 12:fbff9bc37a43 |
|
831 | tag: tip |
|
832 | user: test |
|
833 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
834 | summary: add a pair of shoes |
|
835 | |
|
836 o changeset: 11:f2d6cacc6115 |
|
837 | parent: 5:2d50db8b5b4c |
|
838 | user: test |
|
839 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
840 | summary: add a coat |
|
841 | |
|
842 | o changeset: 10:70dfa201ed73 |
|
843 | | topic: drinks |
|
844 | | user: test |
|
845 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
846 | | summary: Adding orange juice |
|
847 | | |
|
848 | o changeset: 9:8dfa45bd5e0c |
|
849 |/ topic: drinks |
|
850 | parent: 5:2d50db8b5b4c |
|
851 | user: test |
|
852 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
853 | summary: Adding apple juice |
|
854 | |
|
855 | @ changeset: 8:34255b455dac |
|
856 | | topic: tools |
|
857 | | user: test |
|
858 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
859 | | summary: Adding drill |
|
860 | | |
|
861 | o changeset: 7:cffff85af537 |
|
862 | | topic: tools |
|
863 | | user: test |
|
864 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
865 | | summary: Adding saw |
|
866 | | |
|
867 | o changeset: 6:183984ef46d1 |
|
868 |/ topic: tools |
|
869 | user: test |
|
870 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
871 | summary: Adding hammer |
|
872 | |
|
873 o changeset: 5:2d50db8b5b4c |
|
874 | user: test |
|
875 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
876 | summary: adding fruits |
|
877 | |
|
878 o changeset: 4:4011b46eeb33 |
|
879 | user: test |
|
880 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
881 | summary: adding condiments |
|
882 | |
|
883 o changeset: 3:6104862e8b84 |
|
884 | parent: 0:38da43f0a2ea |
|
885 | user: test |
|
886 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
887 | summary: Adding clothes |
|
888 | |
|
889 o changeset: 0:38da43f0a2ea |
|
890 user: test |
|
891 date: Thu Jan 01 00:00:00 1970 +0000 |
|
892 summary: Shopping list |
|
893 |
|
894 #if docgraph-ext |
|
895 $ hg docgraph -r "all()" --sphinx-directive --rankdir LR #rest-ignore |
|
896 .. graphviz:: |
|
897 |
|
898 strict digraph { |
|
899 graph [rankdir=LR, |
|
900 splines=polyline |
|
901 ]; |
|
902 node [label="\N"]; |
|
903 0 [fillcolor="#9999FF", |
|
904 fixedsize=true, |
|
905 group=default, |
|
906 height=0.5, |
|
907 label=0, |
|
908 pin=true, |
|
909 pos="1,0!", |
|
910 shape=circle, |
|
911 style=filled, |
|
912 width=0.5]; |
|
913 3 [fillcolor="#9999FF", |
|
914 fixedsize=true, |
|
915 group=default, |
|
916 height=0.5, |
|
917 label=3, |
|
918 pin=true, |
|
919 pos="1,3!", |
|
920 shape=circle, |
|
921 style=filled, |
|
922 width=0.5]; |
|
923 0 -> 3 [arrowhead=none, |
|
924 penwidth=2.0]; |
|
925 4 [fillcolor="#9999FF", |
|
926 fixedsize=true, |
|
927 group=default, |
|
928 height=0.5, |
|
929 label=4, |
|
930 pin=true, |
|
931 pos="1,4!", |
|
932 shape=circle, |
|
933 style=filled, |
|
934 width=0.5]; |
|
935 3 -> 4 [arrowhead=none, |
|
936 penwidth=2.0]; |
|
937 5 [fillcolor="#9999FF", |
|
938 fixedsize=true, |
|
939 group=default, |
|
940 height=0.5, |
|
941 label=5, |
|
942 pin=true, |
|
943 pos="1,5!", |
|
944 shape=circle, |
|
945 style=filled, |
|
946 width=0.5]; |
|
947 4 -> 5 [arrowhead=none, |
|
948 penwidth=2.0]; |
|
949 6 [fillcolor="#9999FF", |
|
950 fixedsize=true, |
|
951 group=default, |
|
952 height=0.5, |
|
953 label=6, |
|
954 pin=true, |
|
955 pos="1,6!", |
|
956 shape=pentagon, |
|
957 style=filled, |
|
958 width=0.5]; |
|
959 5 -> 6 [arrowhead=none, |
|
960 penwidth=2.0]; |
|
961 9 [fillcolor="#9999FF", |
|
962 fixedsize=true, |
|
963 group=default, |
|
964 height=0.5, |
|
965 label=9, |
|
966 pin=true, |
|
967 pos="1,9!", |
|
968 shape=pentagon, |
|
969 style=filled, |
|
970 width=0.5]; |
|
971 5 -> 9 [arrowhead=none, |
|
972 penwidth=2.0]; |
|
973 11 [fillcolor="#9999FF", |
|
974 fixedsize=true, |
|
975 group=default, |
|
976 height=0.5, |
|
977 label=11, |
|
978 pin=true, |
|
979 pos="1,11!", |
|
980 shape=circle, |
|
981 style=filled, |
|
982 width=0.5]; |
|
983 5 -> 11 [arrowhead=none, |
|
984 penwidth=2.0]; |
|
985 7 [fillcolor="#9999FF", |
|
986 fixedsize=true, |
|
987 group=default, |
|
988 height=0.5, |
|
989 label=7, |
|
990 pin=true, |
|
991 pos="1,7!", |
|
992 shape=pentagon, |
|
993 style=filled, |
|
994 width=0.5]; |
|
995 6 -> 7 [arrowhead=none, |
|
996 penwidth=2.0]; |
|
997 8 [fillcolor="#9999FF", |
|
998 fixedsize=true, |
|
999 group=default, |
|
1000 height=0.5, |
|
1001 label=8, |
|
1002 pin=true, |
|
1003 pos="1,8!", |
|
1004 shape=pentagon, |
|
1005 style=filled, |
|
1006 width=0.5]; |
|
1007 7 -> 8 [arrowhead=none, |
|
1008 penwidth=2.0]; |
|
1009 10 [fillcolor="#9999FF", |
|
1010 fixedsize=true, |
|
1011 group=default, |
|
1012 height=0.5, |
|
1013 label=10, |
|
1014 pin=true, |
|
1015 pos="1,10!", |
|
1016 shape=pentagon, |
|
1017 style=filled, |
|
1018 width=0.5]; |
|
1019 9 -> 10 [arrowhead=none, |
|
1020 penwidth=2.0]; |
|
1021 12 [fillcolor="#9999FF", |
|
1022 fixedsize=true, |
|
1023 group=default, |
|
1024 height=0.5, |
|
1025 label=12, |
|
1026 pin=true, |
|
1027 pos="1,12!", |
|
1028 shape=circle, |
|
1029 style=filled, |
|
1030 width=0.5]; |
|
1031 11 -> 12 [arrowhead=none, |
|
1032 penwidth=2.0]; |
|
1033 } |
|
1034 #endif |
412 |
1035 |
413 $ hg rebase |
1036 $ hg rebase |
414 rebasing 6:183984ef46d1 "Adding hammer" |
1037 rebasing 6:183984ef46d1 "Adding hammer" |
415 merging shopping |
1038 merging shopping |
416 switching to topic tools |
1039 switching to topic tools |
417 rebasing 7:cffff85af537 "Adding saw" |
1040 rebasing 7:cffff85af537 "Adding saw" |
418 merging shopping |
1041 merging shopping |
419 rebasing 8:34255b455dac "Adding drill" |
1042 rebasing 8:34255b455dac "Adding drill" |
420 merging shopping |
1043 merging shopping |
421 |
1044 |
422 But what about the other topic? You can use 'hg topic --verbose' to see |
1045 But what about the other topic? You can use 'hg topics --verbose' to see |
423 information about all the topics:: |
1046 information about all the topics: |
424 |
1047 |
425 $ hg topic --verbose |
1048 $ hg topics --verbose |
426 drinks (on branch: default, 2 changesets, 2 behind) |
1049 drinks (on branch: default, 2 changesets, 2 behind) |
427 * tools (on branch: default, 3 changesets) |
1050 * tools (on branch: default, 3 changesets) |
428 |
1051 |
429 The "2 behind" is telling you that there are 2 new changesets on the named |
1052 The "2 behind" is telling you that there are 2 new changesets over the base of the topic. |
430 branch of the topic. You need to merge or rebase to incorporate them. |
1053 |
431 |
1054 Pushing that topic would create a new head, and therefore will be prevented: |
432 Pushing that topic would create a new head, and therefore will be prevented:: |
|
433 |
1055 |
434 $ hg push --rev drinks |
1056 $ hg push --rev drinks |
435 pushing to $TESTTMP/server (glob) |
1057 pushing to $TESTTMP/server (glob) |
436 searching for changes |
1058 searching for changes |
437 abort: push creates new remote head 70dfa201ed73! |
1059 abort: push creates new remote head 70dfa201ed73! |
438 (merge or see 'hg help push' for details about pushing new heads) |
1060 (merge or see 'hg help push' for details about pushing new heads) |
439 [255] |
1061 [255] |
440 |
1062 |
441 |
1063 |
442 Even after a rebase, pushing all active topics at the same time will complain |
1064 Even after a rebase, pushing all active topics at the same time would publish |
443 about the multiple heads it would create on that branch:: |
1065 them to the default branch, and then mercurial would complain about the |
|
1066 multiple *public* heads it would create on that branch: |
444 |
1067 |
445 $ hg rebase -b drinks |
1068 $ hg rebase -b drinks |
446 rebasing 9:8dfa45bd5e0c "Adding apple juice" |
1069 rebasing 9:8dfa45bd5e0c "Adding apple juice" |
447 merging shopping |
1070 merging shopping |
448 switching to topic drinks |
1071 switching to topic drinks |
449 rebasing 10:70dfa201ed73 "Adding orange juice" |
1072 rebasing 10:70dfa201ed73 "Adding orange juice" |
450 merging shopping |
1073 merging shopping |
451 switching to topic tools |
1074 switching to topic tools |
|
1075 |
452 $ hg push |
1076 $ hg push |
453 pushing to $TESTTMP/server (glob) |
1077 pushing to $TESTTMP/server (glob) |
454 searching for changes |
1078 searching for changes |
455 abort: push creates new remote head 4cd7c1591a67! |
1079 abort: push creates new remote head 4cd7c1591a67! |
456 (merge or see 'hg help push' for details about pushing new heads) |
1080 (merge or see 'hg help push' for details about pushing new heads) |
457 [255] |
1081 [255] |
458 |
1082 |
459 Publishing only one of them is allowed (as long as it does not create a new |
1083 Publishing only one of them is allowed (as long as it does not create a new |
460 branch head as we just saw in the previous case):: |
1084 branch head as we just saw in the previous case): |
461 |
1085 |
462 $ hg push -r drinks |
1086 $ hg push -r drinks |
463 pushing to $TESTTMP/server (glob) |
1087 pushing to $TESTTMP/server (glob) |
464 searching for changes |
1088 searching for changes |
465 adding changesets |
1089 adding changesets |
467 adding file changes |
1091 adding file changes |
468 added 2 changesets with 2 changes to 1 files |
1092 added 2 changesets with 2 changes to 1 files |
469 2 new obsolescence markers |
1093 2 new obsolescence markers |
470 |
1094 |
471 The published topic has now disappeared, and the other is now marked as |
1095 The published topic has now disappeared, and the other is now marked as |
472 "behind":: |
1096 "behind": |
473 |
1097 |
474 $ hg topic --verbose |
1098 $ hg topics --verbose |
475 * tools (on branch: default, 3 changesets, 2 behind) |
1099 * tools (on branch: default, 3 changesets, 2 behind) |
|
1100 |
476 $ hg stack |
1101 $ hg stack |
477 ### topic: tools |
1102 ### topic: tools |
478 ### branch: default, 2 behind |
1103 ### target: default (branch), 2 behind |
479 t3@ Adding drill (current) |
1104 t3@ Adding drill (current) |
480 t2: Adding saw |
1105 t2: Adding saw |
481 t1: Adding hammer |
1106 t1: Adding hammer |
482 t0^ add a pair of shoes (base) |
1107 t0^ add a pair of shoes (base) |
483 |
1108 |
|
1109 Working Within Your Stack |
|
1110 =========================== |
|
1111 |
|
1112 Navigating within your stack |
|
1113 ---------------------------- |
|
1114 |
|
1115 As we saw before `stack` displays changesets on your current topic in a clean way: |
|
1116 |
|
1117 $ hg topics --verbose |
|
1118 * tools (on branch: default, 3 changesets, 2 behind) |
|
1119 |
|
1120 $ hg stack |
|
1121 ### topic: tools |
|
1122 ### target: default (branch), 2 behind |
|
1123 t3@ Adding drill (current) |
|
1124 t2: Adding saw |
|
1125 t1: Adding hammer |
|
1126 t0^ add a pair of shoes (base) |
|
1127 |
|
1128 You can navigate in your current stack with `previous` and `next`. |
|
1129 |
|
1130 `previous` will bring you back to the parent of the topic head. |
|
1131 |
|
1132 $ hg previous |
|
1133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1134 [14] Adding saw |
|
1135 |
|
1136 $ hg stack |
|
1137 ### topic: tools |
|
1138 ### target: default (branch), 2 behind |
|
1139 t3: Adding drill |
|
1140 t2@ Adding saw (current) |
|
1141 t1: Adding hammer |
|
1142 t0^ add a pair of shoes (base) |
|
1143 |
|
1144 `next` will move you forward to the topic head. |
|
1145 |
|
1146 $ hg next |
|
1147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1148 [15] Adding drill |
|
1149 |
|
1150 $ hg stack |
|
1151 ### topic: tools |
|
1152 ### target: default (branch), 2 behind |
|
1153 t3@ Adding drill (current) |
|
1154 t2: Adding saw |
|
1155 t1: Adding hammer |
|
1156 t0^ add a pair of shoes (base) |
|
1157 |
|
1158 You can also directly jump to a changeset within your stack with the revset `t#`. |
|
1159 |
|
1160 $ hg update t1 |
|
1161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1162 |
|
1163 $ hg stack |
|
1164 ### topic: tools |
|
1165 ### target: default (branch), 2 behind |
|
1166 t3: Adding drill |
|
1167 t2: Adding saw |
|
1168 t1@ Adding hammer (current) |
|
1169 t0^ add a pair of shoes (base) |
|
1170 |
|
1171 Editing your work mid-stack |
|
1172 --------------------------- |
|
1173 |
|
1174 It's easy to edit your work inside your stack: |
|
1175 |
|
1176 $ hg stack |
|
1177 ### topic: tools |
|
1178 ### target: default (branch), 2 behind |
|
1179 t3: Adding drill |
|
1180 t2: Adding saw |
|
1181 t1@ Adding hammer (current) |
|
1182 t0^ add a pair of shoes (base) |
|
1183 |
|
1184 $ hg amend -m "Adding hammer to the shopping list" |
|
1185 2 new unstable changesets |
|
1186 |
|
1187 Understanding the current situation with hg log is not so easy, because |
|
1188 it shows too many things: |
|
1189 |
|
1190 $ hg log -G -r "t0::" |
|
1191 @ changeset: 18:b7509bd417f8 |
|
1192 | tag: tip |
|
1193 | topic: tools |
|
1194 | parent: 12:fbff9bc37a43 |
|
1195 | user: test |
|
1196 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1197 | summary: Adding hammer to the shopping list |
|
1198 | |
|
1199 | o changeset: 17:4cd7c1591a67 |
|
1200 | | user: test |
|
1201 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1202 | | summary: Adding orange juice |
|
1203 | | |
|
1204 | o changeset: 16:20759cb47ff8 |
|
1205 |/ parent: 12:fbff9bc37a43 |
|
1206 | user: test |
|
1207 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1208 | summary: Adding apple juice |
|
1209 | |
|
1210 | o changeset: 15:bb1e6254f532 |
|
1211 | | topic: tools |
|
1212 | | user: test |
|
1213 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1214 | | summary: Adding drill |
|
1215 | | |
|
1216 | o changeset: 14:d4f97f32f8a1 |
|
1217 | | topic: tools |
|
1218 | | user: test |
|
1219 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1220 | | summary: Adding saw |
|
1221 | | |
|
1222 | x changeset: 13:a8ab3599d53d |
|
1223 |/ topic: tools |
|
1224 | user: test |
|
1225 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1226 | summary: Adding hammer |
|
1227 | |
|
1228 o changeset: 12:fbff9bc37a43 |
|
1229 | user: test |
|
1230 ~ date: Thu Jan 01 00:00:00 1970 +0000 |
|
1231 summary: add a pair of shoes |
|
1232 |
|
1233 |
|
1234 #if docgraph-ext |
|
1235 $ hg docgraph -r "t0::" --sphinx-directive --rankdir LR #rest-ignore |
|
1236 .. graphviz:: |
|
1237 |
|
1238 strict digraph { |
|
1239 graph [rankdir=LR, |
|
1240 splines=polyline |
|
1241 ]; |
|
1242 node [label="\N"]; |
|
1243 12 [fillcolor="#9999FF", |
|
1244 fixedsize=true, |
|
1245 group=default, |
|
1246 height=0.5, |
|
1247 label=12, |
|
1248 pin=true, |
|
1249 pos="1,12!", |
|
1250 shape=circle, |
|
1251 style=filled, |
|
1252 width=0.5]; |
|
1253 13 [fillcolor="#DFDFFF", |
|
1254 fixedsize=true, |
|
1255 group=default_alt, |
|
1256 height=0.5, |
|
1257 label=13, |
|
1258 pin=true, |
|
1259 pos="2,13!", |
|
1260 shape=pentagon, |
|
1261 style="dotted, filled", |
|
1262 width=0.5]; |
|
1263 12 -> 13 [arrowhead=none, |
|
1264 penwidth=2.0]; |
|
1265 18 [fillcolor="#9999FF", |
|
1266 fixedsize=true, |
|
1267 group=default, |
|
1268 height=0.5, |
|
1269 label=18, |
|
1270 pin=true, |
|
1271 pos="1,18!", |
|
1272 shape=pentagon, |
|
1273 style=filled, |
|
1274 width=0.5]; |
|
1275 12 -> 18 [arrowhead=none, |
|
1276 penwidth=2.0]; |
|
1277 16 [fillcolor="#9999FF", |
|
1278 fixedsize=true, |
|
1279 group=default, |
|
1280 height=0.5, |
|
1281 label=16, |
|
1282 pin=true, |
|
1283 pos="1,16!", |
|
1284 shape=circle, |
|
1285 style=filled, |
|
1286 width=0.5]; |
|
1287 12 -> 16 [arrowhead=none, |
|
1288 penwidth=2.0]; |
|
1289 13 -> 18 [arrowhead=none, |
|
1290 minlen=0, |
|
1291 penwidth=2.0, |
|
1292 style=dashed]; |
|
1293 14 [fillcolor="#FF4F4F", |
|
1294 fixedsize=true, |
|
1295 group=default_alt, |
|
1296 height=0.5, |
|
1297 label=14, |
|
1298 pin=true, |
|
1299 pos="2,14!", |
|
1300 shape=pentagon, |
|
1301 style=filled, |
|
1302 width=0.5]; |
|
1303 13 -> 14 [arrowhead=none, |
|
1304 penwidth=2.0]; |
|
1305 15 [fillcolor="#FF4F4F", |
|
1306 fixedsize=true, |
|
1307 group=default_alt, |
|
1308 height=0.5, |
|
1309 label=15, |
|
1310 pin=true, |
|
1311 pos="2,15!", |
|
1312 shape=pentagon, |
|
1313 style=filled, |
|
1314 width=0.5]; |
|
1315 14 -> 15 [arrowhead=none, |
|
1316 penwidth=2.0]; |
|
1317 17 [fillcolor="#9999FF", |
|
1318 fixedsize=true, |
|
1319 group=default, |
|
1320 height=0.5, |
|
1321 label=17, |
|
1322 pin=true, |
|
1323 pos="1,17!", |
|
1324 shape=circle, |
|
1325 style=filled, |
|
1326 width=0.5]; |
|
1327 16 -> 17 [arrowhead=none, |
|
1328 penwidth=2.0]; |
|
1329 } |
|
1330 #endif |
|
1331 |
|
1332 Fortunately stack shows you a better visualization: |
|
1333 |
|
1334 $ hg stack |
|
1335 ### topic: tools |
|
1336 ### target: default (branch), 2 behind |
|
1337 t3$ Adding drill (unstable) |
|
1338 t2$ Adding saw (unstable) |
|
1339 t1@ Adding hammer to the shopping list (current) |
|
1340 t0^ add a pair of shoes (base) |
|
1341 |
|
1342 It's easy to stabilize the situation, `next` has an `--evolve` option. It will |
|
1343 do the necessary relocation of `t2` and `t3` over the new `t1` without having |
|
1344 to do that rebase by hand.: |
|
1345 |
|
1346 $ hg next --evolve |
|
1347 move:[14] Adding saw |
|
1348 atop:[18] Adding hammer to the shopping list |
|
1349 working directory now at d5c51ee5762a |
|
1350 |
|
1351 $ hg stack |
|
1352 ### topic: tools |
|
1353 ### target: default (branch), 2 behind |
|
1354 t3$ Adding drill (unstable) |
|
1355 t2@ Adding saw (current) |
|
1356 t1: Adding hammer to the shopping list |
|
1357 t0^ add a pair of shoes (base) |
|
1358 |
|
1359 One more to go: |
|
1360 |
|
1361 $ hg next --evolve |
|
1362 move:[15] Adding drill |
|
1363 atop:[19] Adding saw |
|
1364 working directory now at bae3758e46bf |
|
1365 |
|
1366 $ hg stack |
|
1367 ### topic: tools |
|
1368 ### target: default (branch), 2 behind |
|
1369 t3@ Adding drill (current) |
|
1370 t2: Adding saw |
|
1371 t1: Adding hammer to the shopping list |
|
1372 t0^ add a pair of shoes (base) |
|
1373 |
|
1374 Let's take a look at `hg log` once again: |
|
1375 |
|
1376 $ hg log -G -r "t0::" |
|
1377 @ changeset: 20:bae3758e46bf |
|
1378 | tag: tip |
|
1379 | topic: tools |
|
1380 | user: test |
|
1381 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1382 | summary: Adding drill |
|
1383 | |
|
1384 o changeset: 19:d5c51ee5762a |
|
1385 | topic: tools |
|
1386 | user: test |
|
1387 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1388 | summary: Adding saw |
|
1389 | |
|
1390 o changeset: 18:b7509bd417f8 |
|
1391 | topic: tools |
|
1392 | parent: 12:fbff9bc37a43 |
|
1393 | user: test |
|
1394 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1395 | summary: Adding hammer to the shopping list |
|
1396 | |
|
1397 | o changeset: 17:4cd7c1591a67 |
|
1398 | | user: test |
|
1399 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1400 | | summary: Adding orange juice |
|
1401 | | |
|
1402 | o changeset: 16:20759cb47ff8 |
|
1403 |/ parent: 12:fbff9bc37a43 |
|
1404 | user: test |
|
1405 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1406 | summary: Adding apple juice |
|
1407 | |
|
1408 o changeset: 12:fbff9bc37a43 |
|
1409 | user: test |
|
1410 ~ date: Thu Jan 01 00:00:00 1970 +0000 |
|
1411 summary: add a pair of shoes |
|
1412 |
|
1413 |
|
1414 #if docgraph-ext |
|
1415 $ hg docgraph -r "t0::" --sphinx-directive --rankdir LR #rest-ignore |
|
1416 .. graphviz:: |
|
1417 |
|
1418 strict digraph { |
|
1419 graph [rankdir=LR, |
|
1420 splines=polyline |
|
1421 ]; |
|
1422 node [label="\N"]; |
|
1423 12 [fillcolor="#9999FF", |
|
1424 fixedsize=true, |
|
1425 group=default, |
|
1426 height=0.5, |
|
1427 label=12, |
|
1428 pin=true, |
|
1429 pos="1,12!", |
|
1430 shape=circle, |
|
1431 style=filled, |
|
1432 width=0.5]; |
|
1433 16 [fillcolor="#9999FF", |
|
1434 fixedsize=true, |
|
1435 group=default, |
|
1436 height=0.5, |
|
1437 label=16, |
|
1438 pin=true, |
|
1439 pos="1,16!", |
|
1440 shape=circle, |
|
1441 style=filled, |
|
1442 width=0.5]; |
|
1443 12 -> 16 [arrowhead=none, |
|
1444 penwidth=2.0]; |
|
1445 18 [fillcolor="#9999FF", |
|
1446 fixedsize=true, |
|
1447 group=default, |
|
1448 height=0.5, |
|
1449 label=18, |
|
1450 pin=true, |
|
1451 pos="1,18!", |
|
1452 shape=pentagon, |
|
1453 style=filled, |
|
1454 width=0.5]; |
|
1455 12 -> 18 [arrowhead=none, |
|
1456 penwidth=2.0]; |
|
1457 17 [fillcolor="#9999FF", |
|
1458 fixedsize=true, |
|
1459 group=default, |
|
1460 height=0.5, |
|
1461 label=17, |
|
1462 pin=true, |
|
1463 pos="1,17!", |
|
1464 shape=circle, |
|
1465 style=filled, |
|
1466 width=0.5]; |
|
1467 16 -> 17 [arrowhead=none, |
|
1468 penwidth=2.0]; |
|
1469 19 [fillcolor="#9999FF", |
|
1470 fixedsize=true, |
|
1471 group=default, |
|
1472 height=0.5, |
|
1473 label=19, |
|
1474 pin=true, |
|
1475 pos="1,19!", |
|
1476 shape=pentagon, |
|
1477 style=filled, |
|
1478 width=0.5]; |
|
1479 18 -> 19 [arrowhead=none, |
|
1480 penwidth=2.0]; |
|
1481 20 [fillcolor="#9999FF", |
|
1482 fixedsize=true, |
|
1483 group=default, |
|
1484 height=0.5, |
|
1485 label=20, |
|
1486 pin=true, |
|
1487 pos="1,20!", |
|
1488 shape=pentagon, |
|
1489 style=filled, |
|
1490 width=0.5]; |
|
1491 19 -> 20 [arrowhead=none, |
|
1492 penwidth=2.0]; |
|
1493 } |
|
1494 #endif |
|
1495 Multi-headed stack |
|
1496 ------------------ |
|
1497 |
|
1498 Stack is also very helpful when you have a multi-headed stack: |
|
1499 |
|
1500 $ hg up t1 |
|
1501 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1502 |
|
1503 $ echo "nails" > new_shopping |
|
1504 $ cat shopping >> new_shopping |
|
1505 $ mv new_shopping shopping |
|
1506 |
|
1507 $ hg commit -m 'Adding nails' |
|
1508 |
|
1509 $ hg stack |
|
1510 ### topic: tools (2 heads) |
|
1511 ### target: default (branch), 2 behind |
|
1512 t4: Adding drill |
|
1513 t3: Adding saw |
|
1514 t1^ Adding hammer to the shopping list (base) |
|
1515 t2@ Adding nails (current) |
|
1516 t1: Adding hammer to the shopping list |
|
1517 t0^ add a pair of shoes (base) |
|
1518 |
|
1519 Solving this situation is easy with a topic: use merge or rebase. |
|
1520 Merge within a multi-headed stack will use the other topic head as |
|
1521 destination if the topic has two heads. But rebasing will yield a |
|
1522 completely linear history so it's what we will do. |
|
1523 |
|
1524 $ hg log -G |
|
1525 @ changeset: 21:f936c6da9d61 |
|
1526 | tag: tip |
|
1527 | topic: tools |
|
1528 | parent: 18:b7509bd417f8 |
|
1529 | user: test |
|
1530 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1531 | summary: Adding nails |
|
1532 | |
|
1533 | o changeset: 20:bae3758e46bf |
|
1534 | | topic: tools |
|
1535 | | user: test |
|
1536 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1537 | | summary: Adding drill |
|
1538 | | |
|
1539 | o changeset: 19:d5c51ee5762a |
|
1540 |/ topic: tools |
|
1541 | user: test |
|
1542 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1543 | summary: Adding saw |
|
1544 | |
|
1545 o changeset: 18:b7509bd417f8 |
|
1546 | topic: tools |
|
1547 | parent: 12:fbff9bc37a43 |
|
1548 | user: test |
|
1549 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1550 | summary: Adding hammer to the shopping list |
|
1551 | |
|
1552 | o changeset: 17:4cd7c1591a67 |
|
1553 | | user: test |
|
1554 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1555 | | summary: Adding orange juice |
|
1556 | | |
|
1557 | o changeset: 16:20759cb47ff8 |
|
1558 |/ parent: 12:fbff9bc37a43 |
|
1559 | user: test |
|
1560 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1561 | summary: Adding apple juice |
|
1562 | |
|
1563 o changeset: 12:fbff9bc37a43 |
|
1564 | user: test |
|
1565 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1566 | summary: add a pair of shoes |
|
1567 | |
|
1568 o changeset: 11:f2d6cacc6115 |
|
1569 | parent: 5:2d50db8b5b4c |
|
1570 | user: test |
|
1571 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1572 | summary: add a coat |
|
1573 | |
|
1574 o changeset: 5:2d50db8b5b4c |
|
1575 | user: test |
|
1576 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1577 | summary: adding fruits |
|
1578 | |
|
1579 o changeset: 4:4011b46eeb33 |
|
1580 | user: test |
|
1581 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1582 | summary: adding condiments |
|
1583 | |
|
1584 o changeset: 3:6104862e8b84 |
|
1585 | parent: 0:38da43f0a2ea |
|
1586 | user: test |
|
1587 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1588 | summary: Adding clothes |
|
1589 | |
|
1590 o changeset: 0:38da43f0a2ea |
|
1591 user: test |
|
1592 date: Thu Jan 01 00:00:00 1970 +0000 |
|
1593 summary: Shopping list |
|
1594 |
|
1595 |
|
1596 #if docgraph-ext |
|
1597 $ hg docgraph -r "all()" --sphinx-directive --rankdir LR #rest-ignore |
|
1598 .. graphviz:: |
|
1599 |
|
1600 strict digraph { |
|
1601 graph [rankdir=LR, |
|
1602 splines=polyline |
|
1603 ]; |
|
1604 node [label="\N"]; |
|
1605 0 [fillcolor="#9999FF", |
|
1606 fixedsize=true, |
|
1607 group=default, |
|
1608 height=0.5, |
|
1609 label=0, |
|
1610 pin=true, |
|
1611 pos="1,0!", |
|
1612 shape=circle, |
|
1613 style=filled, |
|
1614 width=0.5]; |
|
1615 3 [fillcolor="#9999FF", |
|
1616 fixedsize=true, |
|
1617 group=default, |
|
1618 height=0.5, |
|
1619 label=3, |
|
1620 pin=true, |
|
1621 pos="1,3!", |
|
1622 shape=circle, |
|
1623 style=filled, |
|
1624 width=0.5]; |
|
1625 0 -> 3 [arrowhead=none, |
|
1626 penwidth=2.0]; |
|
1627 4 [fillcolor="#9999FF", |
|
1628 fixedsize=true, |
|
1629 group=default, |
|
1630 height=0.5, |
|
1631 label=4, |
|
1632 pin=true, |
|
1633 pos="1,4!", |
|
1634 shape=circle, |
|
1635 style=filled, |
|
1636 width=0.5]; |
|
1637 3 -> 4 [arrowhead=none, |
|
1638 penwidth=2.0]; |
|
1639 5 [fillcolor="#9999FF", |
|
1640 fixedsize=true, |
|
1641 group=default, |
|
1642 height=0.5, |
|
1643 label=5, |
|
1644 pin=true, |
|
1645 pos="1,5!", |
|
1646 shape=circle, |
|
1647 style=filled, |
|
1648 width=0.5]; |
|
1649 4 -> 5 [arrowhead=none, |
|
1650 penwidth=2.0]; |
|
1651 11 [fillcolor="#9999FF", |
|
1652 fixedsize=true, |
|
1653 group=default, |
|
1654 height=0.5, |
|
1655 label=11, |
|
1656 pin=true, |
|
1657 pos="1,11!", |
|
1658 shape=circle, |
|
1659 style=filled, |
|
1660 width=0.5]; |
|
1661 5 -> 11 [arrowhead=none, |
|
1662 penwidth=2.0]; |
|
1663 12 [fillcolor="#9999FF", |
|
1664 fixedsize=true, |
|
1665 group=default, |
|
1666 height=0.5, |
|
1667 label=12, |
|
1668 pin=true, |
|
1669 pos="1,12!", |
|
1670 shape=circle, |
|
1671 style=filled, |
|
1672 width=0.5]; |
|
1673 11 -> 12 [arrowhead=none, |
|
1674 penwidth=2.0]; |
|
1675 16 [fillcolor="#9999FF", |
|
1676 fixedsize=true, |
|
1677 group=default, |
|
1678 height=0.5, |
|
1679 label=16, |
|
1680 pin=true, |
|
1681 pos="1,16!", |
|
1682 shape=circle, |
|
1683 style=filled, |
|
1684 width=0.5]; |
|
1685 12 -> 16 [arrowhead=none, |
|
1686 penwidth=2.0]; |
|
1687 18 [fillcolor="#9999FF", |
|
1688 fixedsize=true, |
|
1689 group=default, |
|
1690 height=0.5, |
|
1691 label=18, |
|
1692 pin=true, |
|
1693 pos="1,18!", |
|
1694 shape=pentagon, |
|
1695 style=filled, |
|
1696 width=0.5]; |
|
1697 12 -> 18 [arrowhead=none, |
|
1698 penwidth=2.0]; |
|
1699 17 [fillcolor="#9999FF", |
|
1700 fixedsize=true, |
|
1701 group=default, |
|
1702 height=0.5, |
|
1703 label=17, |
|
1704 pin=true, |
|
1705 pos="1,17!", |
|
1706 shape=circle, |
|
1707 style=filled, |
|
1708 width=0.5]; |
|
1709 16 -> 17 [arrowhead=none, |
|
1710 penwidth=2.0]; |
|
1711 19 [fillcolor="#9999FF", |
|
1712 fixedsize=true, |
|
1713 group=default, |
|
1714 height=0.5, |
|
1715 label=19, |
|
1716 pin=true, |
|
1717 pos="1,19!", |
|
1718 shape=pentagon, |
|
1719 style=filled, |
|
1720 width=0.5]; |
|
1721 18 -> 19 [arrowhead=none, |
|
1722 penwidth=2.0]; |
|
1723 21 [fillcolor="#9999FF", |
|
1724 fixedsize=true, |
|
1725 group=default, |
|
1726 height=0.5, |
|
1727 label=21, |
|
1728 pin=true, |
|
1729 pos="1,21!", |
|
1730 shape=pentagon, |
|
1731 style=filled, |
|
1732 width=0.5]; |
|
1733 18 -> 21 [arrowhead=none, |
|
1734 penwidth=2.0]; |
|
1735 20 [fillcolor="#9999FF", |
|
1736 fixedsize=true, |
|
1737 group=default, |
|
1738 height=0.5, |
|
1739 label=20, |
|
1740 pin=true, |
|
1741 pos="1,20!", |
|
1742 shape=pentagon, |
|
1743 style=filled, |
|
1744 width=0.5]; |
|
1745 19 -> 20 [arrowhead=none, |
|
1746 penwidth=2.0]; |
|
1747 } |
|
1748 #endif |
|
1749 |
|
1750 $ hg up t4 |
|
1751 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1752 |
|
1753 $ hg rebase |
|
1754 rebasing 19:d5c51ee5762a "Adding saw" |
|
1755 merging shopping |
|
1756 rebasing 20:bae3758e46bf "Adding drill" |
|
1757 merging shopping |
|
1758 |
|
1759 $ hg stack |
|
1760 ### topic: tools |
|
1761 ### target: default (branch), 2 behind |
|
1762 t4@ Adding drill (current) |
|
1763 t3: Adding saw |
|
1764 t2: Adding nails |
|
1765 t1: Adding hammer to the shopping list |
|
1766 t0^ add a pair of shoes (base) |
|
1767 |
|
1768 Collaborating through a non-publishing server |
|
1769 ============================================= |
|
1770 |
|
1771 .. setup: |
|
1772 |
|
1773 .. Let's create a non-publishing server: |
|
1774 |
|
1775 $ cd .. |
|
1776 |
|
1777 $ hg clone server non-publishing-server |
|
1778 updating to branch default |
|
1779 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1780 |
|
1781 $ cd non-publishing-server |
|
1782 $ cat >> .hg/hgrc << EOF |
|
1783 > [phases] |
|
1784 > publish = false |
|
1785 > EOF |
|
1786 |
|
1787 .. And another client: |
|
1788 |
|
1789 $ cd .. |
|
1790 |
|
1791 $ hg clone server other-client |
|
1792 updating to branch default |
|
1793 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1794 |
|
1795 $ cd client |
|
1796 |
|
1797 We can now share these draft changesets: |
|
1798 (4.1-tests needs the --force to proceed with the test) |
|
1799 |
|
1800 $ hg push ../non-publishing-server -r tools --force |
|
1801 pushing to ../non-publishing-server |
|
1802 searching for changes |
|
1803 adding changesets |
|
1804 adding manifests |
|
1805 adding file changes |
|
1806 added 4 changesets with 4 changes to 1 files (+1 heads) |
|
1807 8 new obsolescence markers |
|
1808 |
|
1809 Pushing the new topic branch to a non publishing server did not require |
|
1810 --force. As long as new heads are on their own topic, Mercurial will not |
|
1811 complain about them. |
|
1812 |
|
1813 From another client, we will get them with their topic: |
|
1814 |
|
1815 $ cd ../other-client |
|
1816 |
|
1817 $ hg pull ../non-publishing-server |
|
1818 pulling from ../non-publishing-server |
|
1819 searching for changes |
|
1820 adding changesets |
|
1821 adding manifests |
|
1822 adding file changes |
|
1823 added 4 changesets with 4 changes to 1 files (+1 heads) |
|
1824 8 new obsolescence markers |
|
1825 (run 'hg heads' to see heads) |
|
1826 |
|
1827 $ hg topics --verbose |
|
1828 tools (on branch: default, 4 changesets, 2 behind) |
|
1829 |
|
1830 $ hg up tools |
|
1831 switching to topic tools |
|
1832 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1833 |
|
1834 $ hg stack |
|
1835 ### topic: tools |
|
1836 ### target: default (branch), 2 behind |
|
1837 t4@ Adding drill (current) |
|
1838 t3: Adding saw |
|
1839 t2: Adding nails |
|
1840 t1: Adding hammer to the shopping list |
|
1841 t0^ add a pair of shoes (base) |
|
1842 |
|
1843 We can also add new changesets and share them: |
|
1844 (4.1-tests needs the --force to proceed with the test) |
|
1845 |
|
1846 $ echo screws >> shopping |
|
1847 |
|
1848 $ hg commit -A -m "Adding screws" |
|
1849 |
|
1850 $ hg push ../non-publishing-server --force |
|
1851 pushing to ../non-publishing-server |
|
1852 searching for changes |
|
1853 adding changesets |
|
1854 adding manifests |
|
1855 adding file changes |
|
1856 added 1 changesets with 1 changes to 1 files |
|
1857 |
|
1858 And retrieve them on the first client: |
|
1859 |
|
1860 $ cd ../client |
|
1861 |
|
1862 $ hg pull ../non-publishing-server |
|
1863 pulling from ../non-publishing-server |
|
1864 searching for changes |
|
1865 adding changesets |
|
1866 adding manifests |
|
1867 adding file changes |
|
1868 added 1 changesets with 1 changes to 1 files |
|
1869 (run 'hg update' to get a working copy) |
|
1870 |
|
1871 $ hg update |
|
1872 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1873 |
|
1874 $ hg stack |
|
1875 ### topic: tools |
|
1876 ### target: default (branch), 2 behind |
|
1877 t5@ Adding screws (current) |
|
1878 t4: Adding drill |
|
1879 t3: Adding saw |
|
1880 t2: Adding nails |
|
1881 t1: Adding hammer to the shopping list |
|
1882 t0^ add a pair of shoes (base) |