extensions: print some debug info on import failure
This is handy if hgext.foo exists but has a bogus "import blah":
previously we just discarded the "No module named blah" error. Now at
least you can see it with --debug. Not perfect, but better than
nothing.
--- a/mercurial/extensions.py Sun Oct 02 14:34:28 2011 -0400
+++ b/mercurial/extensions.py Sat Oct 01 16:42:39 2011 -0400
@@ -69,7 +69,9 @@
return mod
try:
mod = importh("hgext.%s" % name)
- except ImportError:
+ except ImportError, err:
+ ui.debug('could not import hgext.%s (%s): trying %s\n'
+ % (name, err, name))
mod = importh(name)
_extensions[shortname] = mod
_order.append(shortname)