Merge after backout
Revert to dispatch._parse for grabbing current command name.
--- 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.