allow use of extensions in python hooks
extensions are loaded with hgext_ prefix, try to use them if
the module is not found in the normal path
--- a/mercurial/localrepo.py Thu Jun 29 15:16:25 2006 +0200
+++ b/mercurial/localrepo.py Sun Jul 09 11:10:11 2006 +0200
@@ -101,9 +101,13 @@
try:
obj = __import__(modname)
except ImportError:
- raise util.Abort(_('%s hook is invalid '
- '(import of "%s" failed)') %
- (hname, modname))
+ try:
+ # extensions are loaded with hgext_ prefix
+ obj = __import__("hgext_%s" % modname)
+ except ImportError:
+ raise util.Abort(_('%s hook is invalid '
+ '(import of "%s" failed)') %
+ (hname, modname))
try:
for p in funcname.split('.')[1:]:
obj = getattr(obj, p)