##// END OF EJS Templates
dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"...
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.

File last commit:

r20199:d87ed257 default
r20328:03d345da stable
Show More
test-module-imports.t
39 lines | 1.8 KiB | text/troff | Tads3Lexer
/ tests / test-module-imports.t
This code uses the ast module, which was new in 2.6, so we'll skip
this test on anything earlier.
$ python -c 'import sys ; assert sys.version_info >= (2, 6)' || exit 80
$ import_checker="$TESTDIR"/../contrib/import-checker.py
Run the doctests from the import checker, and make sure
it's working correctly.
$ TERM=dumb
$ export TERM
$ python -m doctest $import_checker
$ cd "$TESTDIR"/..
$ if hg identify -q > /dev/null 2>&1; then :
> else
> echo "skipped: not a Mercurial working dir" >&2
> exit 80
> fi
There are a handful of cases here that require renaming a module so it
doesn't overlap with a stdlib module name. There are also some cycles
here that we should still endeavor to fix, and some cycles will be
hidden by deduplication algorithm in the cycle detector, so fixing
these may expose other cycles.
$ hg locate 'mercurial/**.py' | xargs python "$import_checker"
mercurial/dispatch.py mixed stdlib and relative imports:
commands, error, extensions, fancyopts, hg, hook, util
mercurial/fileset.py mixed stdlib and relative imports:
error, merge, parser, util
mercurial/revset.py mixed stdlib and relative imports:
discovery, error, hbisect, parser, phases, util
mercurial/templater.py mixed stdlib and relative imports:
config, error, parser, templatefilters, util
mercurial/ui.py mixed stdlib and relative imports:
config, error, formatter, scmutil, util
Import cycle: mercurial.cmdutil -> mercurial.subrepo -> mercurial.cmdutil
Import cycle: mercurial.repoview -> mercurial.revset -> mercurial.repoview
Import cycle: mercurial.fileset -> mercurial.merge -> mercurial.subrepo -> mercurial.match -> mercurial.fileset
Import cycle: mercurial.filemerge -> mercurial.match -> mercurial.fileset -> mercurial.merge -> mercurial.filemerge