Commit Graph

16 Commits

Author SHA1 Message Date
Mads Kiilerich
5e49c62ca7 test-extension: changed environment variables must be exported again
This fixes failure on Solaris because HGRCPATH wasn't unset.
2010-05-01 19:24:46 +02:00
Brodie Rao
1ca609f2f6 test-extension: fix disabled extension tests for run-tests.py --local
One test that requires inserting a broken extension into hgext does this
by modifying PYTHONPATH. This doesn't work when run with --local because
the 'hg' script being used is in the same directory as the local hgext.

Instead of modifying PYTHONPATH, a secondary extension is enabled using
--config that inserts the dummy hgext at the beginning of sys.path,
before the script's path.
2010-03-05 17:38:02 -05:00
Brodie Rao
91c6eab10f 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.
2010-02-07 14:01:43 +01:00
Mads Kiilerich
5b4c840b88 test-extension: Solaris grep don't know [[:digit:]] 2009-11-08 18:50:39 +01:00
Yuya Nishihara
f47e5449d8 hgweb: added test case for extension loading phases (issue1824)
this checks the order of module loading phases of hgweb.

`4) reposetup' lines are duplicated because hgweb calls
hg.repository() twice, one by __init__, another by refresh.
2009-10-28 23:59:18 +09:00
Martin Geisler
559ff1708d extensions: load and configure extensions in well-defined phases
Extensions are now loaded with a call-graph like this:

  dispatch._dispatch
      extensions.loadall
          extensions.load
                # add foo module to extensions._extensions
          extensions.load
                # add bar module to extensions._extensions

          foo.uisetup(ui)
          bar.uisetup(ui)

      foo.extsetup()
      bar.extsetup()

      commands.table.update(foo.cmdtable)
      commands.table.update(bar.cmdtable)

  hg.repository
      foo.reposetup(ui, repo)
      bar.reposetup(ui, repo)

The uisetup calls could easily be moved out to dispatch._dispatch, but
have been kept in extensions.loadall since at least TortoiseHg calls
extensions.loadall and expects it to call uisetup.

The extensions.load function called uisetup. It now has an unused ui
argument which has been kept for backwards compatibility.
2009-08-29 00:29:16 +02:00
Dan Villiom Podlaski Christiansen
dcd26b5a01 commands: hide deprecated commands.
A command is considered deprecated if the word "DEPRECATED" is found
in the doc string. Such commands are hidden from non-verbose help.
2009-07-10 13:40:25 +02:00
Matt Mackall
88b13fecec ui: replace parentui mechanism with repo.baseui 2009-04-26 16:50:43 -05:00
Mads Kiilerich
6e4fb4100f tests: Skip tests if they will fail because of outer repo
For different reasons these tests will fail if run in a tmpdir which is in a hg
repo.

The following three tests assumes no .hg in path dirs - I don't know how to
work around that:

* test-dispatch explicitly tests for no repo and expects "abort: There is no
Mercurial repository here (.hg not found)!"

* test-extension expects parentui to be None when not cd'ed to a repo dir

* test-globalopts tests that implicit -R works correctly - that could perhaps be
done from another repo instead of assuming no repo

The following two might be worth investigating further:

* test-convert-svn-sink fails for unknown reasons, starting with "abort:
unresolved merge conflicts (see hg resolve)"

* test-glog gets strange failures when testing "from outer space"
2008-11-27 00:57:31 +01:00
Benoit Boissinot
7ba2d57a89 Do not try to load extensions twice (issue811) 2008-09-09 14:43:12 +02:00
Alexis S. L. Carvalho
cde5fb5024 tests/*: avoid losing the original settings from $HGRCPATH 2007-11-09 20:21:35 -02:00
Alexis S. L. Carvalho
e0b6efcdbf help: avoid traceback if an extension has only debug commands 2007-07-19 19:43:25 -03:00
Brendan Cully
b1034db3e9 Handle extensions with defined but empty cmdtable 2007-06-28 21:16:25 -07:00
Brendan Cully
e96607cf35 extensions: load modules in module/__init__.py form.
For example, convert=/path/to/convert now works.
2007-06-13 13:46:40 -07:00
Alexis S. L. Carvalho
06a58ad86b Try to pass repo.ui to reposetup hooks
The ui object we received in this function may belong to another repo,
which could be confusing from the hook point of view.  Trying to use
the ui object from the newly created repo should avoid this confusion.
2007-02-08 16:31:21 -02:00
Alexis S. L. Carvalho
60b9229aaa install reposetup hook right after loading the extension 2007-02-06 15:43:01 -02:00