0649e77b06d0

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 27 Jan 2012 11:42:53 -0500
parents 97c27cccb458 (diff) 91bec91479bc (current diff)
children e16ee632ce6f
branches/tags (none)
files prompt.py

Changes

--- a/docs/wiki/documentation/keywords/index.mdown	Fri Jan 20 10:17:56 2012 -0800
+++ b/docs/wiki/documentation/keywords/index.mdown	Fri Jan 27 11:42:53 2012 -0500
@@ -157,6 +157,9 @@
 ##tags##
 :   Display the tags of the current parent, separated by a space.
     
+    |quiet
+        Display the tags of the current parent, excluding the tag "tip".
+
     |SEP
     :   Display the tags of the current parent, separated by `SEP`.
 
--- a/prompt.py	Fri Jan 20 10:17:56 2012 -0800
+++ b/prompt.py	Fri Jan 27 11:42:53 2012 -0500
@@ -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)'
@@ -593,6 +600,9 @@
 tags
      Display the tags of the current parent, separated by a space.
 
+     |quiet
+         Display the tags of the current parent, excluding the tag "tip".
+
      |SEP
          Display the tags of the current parent, separated by `SEP`.