[PATCH 4 of 6] extensions.load: return module

Erik Zielke ez at aragost.com
Mon Oct 18 07:54:05 CDT 2010


# HG changeset patch
# User Erik Zielke <ez at aragost.com>
# Date 1287405478 -7200
# Node ID b0e7b4e632aa861d09b18f23a4b1d6860904879b
# Parent  2d49a5138a49455cb029bad72f9e38f1e43fb5d3
extensions.load: return module

Makes extensions.load return the module that
it has loaded.

diff -r 2d49a5138a49 -r b0e7b4e632aa mercurial/extensions.py
--- a/mercurial/extensions.py	Mon Oct 18 14:37:56 2010 +0200
+++ b/mercurial/extensions.py	Mon Oct 18 14:37:58 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")


More information about the Mercurial-devel mailing list