mq: only highlight/label patch name for qseries.
Restore the behaviour introduced in e37e9904bf10, which was
accidentally removed when labelling was introduced in 717c35d55fb3.
--- 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;30;1m0 G new.patch[0m
-[0;30;1m1 G b.patch[0m
-[0;34;1;4m2 A c.patch[0m
-[0;30;1m3 U d.patch[0m
+0 G [0;30;1mnew.patch[0m
+1 G [0;30;1mb.patch[0m
+2 A [0;34;1;4mc.patch[0m
+3 U [0;30;1md.patch[0m
% new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
0 G new.patch
1 G b.patch