# HG changeset patch # User Yuya Nishihara # Date 1494744405 -32400 # Node ID b88d879e468a55854ded7739f501dde1509f78c7 # Parent 9c023179e8d03085c30d29a526046b0e73a4f112 extensions: optionally print hint on import failure Test will be added by the next patch. diff -r 9c023179e8d0 -r b88d879e468a mercurial/extensions.py --- a/mercurial/extensions.py Sun May 14 15:41:27 2017 +0900 +++ b/mercurial/extensions.py Sun May 14 15:46:45 2017 +0900 @@ -172,13 +172,15 @@ try: load(ui, name, path) except Exception as inst: - inst = _forbytes(inst) + msg = _forbytes(inst) if path: ui.warn(_("*** failed to import extension %s from %s: %s\n") - % (name, path, inst)) + % (name, path, msg)) else: ui.warn(_("*** failed to import extension %s: %s\n") - % (name, inst)) + % (name, msg)) + if isinstance(inst, error.Hint) and inst.hint: + ui.warn(_("*** (%s)\n") % inst.hint) ui.traceback() for name in _order[newindex:]: