mq: only highlight/label patch name for qseries.
authorDan Villiom Podlaski Christiansen <danchr@gmail.com>
Thu, 15 Apr 2010 18:12:28 +0200
changeset 10932 29c39fe2491b
parent 10931 75101b1e6302
child 10934 a8486615eece
mq: only highlight/label patch name for qseries. Restore the behaviour introduced in e37e9904bf10, which was accidentally removed when labelling was introduced in 717c35d55fb3.
hgext/mq.py
tests/test-mq-guards.out
--- a/hgext/mq.py	Fri Apr 16 14:30:13 2010 +0200
+++ b/hgext/mq.py	Thu Apr 15 18:12:28 2010 +0200
@@ -1415,6 +1415,8 @@
     def qseries(self, repo, missing=None, start=0, length=None, status=None,
                 summary=False):
         def displayname(pfx, patchname, state):
+            if pfx:
+                self.ui.write(pfx)
             if summary:
                 ph = patchheader(self.join(patchname), self.plainmode)
                 msg = ph.message and ph.message[0] or ''
@@ -1424,10 +1426,12 @@
                         msg = util.ellipsis(msg, width)
                     else:
                         msg = ''
-                msg = "%s%s: %s" % (pfx, patchname, msg)
+                self.ui.write(patchname, label='qseries.' + state)
+                self.ui.write(': ')
+                self.ui.write(msg, label='qseries.message.' + state)
             else:
-                msg = pfx + patchname
-            self.ui.write(msg + '\n', label='qseries.' + state)
+                self.ui.write(patchname, label='qseries.' + state)
+            self.ui.write('\n')
 
         applied = set([p.name for p in self.applied])
         if length is None:
--- a/tests/test-mq-guards.out	Fri Apr 16 14:30:13 2010 +0200
+++ b/tests/test-mq-guards.out	Thu Apr 15 18:12:28 2010 +0200
@@ -131,10 +131,10 @@
 2 A c.patch
 3 U d.patch
 % qseries again, but with color
-0 G new.patch
-1 G b.patch
-2 A c.patch
-3 U d.patch
+0 G new.patch
+1 G b.patch
+2 A c.patch
+3 U d.patch
 % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
 0 G new.patch
 1 G b.patch