diff hgext3rd/topic/__init__.py @ 1985:03d6b685c16a

topic: list the number of 'behind' changeset when --verbose is used Displaying more information in the topic list is useful, we continue with the number of 'behind' changesets. This 'behind' count the number of new changesets on the default rebase destination. This will highlight topics that need rebasing.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 14 Aug 2016 19:57:58 +0200
parents bee7a1ef8ba8
children d427fd97c9d5
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Mon Aug 15 00:19:44 2016 +0200
+++ b/hgext3rd/topic/__init__.py	Sun Aug 14 19:57:58 2016 +0200
@@ -47,6 +47,8 @@
 colortable = {'topic.active': 'green',
               'topic.list.troubledcount': 'red',
               'topic.list.headcount.multiple': 'yellow',
+              'topic.list.behindcount': 'cyan',
+              'topic.list.behinderror': 'red',
               'topic.stack.index': 'yellow',
               'topic.stack.state.base': 'dim',
               'topic.stack.state.clean': 'green',
@@ -307,6 +309,16 @@
                 fm.write('headcount', '%d heads',
                          data['headcount'],
                          label='topic.list.headcount.multiple')
+            if 0 < data['behindcount']:
+                fm.plain(', ')
+                fm.write('behindcount', '%d behind',
+                         data['behindcount'],
+                         label='topic.list.behindcount')
+            elif -1 == data['behindcount']:
+                fm.plain(', ')
+                fm.write('behinderror', '%s',
+                         _('ambiguous destination'),
+                         label='topic.list.behinderror')
             fm.plain(')')
         fm.plain('\n')
     fm.end()