15afa852bf78

Add a {tags} keyword.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 10 Sep 2009 18:29:09 -0400
parents a1aca2ec2e5b
children ab242e2d02a2
branches/tags (none)
files prompt.py

Changes

--- a/prompt.py	Sat Aug 08 09:49:22 2009 -0400
+++ b/prompt.py	Thu Sep 10 18:29:09 2009 -0400
@@ -123,6 +123,15 @@
         except KeyError:
             return ''
     
+    def _tags(m):
+        g = m.groups()
+        out_g = (g[0],) + (g[-1],)
+        
+        sep = g[1][1:] if g[1] else ' '
+        tags = repo[None].tags()
+        
+        return _with_groups(out_g, sep.join(tags)) if tags else ''
+    
     def _task(m):
         try:
             task = extensions.find('tasks').current(repo)
@@ -205,6 +214,7 @@
         'root': _root,
         'root\|basename': _basename,
         'status': _status,
+        'tags(\|[^}]*)?': _tags,
         'task': _task,
         'update': _update,