# HG changeset patch # User David Soria Parra # Date 2009-12-11 10:04:31 # Node ID d1f9640e9a6717b6c4d8a30d7b94e0052ea8331c # Parent dc5462d94a72c1ca1bb7f32bb2c9a20a0ac0c151 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. diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -282,10 +282,14 @@ def _setupcmd(ui, cmd, table, func, effe 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)