61 user: test |
61 user: test |
62 date: Thu Jan 01 00:00:00 1970 +0000 |
62 date: Thu Jan 01 00:00:00 1970 +0000 |
63 summary: Shopping list |
63 summary: Shopping list |
64 |
64 |
65 |
65 |
66 We are about to make some additions to this list and would like to do them |
66 We are about to make some additions to this list and would like to do them |
67 within a topic. Creating a new topic is done using the ``topic`` command: |
67 within a topic. Creating a new topic is done using the ``topic`` command: |
68 |
68 |
69 $ hg topic food |
69 $ hg topic food |
70 |
70 |
71 Much like a named branch, our topic is active but it does not contain any |
71 Much like a named branch, our topic is active but it does not contain any |
72 changesets yet: |
72 changeset yet: |
73 |
73 |
74 $ hg topic |
74 $ hg topic |
75 * food |
75 * food |
76 |
76 |
77 $ hg summary |
77 $ hg summary |
348 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
348 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
349 |
349 |
350 Working with Multiple Topics |
350 Working with Multiple Topics |
351 ============================ |
351 ============================ |
352 |
352 |
353 In the above example, topics do not bring much benefit since you only have one |
353 In the above example, topics do not bring much benefits since you only have one |
354 line of development. Topics start to be more useful when you have to work on |
354 line of development. Topics start to be more useful when you have to work on |
355 multiple features at the same time. |
355 multiple features at the same time. |
356 |
356 |
357 We might go shopping in a hardware store in the same go, so let's add some |
357 We might go shopping in a hardware store in the same go, so let's add some |
358 tools to the shopping list within a new topic: |
358 tools to the shopping list within a new topic: |
587 =========================== |
587 =========================== |
588 |
588 |
589 Navigating within your stack |
589 Navigating within your stack |
590 ---------------------------- |
590 ---------------------------- |
591 |
591 |
592 As we saw before `stack` display changesets on your current topic in a clean way: |
592 As we saw before `stack` displays changesets on your current topic in a clean way: |
593 |
593 |
594 $ hg topics --verbose |
594 $ hg topics --verbose |
595 * tools (on branch: default, 3 changesets, 2 behind) |
595 * tools (on branch: default, 3 changesets, 2 behind) |
596 |
596 |
597 $ hg stack |
597 $ hg stack |
707 o changeset: 12:fbff9bc37a43 |
707 o changeset: 12:fbff9bc37a43 |
708 | user: test |
708 | user: test |
709 ~ date: Thu Jan 01 00:00:00 1970 +0000 |
709 ~ date: Thu Jan 01 00:00:00 1970 +0000 |
710 summary: add a pair of shoes |
710 summary: add a pair of shoes |
711 |
711 |
712 Fortunately stack show you a better visualization: |
712 Fortunately stack shows you a better visualization: |
713 |
713 |
714 $ hg stack |
714 $ hg stack |
715 ### topic: tools |
715 ### topic: tools |
716 ### branch: default, 2 behind |
716 ### branch: default, 2 behind |
717 t3$ Adding drill (unstable) |
717 t3$ Adding drill (unstable) |
810 t1^ Adding hammer to the shopping list (base) |
810 t1^ Adding hammer to the shopping list (base) |
811 t2@ Adding nails (current) |
811 t2@ Adding nails (current) |
812 t1: Adding hammer to the shopping list |
812 t1: Adding hammer to the shopping list |
813 t0^ add a pair of shoes (base) |
813 t0^ add a pair of shoes (base) |
814 |
814 |
815 Solving this situation is easy with a topic, use merge or rebase. |
815 Solving this situation is easy with a topic: use merge or rebase. |
816 Merge within a multi-headed stack will use the other topic head as |
816 Merge within a multi-headed stack will use the other topic head as |
817 redestination if the topic has multiple heads. |
817 redestination if the topic has multiple heads. |
818 |
818 |
819 $ hg log -G |
819 $ hg log -G |
820 @ changeset: 21:f936c6da9d61 |
820 @ changeset: 21:f936c6da9d61 |
908 t3: Adding saw |
908 t3: Adding saw |
909 t2: Adding nails |
909 t2: Adding nails |
910 t1: Adding hammer to the shopping list |
910 t1: Adding hammer to the shopping list |
911 t0^ add a pair of shoes (base) |
911 t0^ add a pair of shoes (base) |
912 |
912 |
913 Collaborating through non-publishing server |
913 Collaborating through a non-publishing server |
914 =========================================== |
914 ========================--=================== |
915 |
915 |
916 .. setup: |
916 .. setup: |
917 |
917 |
918 .. Let's create a non-publishing server: |
918 .. Let's create a non-publishing server: |
919 |
919 |
937 updating to branch default |
937 updating to branch default |
938 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
938 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
939 |
939 |
940 $ cd client |
940 $ cd client |
941 |
941 |
942 We can now share theses drafts changesets: |
942 We can now share these draft changesets: |
943 |
943 |
944 $ hg push ../non-publishing-server -r tools |
944 $ hg push ../non-publishing-server -r tools |
945 pushing to ../non-publishing-server |
945 pushing to ../non-publishing-server |
946 searching for changes |
946 searching for changes |
947 adding changesets |
947 adding changesets |
948 adding manifests |
948 adding manifests |
949 adding file changes |
949 adding file changes |
950 added 4 changesets with 4 changes to 1 files (+1 heads) |
950 added 4 changesets with 4 changes to 1 files (+1 heads) |
951 8 new obsolescence markers |
951 8 new obsolescence markers |
952 |
952 |
953 Pushing the new topic branch to a non publishing server did not required |
953 Pushing the new topic branch to a non publishing server did not require |
954 --force. As long as new heads are on their own topic, Mercurial will not |
954 --force. As long as new heads are on their own topic, Mercurial will not |
955 complains about them. |
955 complain about them. |
956 |
956 |
957 From another client, we will gets them with their topic: |
957 From another client, we will get them with their topic: |
958 |
958 |
959 $ cd ../other-client |
959 $ cd ../other-client |
960 |
960 |
961 $ hg pull ../non-publishing-server |
961 $ hg pull ../non-publishing-server |
962 pulling from ../non-publishing-server |
962 pulling from ../non-publishing-server |