[PATCH 1 of 2] When failing to load an extension, show where Hg tried to load it from

Thomas Arendsen Hein thomas at intevation.de
Sun Mar 2 14:07:26 CST 2008


* Jesse Glick <Jesse.Glick at sun.com> [20080127 20:21]:
> # HG changeset patch
> # User Jesse Glick <jesse.glick at sun.com>
> # Date 1201458305 18000
> # Node ID 67fa45ab91165524776db508e5b789ffdc371ae9
> # Parent  ed4d55c2366f1bd5fbb6b7ce39dff7fe959802b7
> When failing to load an extension, show where Hg tried to load it from.
> 
> diff --git a/mercurial/extensions.py b/mercurial/extensions.py
> --- a/mercurial/extensions.py
> +++ b/mercurial/extensions.py
> @@ -78,8 +78,8 @@ def loadall(ui):
>          except (util.SignalInterrupt, KeyboardInterrupt):
>              raise
>          except Exception, inst:
> -            ui.warn(_("*** failed to import extension %s: %s\n") %
> -                    (name, inst))
> +            ui.warn(_("*** failed to import extension %s from %s: %s\n")
> +                    % (name, path, inst))
>              if ui.print_exc():
>                  return 1

This doesn't look good for extensions defined with
[extensions]
foo =

(i.e. without a path specified so the sys.path is used)

Example:
*** failed to import extension foo from : invalid syntax (foo.py, line 40)

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial-devel mailing list