# HG changeset patch # User Greg Ward # Date 2011-10-01 20:42:39 # Node ID 56da00994067977f1e4377020b2a9aabccdafee7 # Parent 62dc0e7ab092e10cb8dee3eac16108073dd71cea 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. diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -69,7 +69,9 @@ def load(ui, name, path): 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)