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
+++ b/mercurial/localrepo.py
@@ -101,9 +101,13 @@ class localrepository(object):
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)