##// END OF EJS Templates
color: add support for churn --diffstat
Alexander Solovyov -
r10004:af04a3de default
parent child Browse files
Show More
@@ -213,6 +213,16 b' def colordiff(orig, ui, repo, *pats, **o'
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'),
@@ -259,7 +269,11 b' def extsetup(ui):'
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'''
General Comments 0
You need to be logged in to leave comments. Login now