extensions: print some debug info on import failure
authorGreg Ward <greg@gerg.ca>
Sat, 01 Oct 2011 16:42:39 -0400
changeset 15199 56da00994067
parent 15198 62dc0e7ab092
child 15200 797bf1dc1ff8
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.
mercurial/extensions.py
--- 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)