Backed out changeset 10ebb9f44b99
authorChristian Ebert <blacktrash@gmx.net>
Thu, 12 Jun 2008 02:33:41 +0200
changeset 459 df56cd11458d
parent 455 10ebb9f44b99
child 460 d9aae4cd69be
Backed out changeset 10ebb9f44b99 Tests with "hg annotate" reveal that dispatch._runcommand is unreliable for our purpose.
hgkw/keyword.py
--- a/hgkw/keyword.py	Sun Jun 01 23:47:32 2008 +0200
+++ b/hgkw/keyword.py	Thu Jun 12 02:33:41 2008 +0200
@@ -410,7 +410,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':
@@ -419,12 +419,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.