mercurial/extensions.py
changeset 9660 e0eae93e6c67
parent 9610 d78fe60f6bda
child 9679 a1943c2a4661
--- 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():