# HG changeset patch # User Benoit Boissinot # Date 1152436211 -7200 # Node ID 54b15237958981fa6d4c0c3692fc9cd7191e52d5 # Parent a20a1bb0c396937a5ab131bd9219bd6d294ba01b 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 diff -r a20a1bb0c396 -r 54b152379589 mercurial/localrepo.py --- 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)