Mercurial > hg
comparison hgext/color.py @ 9017:c24c9ce0cdcf
color: don't highlight the summary part of the qseries command
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Sat, 27 Jun 2009 13:09:11 +0200 |
parents | a4ceae3aa7be |
children | 07788bbb35e4 |
comparison
equal
deleted
inserted
replaced
9016:894c5b4be275 | 9017:c24c9ce0cdcf |
---|---|
144 retval = orig(ui, repo, **opts) | 144 retval = orig(ui, repo, **opts) |
145 patches = ui.popbuffer().splitlines() | 145 patches = ui.popbuffer().splitlines() |
146 for patch in patches: | 146 for patch in patches: |
147 patchname = patch | 147 patchname = patch |
148 if opts['summary']: | 148 if opts['summary']: |
149 patchname = patchname.split(': ')[0] | 149 patchname = patchname.split(': ', 1)[0] |
150 if ui.verbose: | 150 if ui.verbose: |
151 patchname = patchname.split(' ', 2)[-1] | 151 patchname = patchname.lstrip().split(' ', 2)[-1] |
152 | 152 |
153 if opts['missing']: | 153 if opts['missing']: |
154 effects = _patch_effects['missing'] | 154 effects = _patch_effects['missing'] |
155 # Determine if patch is applied. | 155 # Determine if patch is applied. |
156 elif [ applied for applied in repo.mq.applied | 156 elif [ applied for applied in repo.mq.applied |
157 if patchname == applied.name ]: | 157 if patchname == applied.name ]: |
158 effects = _patch_effects['applied'] | 158 effects = _patch_effects['applied'] |
159 else: | 159 else: |
160 effects = _patch_effects['unapplied'] | 160 effects = _patch_effects['unapplied'] |
161 ui.write(render_effects(patch, effects) + '\n') | 161 |
162 patch = patch.replace(patchname, render_effects(patchname, effects), 1) | |
163 ui.write(patch + '\n') | |
162 return retval | 164 return retval |
163 | 165 |
164 _patch_effects = { 'applied': ['blue', 'bold', 'underline'], | 166 _patch_effects = { 'applied': ['blue', 'bold', 'underline'], |
165 'missing': ['red', 'bold'], | 167 'missing': ['red', 'bold'], |
166 'unapplied': ['black', 'bold'], } | 168 'unapplied': ['black', 'bold'], } |