[PATCH 1 of 3] keyword: monkeypatch dispatch._runcommand instead of _parse

Dirkjan Ochtman dirkjan at ochtman.nl
Mon Jun 2 06:56:02 CDT 2008


Christian Ebert <blacktrash <at> gmx.net> writes:
> +        def kwdispatch_runcommand(ui, options, cmd, cmdfunc):
>              kwtools['hgcmd'] = cmd
> -            return cmd, func, args, options, cmdoptions
> +            return dispatch_runcommand(ui, options, cmd, cmdfunc)
> 
> -        dispatch_parse = dispatch._parse
> -        dispatch._parse = kwdispatch_parse
> +        dispatch_runcommand = dispatch._runcommand
> +        dispatch._runcommand = kwdispatch_runcommand

I think this might be a bit easier to read if you define dispatch_runcommand
before defining kwdispatch_runcommand.

Cheers,

Dirkjan



More information about the Mercurial-devel mailing list