# HG changeset patch # User Brodie Rao # Date 1286731296 18000 # Node ID 33f0682ba8b169a28b38a33188f65be52932ab1b # Parent 0ac7c5c8121ae516d97c1447f5e4f9fc6e154e09 color: add global option in extsetup() instead of globally This prevents side effects from occurring when importing the color extension. diff -r 0ac7c5c8121a -r 33f0682ba8b1 hgext/color.py --- a/hgext/color.py Sun Oct 10 11:05:06 2010 -0500 +++ b/hgext/color.py Sun Oct 10 12:21:36 2010 -0500 @@ -223,10 +223,11 @@ return orig(ui_, opts, cmd, cmdfunc) extensions.wrapfunction(dispatch, '_runcommand', colorcmd) -commands.globalopts.append( - ('', 'color', 'auto', - _("when to colorize (boolean, always, auto, or never)"), - _('TYPE'))) +def extsetup(ui): + commands.globalopts.append( + ('', 'color', 'auto', + _("when to colorize (boolean, always, auto, or never)"), + _('TYPE'))) try: import re, pywintypes, win32console as win32c