diff hgext3rd/topic/stack.py @ 1995:54d6dff699f0

stack: add some header with the topic name This is the first step of a move to add more data about a stack in the command output.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 26 Aug 2016 14:14:04 +0200
parents ba79d23594d6
children 5c40dd2cf131
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Fri Aug 26 14:58:18 2016 +0200
+++ b/hgext3rd/topic/stack.py	Fri Aug 26 14:14:04 2016 +0200
@@ -2,6 +2,7 @@
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
+from mercurial.i18n import _
 from mercurial import (
     destutil,
     error,
@@ -19,6 +20,14 @@
     prev = None
     entries = []
     idxmap = {}
+
+    label = 'topic'
+    if topic == repo.currenttopic:
+        label = 'topic.active'
+
+    fm.plain(_('### topic: %s\n') % ui.label(topic, label),
+             label='topic.stack.summary.topic')
+
     for idx, r in enumerate(getstack(repo, topic), 1):
         ctx = repo[r]
         p1 = ctx.p1()