diff mercurial/extensions.py @ 28155:7f430b2ac7fd

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.
author Jun Wu <quark@fb.com>
date Wed, 10 Feb 2016 16:59:34 +0000
parents 96bfd2875213
children 01dc11e7191f
line wrap: on
line diff
--- a/mercurial/extensions.py	Mon Feb 15 14:57:06 2016 +0000
+++ b/mercurial/extensions.py	Wed Feb 10 16:59:34 2016 +0000
@@ -456,6 +456,10 @@
 
     return exts
 
+def notloaded():
+    '''return short names of extensions that failed to load'''
+    return [name for name, mod in _extensions.iteritems() if mod is None]
+
 def moduleversion(module):
     '''return version information from given module as a string'''
     if (util.safehasattr(module, 'getversion')