Mercurial > hg
changeset 9660:e0eae93e6c67
extensions: changed to call extsetup() from extensions.loadall()
previously uisetup() was invoked by extensions.loadall(), but
extsetup() was by _dispatch().
there's no need to split them because we have nothing to do
between uisetup() and extsetup().
this fixes issue1824 indirectly.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 28 Oct 2009 23:55:23 +0900 |
parents | f53c549237ca |
children | c4f6c02e33c4 |
files | mercurial/dispatch.py mercurial/extensions.py |
diffstat | 2 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dispatch.py Wed Oct 21 13:40:55 2009 +0200 +++ b/mercurial/dispatch.py Wed Oct 28 23:55:23 2009 +0900 @@ -358,17 +358,7 @@ extensions.loadall(lui) exts = [ext for ext in extensions.extensions() if ext[0] not in _loaded] - # (uisetup is handled in extensions.loadall) - - for name, module in exts: - extsetup = getattr(module, 'extsetup', None) - if extsetup: - try: - extsetup(ui) - except TypeError: - if extsetup.func_code.co_argcount != 0: - raise - extsetup() # old extsetup with no ui argument + # (uisetup and extsetup are handled in extensions.loadall) for name, module in exts: cmdtable = getattr(module, 'cmdtable', {})
--- a/mercurial/extensions.py Wed Oct 21 13:40:55 2009 +0200 +++ b/mercurial/extensions.py Wed Oct 28 23:55:23 2009 +0900 @@ -93,6 +93,16 @@ if uisetup: uisetup(ui) + for name in _order[newindex:]: + extsetup = getattr(_extensions[name], 'extsetup', None) + if extsetup: + try: + extsetup(ui) + except TypeError: + if extsetup.func_code.co_argcount != 0: + raise + extsetup() # old extsetup with no ui argument + def wrapcommand(table, command, wrapper): aliases, entry = cmdutil.findcmd(command, table) for alias, e in table.iteritems():