diff hgext3rd/topic/stack.py @ 2750:bd3824d1b795

stack: show short node of changesets in `hg stack -v` After this patch, hg stack -v shows short nodes for changesets which have topic index, i.e. excluding the bases except t0.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 14 Jul 2017 07:19:15 +0530
parents f19b314d8475
children 1c9150e30b28
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Fri Jul 21 01:04:32 2017 +0200
+++ b/hgext3rd/topic/stack.py	Fri Jul 14 07:19:15 2017 +0530
@@ -10,6 +10,8 @@
 )
 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor
 
+short = node.short
+
 def getstack(repo, branch=None, topic=None):
     # XXX need sorting
     if topic is not None and branch is not None:
@@ -139,9 +141,14 @@
 
         if idx is None:
             fm.plain('  ')
+            if ui.verbose:
+                fm.plain('              ')
         else:
             fm.write('topic.stack.index', '%s%%d' % prefix, idx,
                      label='topic.stack.index ' + labelsgen('topic.stack.index.%s', states))
+            if ui.verbose:
+                fm.write('topic.stack.shortnode', '(%s)', short(ctx.node()),
+                         label='topic.stack.shortnode ' + labelsgen('topic.stack.shortnode.%s', states))
         fm.write('topic.stack.state.symbol', '%s', symbol,
                  label='topic.stack.state ' + labelsgen('topic.stack.state.%s', states))
         fm.plain(' ')