mercurial/dispatch.py
branchstable
changeset 22377 f98abe3146b2
parent 22376 d821fff9b0b9
child 22378 c828b61e0635
--- a/mercurial/dispatch.py	Wed Sep 10 00:41:44 2014 +0900
+++ b/mercurial/dispatch.py	Wed Sep 10 00:41:44 2014 +0900
@@ -644,6 +644,7 @@
         return
 
     if precheck:
+        strict = True
         norepo = commands.norepo
         optionalrepo = commands.optionalrepo
         def restorecommands():
@@ -652,13 +653,14 @@
         cmdtable = commands.table.copy()
         addaliases(lui, cmdtable)
     else:
+        strict = False
         def restorecommands():
             pass
         cmdtable = commands.table
 
     cmd = args[0]
     try:
-        aliases, entry = cmdutil.findcmd(cmd, cmdtable)
+        aliases, entry = cmdutil.findcmd(cmd, cmdtable, strict)
     except (error.AmbiguousCommand, error.UnknownCommand):
         restorecommands()
         return
@@ -715,6 +717,14 @@
 
     addaliases(lui, commands.table)
 
+    if not lui.configbool("ui", "strict"):
+        # All aliases and commands are completely defined, now.
+        # Check abbreviation/ambiguity of shell alias again, because shell
+        # alias may cause failure of "_parse" (see issue4355)
+        shellaliasfn = _checkshellalias(lui, ui, args, precheck=False)
+        if shellaliasfn:
+            return shellaliasfn()
+
     # check for fallback encoding
     fallback = lui.config('ui', 'fallbackencoding')
     if fallback: