hgext3rd/topic/stack.py
changeset 4434 432f2155d106
parent 4433 a19d8196b0c9
child 4435 7915aef191ff
--- a/hgext3rd/topic/stack.py	Thu Mar 07 22:50:56 2019 +0800
+++ b/hgext3rd/topic/stack.py	Sat Mar 09 12:54:00 2019 +0800
@@ -321,27 +321,20 @@
 
         symbol = None
         states = []
-        msg = ''
         iscurrentrevision = repo.revs('%d and parents()', ctx.rev())
         if opts.get('children'):
             expr = 'children(%d) and merge() - %ld'
             revisions = repo.revs(expr, ctx.rev(), st.revs[1:])
             if len(revisions) > 0:
-                msg = 'external-children'
+                states.append('external-children')
 
         if iscurrentrevision:
             symbol = '@'
-            if msg:
-                states.append('current - ' + msg)
-            else:
-                states.append('current')
+            states.append('current')
 
         if ctx.orphan():
             symbol = '$'
-            if msg:
-                states.append('orphan - ' + msg)
-            else:
-                states.append('orphan')
+            states.append('orphan')
 
         if not isentry:
             symbol = '^'
@@ -351,10 +344,9 @@
         # none of the above if statments get executed
         if not symbol:
             symbol = ':'
-            if msg:
-                states.append(msg)
-            else:
-                states.append('clean')
+
+        if not states:
+            states.append('clean')
 
         states.sort()