diff hgext3rd/topic/stack.py @ 3084:144989dabe93

stack: show current and unstable also for t0 and bases
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 15 Oct 2017 00:03:59 +0530
parents 6f87042766cb
children 3eca2cbdc498
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Fri Oct 20 12:04:45 2017 +0200
+++ b/hgext3rd/topic/stack.py	Sun Oct 15 00:03:59 2017 +0530
@@ -275,26 +275,25 @@
     # super crude initial version
     for idx, isentry, ctx in entries[::-1]:
 
+        symbol = None
         states = []
         iscurrentrevision = repo.revs('%d and parents()', ctx.rev())
 
+        if iscurrentrevision:
+            states.append('current')
+            symbol = '@'
+
+        if ctx.orphan():
+            symbol = '$'
+            states.append('unstable')
+
         if not isentry:
             symbol = '^'
             # "base" is kind of a "ghost" entry
-            # skip other label for them (no current, no unstable)
-            states = ['base']
-        elif ctx.orphan():
-            # current revision can be unstable also, so in that case show both
-            # the states and the symbol '@' (issue5553)
-            if iscurrentrevision:
-                states.append('current')
-                symbol = '@'
-            symbol = '$'
-            states.append('unstable')
-        elif iscurrentrevision:
-            states.append('current')
-            symbol = '@'
-        else:
+            states.append('base')
+
+        # none of the above if statments get executed
+        if not symbol:
             symbol = ':'
             states.append('clean')
         fm.startitem()