changeset 12933:7a2bca0b1e70

merge with stable
author Matt Mackall <mpm@selenic.com>
date Fri, 05 Nov 2010 15:38:23 -0500
parents 7ff1c4542b9d (current diff) ab93029ab622 (diff)
children 98b79c892768
files
diffstat 2 files changed, 35 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Fri Nov 05 15:35:39 2010 +0100
+++ b/mercurial/dispatch.py	Fri Nov 05 15:38:23 2010 -0500
@@ -453,7 +453,7 @@
     cmd = args[0]
     try:
         aliases, entry = cmdutil.findcmd(cmd, cmdtable, lui.config("ui", "strict"))
-    except error.UnknownCommand:
+    except (error.AmbiguousCommand, error.UnknownCommand):
         commands.norepo = norepo
         os.chdir(cwd)
         return
--- a/tests/test-alias.t	Fri Nov 05 15:35:39 2010 +0100
+++ b/tests/test-alias.t	Fri Nov 05 15:38:23 2010 -0500
@@ -29,6 +29,11 @@
   > mcount = !hg log \$@ --template='.' | wc -c | sed -e 's/ //g'
   > rt = root
   > tglog = glog --template "{rev}:{node|short}: '{desc}' {branches}\n"
+  > idalias = id
+  > idaliaslong = id
+  > idaliasshell = !echo test
+  > parentsshell1 = !echo one
+  > parentsshell2 = !echo two
   > 
   > [defaults]
   > mylog = -q
@@ -194,6 +199,35 @@
   o  0:e63c23eaa88a: 'foo'
   
 
+
+shadowing
+
+  $ hg i
+  hg: command 'i' is ambiguous:
+      idalias idaliaslong idaliasshell identify import incoming init
+  [255]
+  $ hg id
+  7e7f92de180e tip
+  $ hg ida
+  hg: command 'ida' is ambiguous:
+      idalias idaliaslong idaliasshell
+  [255]
+  $ hg idalias
+  7e7f92de180e tip
+  $ hg idaliasl
+  7e7f92de180e tip
+  $ hg idaliass
+  test
+  $ hg parentsshell
+  hg: command 'parentsshell' is ambiguous:
+      parentsshell1 parentsshell2
+  [255]
+  $ hg parentsshell1
+  one
+  $ hg parentsshell2
+  two
+
+
 shell aliases with global options
 
   $ hg init sub