[PATCH 1 of 2] Apply color to output of qseries --verbose
Kevin Christen
kevin.christen at gmail.com
Tue Jul 15 18:18:39 CDT 2008
# HG changeset patch
# User Kevin Christen <kevin.christen at gmail.com>
# Date 1216163134 18000
# Node ID dbea8bbc3bfde00fb1061dc9b22f7ba4148043ed
# Parent 2134d6c09432e4e3dbee18d93ec9242a332f7cdc
Apply color to output of qseries --verbose
Fixes issue 1173.
diff -r 2134d6c09432 -r dbea8bbc3bfd hgext/color.py
--- a/hgext/color.py Fri Jul 11 14:40:44 2008 +0200
+++ b/hgext/color.py Tue Jul 15 18:05:34 2008 -0500
@@ -40,7 +40,7 @@
status.unknown = magenta bold underline
status.ignored = black bold
- 'none' turns off all effects
+# 'none' turns off all effects
status.clean = none
status.copied = none
@@ -144,13 +144,17 @@
retval = qseriesfunc(ui, repo, **opts)
patches = ui.popbuffer().splitlines()
for patch in patches:
+ patchname = patch
+ if ui.verbose:
+ patchname = patch.split()[-1]
+ elif opts['summary']:
+ patchname = patch.split(': ')[0]
+
if opts['missing']:
effects = _patch_effects['missing']
- # Determine if patch is applied. Search for beginning of output
- # line in the applied patch list, in case --summary has been used
- # and output line isn't just the patch name.
+ # Determine if patch is applied.
elif [ applied for applied in repo.mq.applied
- if patch.startswith(applied.name) ]:
+ if patchname == applied.name ]:
effects = _patch_effects['applied']
else:
effects = _patch_effects['unapplied']
More information about the Mercurial-devel
mailing list