Show More
@@ -144,7 +144,8 b' codes).' | |||||
144 |
|
144 | |||
145 | import os |
|
145 | import os | |
146 |
|
146 | |||
147 |
from mercurial import cmdutil, commands, dispatch, extensions, |
|
147 | from mercurial import cmdutil, commands, dispatch, extensions, subrepo, util | |
|
148 | from mercurial import ui as uimod | |||
148 | from mercurial import templater, error |
|
149 | from mercurial import templater, error | |
149 | from mercurial.i18n import _ |
|
150 | from mercurial.i18n import _ | |
150 |
|
151 | |||
@@ -488,7 +489,14 b' def uisetup(ui):' | |||||
488 | extstyles() |
|
489 | extstyles() | |
489 | configstyles(ui_) |
|
490 | configstyles(ui_) | |
490 | return orig(ui_, opts, cmd, cmdfunc) |
|
491 | return orig(ui_, opts, cmd, cmdfunc) | |
|
492 | def colorgit(orig, gitsub, commands, env=None, stream=False, cwd=None): | |||
|
493 | if gitsub.ui._colormode and len(commands) and commands[0] == "diff": | |||
|
494 | # insert the argument in the front, | |||
|
495 | # the end of git diff arguments is used for paths | |||
|
496 | commands.insert(1, '--color') | |||
|
497 | return orig(gitsub, commands, env, stream, cwd) | |||
491 | extensions.wrapfunction(dispatch, '_runcommand', colorcmd) |
|
498 | extensions.wrapfunction(dispatch, '_runcommand', colorcmd) | |
|
499 | extensions.wrapfunction(subrepo.gitsubrepo, '_gitnodir', colorgit) | |||
492 | templater.funcs['label'] = templatelabel |
|
500 | templater.funcs['label'] = templatelabel | |
493 |
|
501 | |||
494 | def extsetup(ui): |
|
502 | def extsetup(ui): |
General Comments 0
You need to be logged in to leave comments.
Login now