color: add global option in extsetup() instead of globally
This prevents side effects from occurring when importing the color
extension.
--- 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