comparison hgext/color.py @ 12693:33f0682ba8b1

color: add global option in extsetup() instead of globally This prevents side effects from occurring when importing the color extension.
author Brodie Rao <brodie@bitheap.org>
date Sun, 10 Oct 2010 12:21:36 -0500
parents c4c2ba553401
children 6bbf0139a36d
comparison
equal deleted inserted replaced
12692:0ac7c5c8121a 12693:33f0682ba8b1
221 extstyles() 221 extstyles()
222 configstyles(ui_) 222 configstyles(ui_)
223 return orig(ui_, opts, cmd, cmdfunc) 223 return orig(ui_, opts, cmd, cmdfunc)
224 extensions.wrapfunction(dispatch, '_runcommand', colorcmd) 224 extensions.wrapfunction(dispatch, '_runcommand', colorcmd)
225 225
226 commands.globalopts.append( 226 def extsetup(ui):
227 ('', 'color', 'auto', 227 commands.globalopts.append(
228 _("when to colorize (boolean, always, auto, or never)"), 228 ('', 'color', 'auto',
229 _('TYPE'))) 229 _("when to colorize (boolean, always, auto, or never)"),
230 _('TYPE')))
230 231
231 try: 232 try:
232 import re, pywintypes, win32console as win32c 233 import re, pywintypes, win32console as win32c
233 234
234 # http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx 235 # http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx