mercurial/dispatch.py
changeset 14886 9a3831d64ae2
parent 14866 ad6a58581ecd
child 14887 d6ba373c9a8f
--- a/mercurial/dispatch.py	Fri Jul 15 14:27:16 2011 -0500
+++ b/mercurial/dispatch.py	Fri Jul 15 16:06:53 2011 -0500
@@ -526,10 +526,6 @@
     args = req.args
     ui = req.ui
 
-    shellaliasfn = _checkshellalias(ui, args)
-    if shellaliasfn:
-        return shellaliasfn()
-
     # read --config before doing anything else
     # (e.g. to change trust settings for reading .hg/hgrc)
     cfgs = _parseconfig(ui, _earlygetopt(['--config'], args))
@@ -542,6 +538,12 @@
     rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
     path, lui = _getlocal(ui, rpath)
 
+    # Now that we're operating in the right directory/repository with
+    # the right config settings, check for shell aliases
+    shellaliasfn = _checkshellalias(ui, args)
+    if shellaliasfn:
+        return shellaliasfn()
+
     # Configure extensions in phases: uisetup, extsetup, cmdtable, and
     # reposetup. Programs like TortoiseHg will call _dispatch several
     # times so we keep track of configured extensions in _loaded.