# HG changeset patch # User Simon Heimberg # Date 1250376084 -7200 # Node ID 8e6019b16a7dbca67f5bf8c30f7022c98943f43d # Parent 1c83938b6a8e083228d7dbfed681dd91d3952a5e extensions: pass ui arguement to extsetup if accepted diff -r 1c83938b6a8e -r 8e6019b16a7d mercurial/dispatch.py --- a/mercurial/dispatch.py Sat Aug 29 00:29:16 2009 +0200 +++ b/mercurial/dispatch.py Sun Aug 16 00:41:24 2009 +0200 @@ -360,7 +360,12 @@ for name, module in exts: extsetup = getattr(module, 'extsetup', None) if extsetup: - extsetup() + try: + extsetup(ui) + except TypeError: + if extsetup.func_code.co_argcount != 0: + raise + extsetup() # old extsetup with no ui argument for name, module in exts: cmdtable = getattr(module, 'cmdtable', {})