[PATCH] mq: only highlight/label patch name for qseries
Dan Villiom Podlaski Christiansen
danchr at gmail.com
Thu Apr 15 11:14:39 CDT 2010
# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1271347948 -7200
# Node ID aa25d7f1f71071d5c5bebb495ce18e563540a1a2
# Parent 2dcf28e0c88a9a4e7fc17ecdf56776906a01cfad
mq: only highlight/label patch name for qseries.
Restore the behaviour introduced in e37e9904bf10, which was
accidentally removed when labelling was introduced in 717c35d55fb3.
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1415,6 +1415,8 @@ class queue(object):
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 @@ class queue(object):
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:
diff --git a/tests/test-mq-guards.out b/tests/test-mq-guards.out
--- a/tests/test-mq-guards.out
+++ b/tests/test-mq-guards.out
@@ -131,10 +131,10 @@ 1 G b.patch
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
More information about the Mercurial-devel
mailing list