equal
deleted
inserted
replaced
211 try: |
211 try: |
212 orig(ui, repo, *pats, **opts) |
212 orig(ui, repo, *pats, **opts) |
213 finally: |
213 finally: |
214 ui.write = oldwrite |
214 ui.write = oldwrite |
215 |
215 |
|
216 def colorchurn(orig, ui, repo, *pats, **opts): |
|
217 '''run the churn command with colored output''' |
|
218 if not opts.get('diffstat'): |
|
219 return orig(ui, repo, *pats, **opts) |
|
220 oldwrite = extensions.wrapfunction(ui, 'write', colordiffstat) |
|
221 try: |
|
222 orig(ui, repo, *pats, **opts) |
|
223 finally: |
|
224 ui.write = oldwrite |
|
225 |
216 _diff_prefixes = [('diff', 'diffline'), |
226 _diff_prefixes = [('diff', 'diffline'), |
217 ('copy', 'extended'), |
227 ('copy', 'extended'), |
218 ('rename', 'extended'), |
228 ('rename', 'extended'), |
219 ('old', 'extended'), |
229 ('old', 'extended'), |
220 ('new', 'extended'), |
230 ('new', 'extended'), |
257 except KeyError: |
267 except KeyError: |
258 rec = None |
268 rec = None |
259 |
269 |
260 if mq and rec: |
270 if mq and rec: |
261 _setupcmd(ui, 'qrecord', rec.cmdtable, colordiff, _diff_effects) |
271 _setupcmd(ui, 'qrecord', rec.cmdtable, colordiff, _diff_effects) |
262 |
272 try: |
|
273 churn = extensions.find('churn') |
|
274 _setupcmd(ui, 'churn', churn.cmdtable, colorchurn, _diff_effects) |
|
275 except KeyError: |
|
276 churn = None |
263 |
277 |
264 def _setupcmd(ui, cmd, table, func, effectsmap): |
278 def _setupcmd(ui, cmd, table, func, effectsmap): |
265 '''patch in command to command table and load effect map''' |
279 '''patch in command to command table and load effect map''' |
266 def nocolor(orig, *args, **opts): |
280 def nocolor(orig, *args, **opts): |
267 |
281 |