f9395e8dcb7b

Add a quiet filter to the tags keyword, to exclude tip from the shown tags.
[view raw] [browse files]
author Dale Wijnand <dale.wijnand@gmail.com>
date Tue, 24 Jan 2012 23:56:25 +0100
parents c4095c3519d6
children 97c27cccb458
branches/tags (none)
files prompt.py

Changes

--- a/prompt.py	Wed Mar 23 15:42:04 2011 -0400
+++ b/prompt.py	Tue Jan 24 23:56:25 2012 +0100
@@ -304,9 +304,13 @@
     def _tags(m):
         g = m.groups()
 
-        sep = g[1][1:] if g[1] else ' '
+        sep = g[2][1:] if g[2] else ' '
         tags = repo[None].tags()
 
+        quiet = _get_filter('quiet', g)
+        if quiet:
+            tags = filter(lambda tag: tag != 'tip', tags)
+
         return _with_groups(g, sep.join(tags)) if tags else ''
 
     def _task(m):
@@ -380,7 +384,10 @@
             '(\|modified)'
             '|(\|unknown)'
             ')*': _status,
-        'tags(\|[^%s]*?)?' % brackets[-1]: _tags,
+        'tags(?:' +
+            '(\|quiet)' +
+            '|(\|[^%s]*?)' % brackets[-1] +
+            ')*': _tags,
         'task': _task,
         'tip(?:'
             '(\|node)'