diff options
Diffstat (limited to 'tests/test-extension.t')
-rw-r--r-- | tests/test-extension.t | 198 |
1 files changed, 57 insertions, 141 deletions
diff --git a/tests/test-extension.t b/tests/test-extension.t index 0f4be50..1d85b45 100644 --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -1,5 +1,7 @@ Test basic extension support + $ "$TESTDIR/hghave" no-outer-repo || exit 80 + $ cat > foobar.py <<EOF > import os > from mercurial import commands @@ -130,9 +132,6 @@ Check hgweb's load order: $ cd .. -hide outer repo - $ hg init - $ cat > empty.py <<EOF > '''empty cmdtable > ''' @@ -179,27 +178,27 @@ hide outer repo list of commands: - foo yet another foo command + foo: + yet another foo command global options: - - -R --repository REPO repository root directory or name of overlay bundle - file - --cwd DIR change working directory - -y --noninteractive do not prompt, automatically pick the first choice for - all prompts - -q --quiet suppress output - -v --verbose enable additional output - --config CONFIG [+] set/override config option (use 'section.name=value') - --debug enable debugging output - --debugger start debugger - --encoding ENCODE set the charset encoding (default: ascii) - --encodingmode MODE set the charset encoding mode (default: strict) - --traceback always print a traceback on exception - --time time how long the command takes - --profile print command execution profile - --version output version information and exit - -h --help display help and exit + -R --repository REPO repository root directory or name of overlay bundle + file + --cwd DIR change working directory + -y --noninteractive do not prompt, automatically pick the first choice + for all prompts + -q --quiet suppress output + -v --verbose enable additional output + --config CONFIG [+] set/override config option (use 'section.name=value') + --debug enable debugging output + --debugger start debugger + --encoding ENCODE set the charset encoding (default: ascii) + --encodingmode MODE set the charset encoding mode (default: strict) + --traceback always print a traceback on exception + --time time how long the command takes + --profile print command execution profile + --version output version information and exit + -h --help display help and exit [+] marked option can be specified multiple times @@ -208,28 +207,29 @@ hide outer repo list of commands: - debugfoobar yet another debug command - foo yet another foo command + debugfoobar: + yet another debug command + foo: + yet another foo command global options: - - -R --repository REPO repository root directory or name of overlay bundle - file - --cwd DIR change working directory - -y --noninteractive do not prompt, automatically pick the first choice for - all prompts - -q --quiet suppress output - -v --verbose enable additional output - --config CONFIG [+] set/override config option (use 'section.name=value') - --debug enable debugging output - --debugger start debugger - --encoding ENCODE set the charset encoding (default: ascii) - --encodingmode MODE set the charset encoding mode (default: strict) - --traceback always print a traceback on exception - --time time how long the command takes - --profile print command execution profile - --version output version information and exit - -h --help display help and exit + -R --repository REPO repository root directory or name of overlay bundle + file + --cwd DIR change working directory + -y --noninteractive do not prompt, automatically pick the first choice + for all prompts + -q --quiet suppress output + -v --verbose enable additional output + --config CONFIG [+] set/override config option (use 'section.name=value') + --debug enable debugging output + --debugger start debugger + --encoding ENCODE set the charset encoding (default: ascii) + --encodingmode MODE set the charset encoding mode (default: strict) + --traceback always print a traceback on exception + --time time how long the command takes + --profile print command execution profile + --version output version information and exit + -h --help display help and exit [+] marked option can be specified multiple times $ echo 'debugextension = !' >> $HGRCPATH @@ -260,16 +260,16 @@ Extension module help vs command help: options: - -p --program CMD comparison program to run - -o --option OPT [+] pass option to comparison program - -r --rev REV [+] revision - -c --change REV change made by revision - -I --include PATTERN [+] include names matching the given patterns - -X --exclude PATTERN [+] exclude names matching the given patterns + -p --program CMD comparison program to run + -o --option OPT [+] pass option to comparison program + -r --rev REV [+] revision + -c --change REV change made by revision + -I --include PATTERN [+] include names matching the given patterns + -X --exclude PATTERN [+] exclude names matching the given patterns [+] marked option can be specified multiple times - use "hg -v help extdiff" to show more info + use "hg -v help extdiff" to show global options $ hg help --extension extdiff extdiff extension - command to allow external programs to compare revisions @@ -299,8 +299,7 @@ Extension module help vs command help: # (see http://www.vim.org/scripts/script.php?script_id=102) Non # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in # your .vimrc - vimdiff = gvim -f "+next" \ - "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))" + vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)' Tool arguments can include variables that are expanded at runtime: @@ -326,7 +325,7 @@ Extension module help vs command help: list of commands: - extdiff use external program to diff repository (or selected files) + extdiff use external program to diff repository (or selected files) use "hg -v help extdiff" to show builtin aliases and global options @@ -372,7 +371,7 @@ Test help topic with same name as extension multirevs command - use "hg -v help multirevs" to show more info + use "hg -v help multirevs" to show global options $ hg multirevs hg multirevs: invalid arguments @@ -418,14 +417,14 @@ Disabled extension commands: $ hg help email 'email' is provided by the following extension: - patchbomb command to send changesets as (a series of) patch emails + patchbomb command to send changesets as (a series of) patch emails use "hg help extensions" for information on enabling extensions $ hg qdel hg: unknown command 'qdel' 'qdelete' is provided by the following extension: - mq manage a stack of patches + mq manage a stack of patches use "hg help extensions" for information on enabling extensions [255] @@ -433,7 +432,7 @@ Disabled extension commands: hg: unknown command 'churn' 'churn' is provided by the following extension: - churn command to display statistics about repository history + churn command to display statistics about repository history use "hg help extensions" for information on enabling extensions [255] @@ -472,90 +471,7 @@ Broken disabled extension and command: > cmdtable = None > EOF $ hg --config extensions.path=./path.py help foo > /dev/null - warning: error finding commands in $TESTTMP/hgext/forest.py (glob) + warning: error finding commands in $TESTTMP/hgext/forest.py hg: unknown command 'foo' - warning: error finding commands in $TESTTMP/hgext/forest.py (glob) + warning: error finding commands in $TESTTMP/hgext/forest.py [255] - - $ cat > throw.py <<EOF - > from mercurial import cmdutil, commands - > cmdtable = {} - > command = cmdutil.command(cmdtable) - > class Bogon(Exception): pass - > - > @command('throw', [], 'hg throw') - > def throw(ui, **opts): - > """throws an exception""" - > raise Bogon() - > commands.norepo += " throw" - > EOF -No declared supported version, extension complains: - $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' - ** Unknown exception encountered with possibly-broken third-party extension throw - ** which supports versions unknown of Mercurial. - ** Please disable throw and try your action again. - ** If that fixes the bug please report it to the extension author. - ** Python * (glob) - ** Mercurial Distributed SCM * (glob) - ** Extensions loaded: throw -If the extension specifies a buglink, show that: - $ echo 'buglink = "http://example.com/bts"' >> throw.py - $ rm -f throw.pyc throw.pyo - $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' - ** Unknown exception encountered with possibly-broken third-party extension throw - ** which supports versions unknown of Mercurial. - ** Please disable throw and try your action again. - ** If that fixes the bug please report it to http://example.com/bts - ** Python * (glob) - ** Mercurial Distributed SCM (*) (glob) - ** Extensions loaded: throw -If the extensions declare outdated versions, accuse the older extension first: - $ echo "from mercurial import util" >> older.py - $ echo "util.version = lambda:'2.2'" >> older.py - $ echo "testedwith = '1.9.3'" >> older.py - $ echo "testedwith = '2.1.1'" >> throw.py - $ rm -f throw.pyc throw.pyo - $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ - > throw 2>&1 | egrep '^\*\*' - ** Unknown exception encountered with possibly-broken third-party extension older - ** which supports versions 1.9.3 of Mercurial. - ** Please disable older and try your action again. - ** If that fixes the bug please report it to the extension author. - ** Python * (glob) - ** Mercurial Distributed SCM (version 2.2) - ** Extensions loaded: throw, older -One extension only tested with older, one only with newer versions: - $ echo "util.version = lambda:'2.1.0'" >> older.py - $ rm -f older.pyc older.pyo - $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ - > throw 2>&1 | egrep '^\*\*' - ** Unknown exception encountered with possibly-broken third-party extension older - ** which supports versions 1.9.3 of Mercurial. - ** Please disable older and try your action again. - ** If that fixes the bug please report it to the extension author. - ** Python * (glob) - ** Mercurial Distributed SCM (version 2.1.0) - ** Extensions loaded: throw, older -Older extension is tested with current version, the other only with newer: - $ echo "util.version = lambda:'1.9.3'" >> older.py - $ rm -f older.pyc older.pyo - $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ - > throw 2>&1 | egrep '^\*\*' - ** Unknown exception encountered with possibly-broken third-party extension throw - ** which supports versions 2.1.1 of Mercurial. - ** Please disable throw and try your action again. - ** If that fixes the bug please report it to http://example.com/bts - ** Python * (glob) - ** Mercurial Distributed SCM (version 1.9.3) - ** Extensions loaded: throw, older - -Declare the version as supporting this hg version, show regular bts link: - $ hgver=`python -c 'from mercurial import util; print util.version().split("+")[0]'` - $ echo 'testedwith = """'"$hgver"'"""' >> throw.py - $ rm -f throw.pyc throw.pyo - $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' - ** unknown exception encountered, please report by visiting - ** http://mercurial.selenic.com/wiki/BugTracker - ** Python * (glob) - ** Mercurial Distributed SCM (*) (glob) - ** Extensions loaded: throw |