add 'uisetup' function to extension module protocol.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Sun, 21 May 2006 22:14:11 -0700
changeset 2330 b30aa02c85e7
parent 2312 4f04368423ec
child 2331 953dbfb2824c
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.
mercurial/commands.py
--- a/mercurial/commands.py	Thu May 18 16:49:45 2006 -0700
+++ b/mercurial/commands.py	Sun May 21 22:14:11 2006 -0700
@@ -3291,6 +3291,9 @@
             continue
 
     for x in external:
+        uisetup = getattr(x, 'uisetup', None)
+        if uisetup:
+            uisetup(u)
         cmdtable = getattr(x, 'cmdtable', {})
         for t in cmdtable:
             if t in table: