test-extension-timing.t
96 lines
| 3.6 KiB
| text/troff
|
Tads3Lexer
/ tests / test-extension-timing.t
Boris Feld
|
r39543 | Test basic extension support | ||
$ cat > foobar.py <<EOF | ||||
> import os | ||||
> from mercurial import commands, registrar | ||||
> cmdtable = {} | ||||
> command = registrar.command(cmdtable) | ||||
> configtable = {} | ||||
> configitem = registrar.configitem(configtable) | ||||
> configitem(b'tests', b'foo', default=b"Foo") | ||||
> def uisetup(ui): | ||||
> ui.debug(b"uisetup called [debug]\\n") | ||||
> ui.write(b"uisetup called\\n") | ||||
> ui.status(b"uisetup called [status]\\n") | ||||
> ui.flush() | ||||
> def reposetup(ui, repo): | ||||
> ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root)) | ||||
> ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!")) | ||||
> ui.flush() | ||||
> @command(b'foo', [], b'hg foo') | ||||
> def foo(ui, *args, **kwargs): | ||||
> foo = ui.config(b'tests', b'foo') | ||||
> ui.write(foo) | ||||
> ui.write(b"\\n") | ||||
> @command(b'bar', [], b'hg bar', norepo=True) | ||||
> def bar(ui, *args, **kwargs): | ||||
> ui.write(b"Bar\\n") | ||||
> EOF | ||||
$ abspath=`pwd`/foobar.py | ||||
$ mkdir barfoo | ||||
$ cp foobar.py barfoo/__init__.py | ||||
$ barfoopath=`pwd`/barfoo | ||||
$ hg init a | ||||
$ cd a | ||||
$ echo foo > file | ||||
$ hg add file | ||||
$ hg commit -m 'add file' | ||||
$ echo '[extensions]' >> $HGRCPATH | ||||
$ echo "foobar = $abspath" >> $HGRCPATH | ||||
Test extension setup timings | ||||
$ hg foo --traceback --config devel.debug.extensions=yes --debug 2>&1 | ||||
debug.extensions: loading extensions | ||||
debug.extensions: - processing 1 entries | ||||
Augie Fackler
|
r40467 | debug.extensions: - loading extension: foobar | ||
debug.extensions: > foobar extension loaded in * (glob) | ||||
debug.extensions: - validating extension tables: foobar | ||||
debug.extensions: - invoking registered callbacks: foobar | ||||
Boris Feld
|
r39543 | debug.extensions: > callbacks completed in * (glob) | ||
debug.extensions: > loaded 1 extensions, total time * (glob) | ||||
debug.extensions: - loading configtable attributes | ||||
debug.extensions: - executing uisetup hooks | ||||
Augie Fackler
|
r40467 | debug.extensions: - running uisetup for foobar | ||
Boris Feld
|
r39543 | uisetup called [debug] | ||
uisetup called | ||||
uisetup called [status] | ||||
Augie Fackler
|
r40467 | debug.extensions: > uisetup for foobar took * (glob) | ||
Boris Feld
|
r39544 | debug.extensions: > all uisetup took * (glob) | ||
Boris Feld
|
r39543 | debug.extensions: - executing extsetup hooks | ||
Augie Fackler
|
r40467 | debug.extensions: - running extsetup for foobar | ||
debug.extensions: > extsetup for foobar took * (glob) | ||||
Boris Feld
|
r39545 | debug.extensions: > all extsetup took * (glob) | ||
Boris Feld
|
r39543 | debug.extensions: - executing remaining aftercallbacks | ||
debug.extensions: > remaining aftercallbacks completed in * (glob) | ||||
debug.extensions: - loading extension registration objects | ||||
debug.extensions: > extension registration object loading took * (glob) | ||||
Boris Feld
|
r39547 | debug.extensions: > extension foobar take a total of * to load (glob) | ||
Boris Feld
|
r39543 | debug.extensions: extension loading complete | ||
debug.extensions: loading additional extensions | ||||
debug.extensions: - processing 1 entries | ||||
debug.extensions: > loaded 0 extensions, total time * (glob) | ||||
debug.extensions: - loading configtable attributes | ||||
debug.extensions: - executing uisetup hooks | ||||
Boris Feld
|
r39544 | debug.extensions: > all uisetup took * (glob) | ||
Boris Feld
|
r39543 | debug.extensions: - executing extsetup hooks | ||
Boris Feld
|
r39545 | debug.extensions: > all extsetup took * (glob) | ||
Boris Feld
|
r39543 | debug.extensions: - executing remaining aftercallbacks | ||
debug.extensions: > remaining aftercallbacks completed in * (glob) | ||||
debug.extensions: - loading extension registration objects | ||||
debug.extensions: > extension registration object loading took * (glob) | ||||
debug.extensions: extension loading complete | ||||
debug.extensions: - executing reposetup hooks | ||||
debug.extensions: - running reposetup for foobar | ||||
reposetup called for a | ||||
ui == repo.ui | ||||
Augie Fackler
|
r40467 | debug.extensions: > reposetup for foobar took * (glob) | ||
Boris Feld
|
r39546 | debug.extensions: > all reposetup took * (glob) | ||
Boris Feld
|
r39543 | Foo | ||
$ cd .. | ||||
$ echo 'foobar = !' >> $HGRCPATH | ||||