240e531b5fc7

Add the {update} keyword.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 23 Jul 2009 02:38:02 -0400
parents 07e1b5f8e641
children b9124c78672f
branches/tags (none)
files prompt.py

Changes

--- a/prompt.py	Thu Jul 23 02:06:25 2009 -0400
+++ b/prompt.py	Thu Jul 23 02:38:02 2009 -0400
@@ -123,6 +123,11 @@
     def _basename(m):
         return _with_groups(m.groups(), path.basename(repo.root)) if repo.root else ''
     
+    def _update(m):
+        curr = repo[None].parents()[0]
+        to = repo[repo.branchtags()[curr.branch()]]
+        return _with_groups(m.groups(), '^') if curr != to else ''
+    
     def _remote(kind):
         def _r(m):
             g = m.groups()
@@ -162,6 +167,7 @@
         'root\|basename': _basename,
         'status': _status,
         'task': _task,
+        'update': _update,
         
         'incoming(\|count)?': _remote('incoming'),
         'outgoing(\|count)?': _remote('outgoing'),