diff -r fc065ec30351 -r f9a850018daa tests/test-topic.t --- a/tests/test-topic.t Tue Aug 28 11:24:52 2018 +0200 +++ b/tests/test-topic.t Mon Sep 03 22:06:12 2018 +0200 @@ -40,8 +40,10 @@ your current topic. Topic is offering you aliases reference to changeset in your current topic - stack as 't#'. For example, 't1' refers to the root of your stack, 't2' to the - second commits, etc. The 'hg stack' command show these number. + stack as 's#'. For example, 's1' refers to the root of your stack, 's2' to the + second commits, etc. The 'hg stack' command show these number. 's0' can be + used to refer to the parent of the topic root. Updating using 'hg up s0' will + keep the topic active. Push behavior will change a bit with topic. When pushing to a publishing repository the changesets will turn public and the topic data on them will @@ -271,7 +273,7 @@ ### topic: narf ### target: default (branch) (stack is empty) - t0^ Add file delta (base current) + s0^ Add file delta (base current) Add commits to topic @@ -694,7 +696,7 @@ summary: Add file alpha No matches because narf is already closed: - $ hg log -r 'topic(narf)' -G + $ hg log -r 'topic("narf")' -G This regexp should match the topic `fran`: $ hg log -r 'topic("re:.ra.")' -G o changeset: 9:0469d521db49 @@ -734,10 +736,39 @@ summary: start on fran +Using revsets in topic() + $ tlog() { + > hg log -T '{rev}: {topic}\n' -r "$1" + > } + + $ tlog 'topic(9)' + 9: fran + $ tlog 'topic(8)' + $ tlog 'topic(head())' + 9: fran + $ tlog 'topic(:)' + 9: fran + $ tlog 'topic(all())' + 9: fran + $ tlog 'topic(topic(fran))' + 9: fran + $ tlog 'topic(wdir())' + 9: fran + $ tlog 'topic(nonsense)' + abort: unknown revision 'nonsense'! + [255] + +Pattern matching in topic() revset + $ tlog 'topic("re:nonsense")' + $ tlog 'topic("literal:nonsense")' + abort: topic 'nonsense' does not exist! + [255] + Deactivate the topic. $ hg topics * fran (1 changesets) $ hg topics --clear + $ hg log -r 'topic(wdir())' $ echo fran? >> beta $ hg ci -m 'fran?' created new head @@ -760,7 +791,7 @@ $ hg topics fran (1 changesets) -Testing for updating to t0 +Testing for updating to s0 ========================== $ hg up fran @@ -769,10 +800,10 @@ $ hg stack ### topic: fran ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads - t1@ start on fran (current) - t0^ Add file delta (base) + s1@ start on fran (current) + s0^ Add file delta (base) - $ hg up t0 + $ hg up s0 preserving the current topic 'fran' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -781,8 +812,8 @@ $ hg stack ### topic: fran ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads - t1: start on fran - t0^ Add file delta (base current) + s1: start on fran + s0^ Add file delta (base current) $ hg topics --age * fran (1970-01-01 by test)