Show More
@@ -644,6 +644,7 b' def _checkshellalias(lui, ui, args, prec' | |||||
644 | return |
|
644 | return | |
645 |
|
645 | |||
646 | if precheck: |
|
646 | if precheck: | |
|
647 | strict = True | |||
647 | norepo = commands.norepo |
|
648 | norepo = commands.norepo | |
648 | optionalrepo = commands.optionalrepo |
|
649 | optionalrepo = commands.optionalrepo | |
649 | def restorecommands(): |
|
650 | def restorecommands(): | |
@@ -652,13 +653,14 b' def _checkshellalias(lui, ui, args, prec' | |||||
652 | cmdtable = commands.table.copy() |
|
653 | cmdtable = commands.table.copy() | |
653 | addaliases(lui, cmdtable) |
|
654 | addaliases(lui, cmdtable) | |
654 | else: |
|
655 | else: | |
|
656 | strict = False | |||
655 | def restorecommands(): |
|
657 | def restorecommands(): | |
656 | pass |
|
658 | pass | |
657 | cmdtable = commands.table |
|
659 | cmdtable = commands.table | |
658 |
|
660 | |||
659 | cmd = args[0] |
|
661 | cmd = args[0] | |
660 | try: |
|
662 | try: | |
661 | aliases, entry = cmdutil.findcmd(cmd, cmdtable) |
|
663 | aliases, entry = cmdutil.findcmd(cmd, cmdtable, strict) | |
662 | except (error.AmbiguousCommand, error.UnknownCommand): |
|
664 | except (error.AmbiguousCommand, error.UnknownCommand): | |
663 | restorecommands() |
|
665 | restorecommands() | |
664 | return |
|
666 | return | |
@@ -715,6 +717,14 b' def _dispatch(req):' | |||||
715 |
|
717 | |||
716 | addaliases(lui, commands.table) |
|
718 | addaliases(lui, commands.table) | |
717 |
|
719 | |||
|
720 | if not lui.configbool("ui", "strict"): | |||
|
721 | # All aliases and commands are completely defined, now. | |||
|
722 | # Check abbreviation/ambiguity of shell alias again, because shell | |||
|
723 | # alias may cause failure of "_parse" (see issue4355) | |||
|
724 | shellaliasfn = _checkshellalias(lui, ui, args, precheck=False) | |||
|
725 | if shellaliasfn: | |||
|
726 | return shellaliasfn() | |||
|
727 | ||||
718 | # check for fallback encoding |
|
728 | # check for fallback encoding | |
719 | fallback = lui.config('ui', 'fallbackencoding') |
|
729 | fallback = lui.config('ui', 'fallbackencoding') | |
720 | if fallback: |
|
730 | if fallback: |
@@ -353,7 +353,7 b' command provided extension, should be ab' | |||||
353 | > [extensions] |
|
353 | > [extensions] | |
354 | > hgext.rebase = |
|
354 | > hgext.rebase = | |
355 | > [alias] |
|
355 | > [alias] | |
356 |
> rebate = !echo this is |
|
356 | > rebate = !echo this is \$HG_ARGS | |
357 | > EOF |
|
357 | > EOF | |
358 | $ hg reba |
|
358 | $ hg reba | |
359 | hg: command 'reba' is ambiguous: |
|
359 | hg: command 'reba' is ambiguous: | |
@@ -361,6 +361,8 b' command provided extension, should be ab' | |||||
361 | [255] |
|
361 | [255] | |
362 | $ hg rebat |
|
362 | $ hg rebat | |
363 | this is rebate |
|
363 | this is rebate | |
|
364 | $ hg rebat --foo-bar | |||
|
365 | this is rebate --foo-bar | |||
364 |
|
366 | |||
365 | invalid arguments |
|
367 | invalid arguments | |
366 |
|
368 |
General Comments 0
You need to be logged in to leave comments.
Login now