changeset 5924:16f3fb304285

topic: add a 'topic.active' label to messages with active topic
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 17 May 2021 19:22:34 +0800
parents 4c7e430c3e38
children e5250f24eed7
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Mon May 17 19:19:32 2021 +0800
+++ b/hgext3rd/topic/__init__.py	Mon May 17 19:22:34 2021 +0800
@@ -670,7 +670,8 @@
                 csetcount = stack.stack(repo, topic=ct).changesetcount
                 empty = csetcount == 0
                 if empty and not ctwasempty:
-                    ui.status(b"active topic '%s' is now empty\n" % ct)
+                    ui.status(b"active topic '%s' is now empty\n"
+                              % ui.label(ct, b'topic.active'))
                     trnames = getattr(tr, 'names', getattr(tr, '_names', ()))
                     if (b'phase' in trnames
                             or any(n.startswith(b'push-response')
@@ -680,10 +681,10 @@
                 if ctwasempty and not empty:
                     if csetcount == 1:
                         msg = _(b"active topic '%s' grew its first changeset\n%s")
-                        ui.status(msg % (ct, hint))
+                        ui.status(msg % (ui.label(ct, b'topic.active'), hint))
                     else:
                         msg = _(b"active topic '%s' grew its %d first changesets\n%s")
-                        ui.status(msg % (ct, csetcount, hint))
+                        ui.status(msg % (ui.label(ct, b'topic.active'), csetcount, hint))
 
             tr.addpostclose(b'signalcurrenttopicempty', currenttopicempty)
             return tr
@@ -870,7 +871,8 @@
 
     if topic:
         if not ct:
-            ui.status(_(b'marked working directory as topic: %s\n') % topic)
+            ui.status(_(b'marked working directory as topic: %s\n')
+                      % ui.label(topic, b'topic.active'))
         return _changecurrenttopic(repo, topic)
 
     ui.pager(b'topics')