Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 20328:03d345da0579 stable
dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
Before this patch, shell alias may be executed by abbreviated command
name unexpectedly, even if abbreviated command name matches also
against the command provided by extension.
For example, "rebate" shell alias is executed by "hg reba", even if
rebase extension (= "rebase" command) is enabled. In this case, "hg
reba" should be aborted because of command name ambiguity.
This patch makes "_checkshellalias()" invoke "cmdutil.findcmd()"
always with "strict=True" (default value).
If abbreviated command name matches against only one shell alias even
after loading extensions, such shell alias will be executed via
"_parse()".
This patch doesn't remove "_checkshellalias()" invocation itself,
because it may prevent shell alias from loading extensions uselessly.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 29 Jan 2014 23:47:54 +0900 |
parents | 8f4a226c840c |
children | 69a0d22b9677 |
comparison
equal
deleted
inserted
replaced
20327:46c2331fc750 | 20328:03d345da0579 |
---|---|
633 cmdtable = commands.table.copy() | 633 cmdtable = commands.table.copy() |
634 addaliases(lui, cmdtable) | 634 addaliases(lui, cmdtable) |
635 | 635 |
636 cmd = args[0] | 636 cmd = args[0] |
637 try: | 637 try: |
638 aliases, entry = cmdutil.findcmd(cmd, cmdtable, | 638 aliases, entry = cmdutil.findcmd(cmd, cmdtable) |
639 lui.configbool("ui", "strict")) | |
640 except (error.AmbiguousCommand, error.UnknownCommand): | 639 except (error.AmbiguousCommand, error.UnknownCommand): |
641 restorecommands() | 640 restorecommands() |
642 return | 641 return |
643 | 642 |
644 cmd = aliases[0] | 643 cmd = aliases[0] |