# HG changeset patch # User Pierre-Yves David # Date 1472214211 -7200 # Node ID 5c40dd2cf13154a0dcaea449fc67a324ed6d507c # Parent 54d6dff699f02369f8a39aaa54c672505bbd962e stack: add some basic branch information In the same spirit as knowing the topic you are on, having some branch data seem useful (yet, this smell a bit like summary) diff -r 54d6dff699f0 -r 5c40dd2cf131 hgext3rd/topic/stack.py --- a/hgext3rd/topic/stack.py Fri Aug 26 14:14:04 2016 +0200 +++ b/hgext3rd/topic/stack.py Fri Aug 26 14:23:31 2016 +0200 @@ -25,8 +25,12 @@ if topic == repo.currenttopic: label = 'topic.active' + data = stackdata(repo, topic) fm.plain(_('### topic: %s\n') % ui.label(topic, label), label='topic.stack.summary.topic') + fm.plain(_('### branch: %s\n') + % '+'.join(data['branches']), # XXX handle multi branches + label='topic.stack.summary.branches') for idx, r in enumerate(getstack(repo, topic), 1): ctx = repo[r] diff -r 54d6dff699f0 -r 5c40dd2cf131 tests/test-topic-stack-data.t --- a/tests/test-topic-stack-data.t Fri Aug 26 14:14:04 2016 +0200 +++ b/tests/test-topic-stack-data.t Fri Aug 26 14:23:31 2016 +0200 @@ -241,6 +241,7 @@ $ hg stack bar ### topic: bar + ### branch: default t5: add bar_c t2^ add bar_b (base) t4$ add bar_e (unstable) @@ -250,16 +251,19 @@ ^ add base_e $ hg stack baz ### topic: baz + ### branch: default t2: add baz_b t1: add baz_a ^ add base_c $ hg stack foo ### topic: foo + ### branch: lake t2@ add foo_b (current) t1: add foo_a ^ add lake_a $ hg stack fuz ### topic: fuz + ### branch: default t3$ add fuz_c (unstable) t2$ add fuz_b (unstable) t1: fuz1_a diff -r 54d6dff699f0 -r 5c40dd2cf131 tests/test-topic-stack.t --- a/tests/test-topic-stack.t Fri Aug 26 14:14:04 2016 +0200 +++ b/tests/test-topic-stack.t Fri Aug 26 14:23:31 2016 +0200 @@ -54,6 +54,7 @@ 0 files updated, 0 files merged, 4 files removed, 0 files unresolved $ hg topic --list ### topic: other + ### branch: default t2@ c_b (current) t1: c_a $ hg phase --public 'topic("other")' @@ -70,6 +71,7 @@ * foo $ hg stack ### topic: foo + ### branch: default t4@ c_f (current) t3: c_e t2: c_d @@ -127,6 +129,7 @@ $ hg topic --list ### topic: foo + ### branch: default t4$ c_f (unstable) t3$ c_e (unstable) t2@ c_d (current) @@ -196,6 +199,7 @@ $ hg top -l ### topic: foo + ### branch: default t6: c_f t5: c_e t2^ c_d (base) @@ -239,6 +243,7 @@ $ hg topic --list ### topic: foo + ### branch: default t6$ c_f (unstable) t5$ c_e (unstable) t2^ c_D (base)