# HG changeset patch # User Christian Ebert # Date 1213230938 -7200 # Node ID d9aae4cd69be0d825ad900e59d55ed42706582fa # Parent 5e2be38cb3dd274f4018d85450fd625e1a1ce7bc# Parent df56cd11458dc0f0c3a9778750d1ebf77c33b3a0 Merge after backout Revert to dispatch._parse for grabbing current command name. diff -r 5e2be38cb3dd -r d9aae4cd69be hgkw/keyword.py --- a/hgkw/keyword.py Fri Jun 06 17:08:56 2008 +0200 +++ b/hgkw/keyword.py Thu Jun 12 02:35:38 2008 +0200 @@ -412,7 +412,7 @@ def uisetup(ui): '''Collects [keyword] config in kwtools. - Monkeypatch dispatch._runcommand if needed to grab command for kwtools.''' + Monkeypatches dispatch._parse if needed.''' for pat, opt in ui.configitems('keyword'): if opt != 'ignore': @@ -421,12 +421,14 @@ kwtools['exc'].append(pat) if kwtools['inc']: - def kwdispatch_runcommand(ui, options, cmd, cmdfunc): + def kwdispatch_parse(ui, args): + '''Monkeypatch dispatch._parse to obtain running hg command.''' + cmd, func, args, options, cmdoptions = dispatch_parse(ui, args) kwtools['hgcmd'] = cmd - return dispatch_runcommand(ui, options, cmd, cmdfunc) + return cmd, func, args, options, cmdoptions - dispatch_runcommand = dispatch._runcommand - dispatch._runcommand = kwdispatch_runcommand + dispatch_parse = dispatch._parse + dispatch._parse = kwdispatch_parse def reposetup(ui, repo): '''Sets up repo as kwrepo for keyword substitution.