alias: pass local ui to shell alias
authorMatt Mackall <mpm@selenic.com>
Fri, 15 Jul 2011 18:03:37 -0500
changeset 14888 946f4381c1cb
parent 14887 d6ba373c9a8f
child 14890 28abca72c46c
alias: pass local ui to shell alias This avoids an additional config read
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Fri Jul 15 16:06:54 2011 -0500
+++ b/mercurial/dispatch.py	Fri Jul 15 18:03:37 2011 -0500
@@ -481,7 +481,7 @@
 
     return path, lui
 
-def _checkshellalias(ui, args):
+def _checkshellalias(lui, ui, args):
     norepo = commands.norepo
     options = {}
 
@@ -493,8 +493,6 @@
     if not args:
         return
 
-    path, lui = _getlocal(ui, [options['repository']])
-
     cmdtable = commands.table.copy()
     addaliases(lui, cmdtable)
 
@@ -533,7 +531,7 @@
 
     # Now that we're operating in the right directory/repository with
     # the right config settings, check for shell aliases
-    shellaliasfn = _checkshellalias(ui, args)
+    shellaliasfn = _checkshellalias(lui, ui, args)
     if shellaliasfn:
         return shellaliasfn()