[PATCH V2] extensions: add notloaded method to return extensions failed to load
yuya at tcha.org
Tue Feb 16 09:43:33 EST 2016
On Mon, 15 Feb 2016 15:45:16 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1455123574 0
> # Wed Feb 10 16:59:34 2016 +0000
> # Node ID f618a6ad59097fcb3e696e6e06fbf88915ba0e31
> # Parent a036e1ae1fbe88ab99cb861ebfc2e4da7a3912ca
> extensions: add notloaded method to return extensions failed to load
> Before this patch, there is no easy way to detect if there are extensions
> failed to load. While this is okay for most situations, chgserver is designed
> to preload all extensions specified in config and does need the information.
> This patch adds extensions.notloaded() to return names of extensions failed
> to load.
> diff --git a/mercurial/extensions.py b/mercurial/extensions.py
> --- a/mercurial/extensions.py
> +++ b/mercurial/extensions.py
> @@ -456,6 +456,10 @@
> return exts
> +def notloaded():
> + '''return short names of extensions that failed to load'''
> + return [name for name, mod in _extensions.items() if mod is None]
LGTM. I'll change it to .iteritems() and push to the clowncopter, thanks.
More information about the Mercurial-devel