# HG changeset patch # User Brodie Rao # Date 1270439630 18000 # Node ID 441f5d66da039a3d545ba4e9512dc68a5c21354e # Parent 824310023e4afea983e80da13218dd1c5d3151ef color: concatenate effects correctly and avoid printing empty effects diff -r 824310023e4a -r 441f5d66da03 hgext/color.py --- a/hgext/color.py Mon Apr 05 01:31:16 2010 +0200 +++ b/hgext/color.py Sun Apr 04 22:53:50 2010 -0500 @@ -134,9 +134,12 @@ _buffers = None def style(msg, label): - effects = '' + effects = [] for l in label.split(): - effects += _styles.get(l, '') + s = _styles.get(l, '') + if s: + effects.append(s) + effects = ''.join(effects) if effects: return '\n'.join([render_effects(s, effects) for s in msg.split('\n')])