changeset 10822:4c63f8e787b8

qguard: make use of output labeling
author Brodie Rao <brodie@bitheap.org>
date Fri, 02 Apr 2010 15:22:12 -0500
parents a6ac91c313af
children 581d5e3095ef
files hgext/mq.py
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Fri Apr 02 15:22:10 2010 -0500
+++ b/hgext/mq.py	Fri Apr 02 15:22:12 2010 -0500
@@ -2134,7 +2134,17 @@
     '''
     def status(idx):
         guards = q.series_guards[idx] or ['unguarded']
-        ui.write('%s: %s\n' % (q.series[idx], ' '.join(guards)))
+        ui.write('%s: ' % ui.label(q.series[idx], 'qguard.patch'))
+        for i, guard in enumerate(guards):
+            if guard.startswith('+'):
+                ui.write(guard, label='qguard.positive')
+            elif guard.startswith('-'):
+                ui.write(guard, label='qguard.negative')
+            else:
+                ui.write(guard, label='qguard.unguarded')
+            if i != len(guards) - 1:
+                ui.write(' ')
+        ui.write('\n')
     q = repo.mq
     patch = None
     args = list(args)