color: Do not pass --color, --no-color parameters to wrapped function
Passing the --color and --no-color parameter to the wrapped function
can cause a invalid argument exception if the wrapped function doesn't
accepts a **opts dict.
--- a/hgext/color.py Sat Dec 12 16:54:33 2009 +0100
+++ b/hgext/color.py Fri Dec 11 11:04:31 2009 +0100
@@ -282,10 +282,14 @@
if (opts['no_color'] or opts['color'] == 'never' or
(opts['color'] == 'auto' and (os.environ.get('TERM') == 'dumb'
or not sys.__stdout__.isatty()))):
+ del opts['no_color']
+ del opts['color']
return orig(*args, **opts)
oldshowpatch = extensions.wrapfunction(cmdutil.changeset_printer,
'showpatch', colorshowpatch)
+ del opts['no_color']
+ del opts['color']
try:
if func is not None:
return func(orig, *args, **opts)