mercurial/dispatch.py
changeset 9411 8e6019b16a7d
parent 9410 1c83938b6a8e
child 9436 96379c93ba6f
--- 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', {})