Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 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 | d78fe60f6bda |
children | a1943c2a4661 |
comparison
equal
deleted
inserted
replaced
9659:f53c549237ca | 9660:e0eae93e6c67 |
---|---|
356 # reposetup. Programs like TortoiseHg will call _dispatch several | 356 # reposetup. Programs like TortoiseHg will call _dispatch several |
357 # times so we keep track of configured extensions in _loaded. | 357 # times so we keep track of configured extensions in _loaded. |
358 extensions.loadall(lui) | 358 extensions.loadall(lui) |
359 exts = [ext for ext in extensions.extensions() if ext[0] not in _loaded] | 359 exts = [ext for ext in extensions.extensions() if ext[0] not in _loaded] |
360 | 360 |
361 # (uisetup is handled in extensions.loadall) | 361 # (uisetup and extsetup are handled in extensions.loadall) |
362 | |
363 for name, module in exts: | |
364 extsetup = getattr(module, 'extsetup', None) | |
365 if extsetup: | |
366 try: | |
367 extsetup(ui) | |
368 except TypeError: | |
369 if extsetup.func_code.co_argcount != 0: | |
370 raise | |
371 extsetup() # old extsetup with no ui argument | |
372 | 362 |
373 for name, module in exts: | 363 for name, module in exts: |
374 cmdtable = getattr(module, 'cmdtable', {}) | 364 cmdtable = getattr(module, 'cmdtable', {}) |
375 overrides = [cmd for cmd in cmdtable if cmd in commands.table] | 365 overrides = [cmd for cmd in cmdtable if cmd in commands.table] |
376 if overrides: | 366 if overrides: |