diff -r 9345b2eeeef3 -r 1b4c92621e23 tests/test-topic-tutorial.t --- a/tests/test-topic-tutorial.t Tue Sep 19 12:52:22 2017 +0200 +++ b/tests/test-topic-tutorial.t Tue Aug 29 16:42:40 2017 +0200 @@ -45,6 +45,7 @@ > [ui] > user= Tutorial User > EOF + $ . "$TESTDIR/testlib/graphviz_setup.sh" #ignore Topic branches are lightweight branches which disappear when changes are finalized (moved to the public phase). They can help users to organize and share @@ -62,6 +63,25 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + } We are about to make some additions to this list and would like to do them within a topic. Creating a new topic is done using the ``topic`` command: @@ -90,6 +110,26 @@ summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + } + Our next commit will be part of the active topic: $ cat >> shopping << EOF @@ -110,6 +150,26 @@ summary: adding condiments + $ hg graphviz -r "topic("food")" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 1 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="1: 13900241408b", + pin=true, + pos="1,1!", + shape=pentagon, + style=filled, + width=2]; + } + And future commits will be part of that topic too: $ cat >> shopping << EOF @@ -135,6 +195,37 @@ summary: adding condiments + $ hg graphviz -r "topic("food")" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 1 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="1: 13900241408b", + pin=true, + pos="1,1!", + shape=pentagon, + style=filled, + width=2]; + 2 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="2: 287de11b401f", + pin=true, + pos="1,2!", + shape=pentagon, + style=filled, + width=2]; + 1 -> 2; + } + We can get a compact view of the content of our topic using the ``stack`` command: @@ -175,6 +266,48 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Shopping list + + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + 1 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="1: 13900241408b", + pin=true, + pos="1,1!", + shape=pentagon, + style=filled, + width=2]; + 0 -> 1; + 2 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="2: 287de11b401f", + pin=true, + pos="1,2!", + shape=pentagon, + style=filled, + width=2]; + 1 -> 2; + } And updating back to the topic reactivates it: $ hg update food @@ -253,6 +386,58 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + 1 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="1: 13900241408b", + pin=true, + pos="1,1!", + shape=pentagon, + style=filled, + width=2]; + 0 -> 1; + 3 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="3: 6104862e8b84", + pin=true, + pos="1,3!", + shape=circle, + style=filled, + width=2]; + 0 -> 3; + 2 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="2: 287de11b401f", + pin=true, + pos="1,2!", + shape=pentagon, + style=filled, + width=2]; + 1 -> 2; + } The topic head will not be considered when merging from the new head of the branch: @@ -303,6 +488,58 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + 3 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="3: 6104862e8b84", + pin=true, + pos="1,3!", + shape=circle, + style=filled, + width=2]; + 0 -> 3; + 4 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="4: 4011b46eeb33", + pin=true, + pos="1,4!", + shape=pentagon, + style=filled, + width=2]; + 3 -> 4; + 5 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="5: 2d50db8b5b4c", + pin=true, + pos="1,5!", + shape=pentagon, + style=filled, + width=2]; + 4 -> 5; + } The topic information will disappear when we publish the changesets: @@ -344,6 +581,59 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + 3 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="3: 6104862e8b84", + pin=true, + pos="1,3!", + shape=circle, + style=filled, + width=2]; + 0 -> 3; + 4 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="4: 4011b46eeb33", + pin=true, + pos="1,4!", + shape=circle, + style=filled, + width=2]; + 3 -> 4; + 5 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="5: 2d50db8b5b4c", + pin=true, + pos="1,5!", + shape=circle, + style=filled, + width=2]; + 4 -> 5; + } + $ hg update default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -510,6 +800,136 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + 3 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="3: 6104862e8b84", + pin=true, + pos="1,3!", + shape=circle, + style=filled, + width=2]; + 0 -> 3; + 4 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="4: 4011b46eeb33", + pin=true, + pos="1,4!", + shape=circle, + style=filled, + width=2]; + 3 -> 4; + 5 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="5: 2d50db8b5b4c", + pin=true, + pos="1,5!", + shape=circle, + style=filled, + width=2]; + 4 -> 5; + 6 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="6: 183984ef46d1", + pin=true, + pos="1,6!", + shape=pentagon, + style=filled, + width=2]; + 5 -> 6; + 9 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="9: 8dfa45bd5e0c", + pin=true, + pos="1,9!", + shape=pentagon, + style=filled, + width=2]; + 5 -> 9; + 11 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="11: f2d6cacc6115", + pin=true, + pos="1,11!", + shape=circle, + style=filled, + width=2]; + 5 -> 11; + 7 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="7: cffff85af537", + pin=true, + pos="1,7!", + shape=pentagon, + style=filled, + width=2]; + 6 -> 7; + 8 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="8: 34255b455dac", + pin=true, + pos="1,8!", + shape=pentagon, + style=filled, + width=2]; + 7 -> 8; + 10 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="10: 70dfa201ed73", + pin=true, + pos="1,10!", + shape=pentagon, + style=filled, + width=2]; + 9 -> 10; + 12 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="12: fbff9bc37a43", + pin=true, + pos="1,12!", + shape=circle, + style=filled, + width=2]; + 11 -> 12; + } + $ hg rebase rebasing 6:183984ef46d1 "Adding hammer" merging shopping @@ -708,6 +1128,97 @@ ~ date: Thu Jan 01 00:00:00 1970 +0000 summary: add a pair of shoes + + $ hg graphviz -r "t0::" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 12 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="12: fbff9bc37a43", + pin=true, + pos="1,12!", + shape=circle, + style=filled, + width=2]; + 13 [fillcolor="#DFDFFF", + fixedsize=true, + group=default_alt, + height=2, + label="13: a8ab3599d53d", + pin=true, + pos="2,13!", + shape=pentagon, + style="dotted, filled", + width=2]; + 12 -> 13; + 18 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="18: b7509bd417f8", + pin=true, + pos="1,18!", + shape=pentagon, + style=filled, + width=2]; + 12 -> 18; + 16 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="16: 20759cb47ff8", + pin=true, + pos="1,16!", + shape=circle, + style=filled, + width=2]; + 12 -> 16; + 13 -> 18 [arrowtail=dot, + dir=back, + minlen=0, + style=dotted]; + 14 [fillcolor="#FF3535", + fixedsize=true, + group=default_alt, + height=2, + label="14: d4f97f32f8a1", + pin=true, + pos="2,14!", + shape=pentagon, + style=filled, + width=2]; + 13 -> 14; + 15 [fillcolor="#FF3535", + fixedsize=true, + group=default_alt, + height=2, + label="15: bb1e6254f532", + pin=true, + pos="2,15!", + shape=pentagon, + style=filled, + width=2]; + 14 -> 15; + 17 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="17: 4cd7c1591a67", + pin=true, + pos="1,17!", + shape=circle, + style=filled, + width=2]; + 16 -> 17; + } + Fortunately stack shows you a better visualization: $ hg stack @@ -787,6 +1298,81 @@ ~ date: Thu Jan 01 00:00:00 1970 +0000 summary: add a pair of shoes + + $ hg graphviz -r "t0::" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 12 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="12: fbff9bc37a43", + pin=true, + pos="1,12!", + shape=circle, + style=filled, + width=2]; + 16 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="16: 20759cb47ff8", + pin=true, + pos="1,16!", + shape=circle, + style=filled, + width=2]; + 12 -> 16; + 18 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="18: b7509bd417f8", + pin=true, + pos="1,18!", + shape=pentagon, + style=filled, + width=2]; + 12 -> 18; + 17 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="17: 4cd7c1591a67", + pin=true, + pos="1,17!", + shape=circle, + style=filled, + width=2]; + 16 -> 17; + 19 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="19: d5c51ee5762a", + pin=true, + pos="1,19!", + shape=pentagon, + style=filled, + width=2]; + 18 -> 19; + 20 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="20: bae3758e46bf", + pin=true, + pos="1,20!", + shape=pentagon, + style=filled, + width=2]; + 19 -> 20; + } Multi-headed stack ------------------ @@ -887,6 +1473,147 @@ summary: Shopping list + $ hg graphviz -r "all()" --sphinx-directive --rankdir LR #ignore + .. graphviz:: + + strict digraph { + graph [rankdir=LR, + splines=polyline + ]; + node [label="\N"]; + 0 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="0: 38da43f0a2ea", + pin=true, + pos="1,0!", + shape=circle, + style=filled, + width=2]; + 3 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="3: 6104862e8b84", + pin=true, + pos="1,3!", + shape=circle, + style=filled, + width=2]; + 0 -> 3; + 4 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="4: 4011b46eeb33", + pin=true, + pos="1,4!", + shape=circle, + style=filled, + width=2]; + 3 -> 4; + 5 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="5: 2d50db8b5b4c", + pin=true, + pos="1,5!", + shape=circle, + style=filled, + width=2]; + 4 -> 5; + 11 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="11: f2d6cacc6115", + pin=true, + pos="1,11!", + shape=circle, + style=filled, + width=2]; + 5 -> 11; + 12 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="12: fbff9bc37a43", + pin=true, + pos="1,12!", + shape=circle, + style=filled, + width=2]; + 11 -> 12; + 16 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="16: 20759cb47ff8", + pin=true, + pos="1,16!", + shape=circle, + style=filled, + width=2]; + 12 -> 16; + 18 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="18: b7509bd417f8", + pin=true, + pos="1,18!", + shape=pentagon, + style=filled, + width=2]; + 12 -> 18; + 17 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="17: 4cd7c1591a67", + pin=true, + pos="1,17!", + shape=circle, + style=filled, + width=2]; + 16 -> 17; + 19 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="19: d5c51ee5762a", + pin=true, + pos="1,19!", + shape=pentagon, + style=filled, + width=2]; + 18 -> 19; + 21 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="21: f936c6da9d61", + pin=true, + pos="1,21!", + shape=pentagon, + style=filled, + width=2]; + 18 -> 21; + 20 [fillcolor="#7F7FFF", + fixedsize=true, + group=default, + height=2, + label="20: bae3758e46bf", + pin=true, + pos="1,20!", + shape=pentagon, + style=filled, + width=2]; + 19 -> 20; + } + $ hg up t4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved