Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 2330:b30aa02c85e7
add 'uisetup' function to extension module protocol.
if uisetup functin exists in extension, is called before cmdtable examined.
called with ui object as parameter. lets module modify cmdtable before
commands.py sees it.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Sun, 21 May 2006 22:14:11 -0700 |
parents | b2f37c7026ca |
children | 953dbfb2824c |
comparison
equal
deleted
inserted
replaced
2312:4f04368423ec | 2330:b30aa02c85e7 |
---|---|
3289 traceback.print_exc() | 3289 traceback.print_exc() |
3290 return 1 | 3290 return 1 |
3291 continue | 3291 continue |
3292 | 3292 |
3293 for x in external: | 3293 for x in external: |
3294 uisetup = getattr(x, 'uisetup', None) | |
3295 if uisetup: | |
3296 uisetup(u) | |
3294 cmdtable = getattr(x, 'cmdtable', {}) | 3297 cmdtable = getattr(x, 'cmdtable', {}) |
3295 for t in cmdtable: | 3298 for t in cmdtable: |
3296 if t in table: | 3299 if t in table: |
3297 u.warn(_("module %s overrides %s\n") % (x.__name__, t)) | 3300 u.warn(_("module %s overrides %s\n") % (x.__name__, t)) |
3298 table.update(cmdtable) | 3301 table.update(cmdtable) |