Mercurial > hg
comparison hgext/color.py @ 11311:fcd06ecd4cb7
Merge backout
author | Steve Borho <steve@borho.org> |
---|---|
date | Tue, 08 Jun 2010 15:52:56 -0500 |
parents | ac873ecfc3c2 |
children | 40c06bbf58be |
comparison
equal
deleted
inserted
replaced
11309:ef7636efeb01 | 11311:fcd06ecd4cb7 |
---|---|
106 'status.copied': 'none', | 106 'status.copied': 'none', |
107 'status.deleted': 'cyan bold underline', | 107 'status.deleted': 'cyan bold underline', |
108 'status.ignored': 'black bold', | 108 'status.ignored': 'black bold', |
109 'status.modified': 'blue bold', | 109 'status.modified': 'blue bold', |
110 'status.removed': 'red bold', | 110 'status.removed': 'red bold', |
111 'status.unknown': 'magenta bold underline', | 111 'status.unknown': 'magenta bold underline'} |
112 'ui.labeled': 'none', | |
113 'ui.plain': 'none'} | |
114 | 112 |
115 | 113 |
116 def render_effects(text, effects): | 114 def render_effects(text, effects): |
117 'Wrap text in commands to turn on each effect.' | 115 'Wrap text in commands to turn on each effect.' |
118 if not text: | 116 if not text: |
142 % (e, status)) | 140 % (e, status)) |
143 _styles[status] = ' '.join(good) | 141 _styles[status] = ' '.join(good) |
144 | 142 |
145 _buffers = None | 143 _buffers = None |
146 def style(msg, label): | 144 def style(msg, label): |
147 if label in ('ui.plain', 'ui.labeled'): | |
148 return msg | |
149 effects = [] | 145 effects = [] |
150 for l in label.split(): | 146 for l in label.split(): |
151 s = _styles.get(l, '') | 147 s = _styles.get(l, '') |
152 if s: | 148 if s: |
153 effects.append(s) | 149 effects.append(s) |