changeset 12779:891ddf76b73e

extensions.load: return module Makes extensions.load return the module that it has loaded. This is done so that callers can get information on this module, which e.g. can be used for generating docs.
author Erik Zielke <ez@aragost.com>
date Tue, 19 Oct 2010 13:43:40 +0200
parents dce09f82f619
children bdc1cf692447
files mercurial/extensions.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Tue Oct 19 13:39:34 2010 +0200
+++ b/mercurial/extensions.py	Tue Oct 19 13:43:40 2010 +0200
@@ -46,7 +46,7 @@
     else:
         shortname = name
     if shortname in _extensions:
-        return
+        return _extensions[shortname]
     _extensions[shortname] = None
     if path:
         # the module will be loaded in sys.modules
@@ -66,6 +66,7 @@
             mod = importh(name)
     _extensions[shortname] = mod
     _order.append(shortname)
+    return mod
 
 def loadall(ui):
     result = ui.configitems("extensions")