diff tests/test-extension @ 10364:de1e7099d100

dispatch: provide help for disabled extensions and commands Before a command is declared unknown, each extension in hgext is searched, starting with hgext.<cmdname>. If there's a matching command, a help message suggests the appropriate extension and how to enable it. Every extension could potentially be imported, but for cases like rebase, relink, etc. only one extension is imported. For the case of "hg help disabledext", if the extension is in hgext, the extension description is read and a similar help suggestion is printed. No extension import occurs.
author Brodie Rao <me+hg@dackz.net>
date Sun, 07 Feb 2010 14:01:43 +0100
parents 4ce13d7c6b88
children 181cbb23572e
line wrap: on
line diff
--- a/tests/test-extension	Sun Feb 07 11:32:08 2010 +0100
+++ b/tests/test-extension	Sun Feb 07 14:01:43 2010 +0100
@@ -153,3 +153,27 @@
 
 echo % show extensions
 hg debugextensions
+
+echo '% disabled extension commands'
+HGRCPATH=
+hg help email
+hg qdel
+hg churn
+echo '% disabled extensions'
+hg help churn
+hg help patchbomb
+echo '% broken disabled extension and command'
+mkdir hgext
+echo > hgext/__init__.py
+cat > hgext/broken.py <<EOF
+"broken extension'
+EOF
+TMPPYTHONPATH="$PYTHONPATH"
+PYTHONPATH="`pwd`:$PYTHONPATH"
+export PYTHONPATH
+hg help broken
+hg help foo > /dev/null
+PYTHONPATH="$TMPPYTHONPATH"
+export PYTHONPATH
+
+exit 0