Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
28154:47f56b6bfed1 | 28155:7f430b2ac7fd |
---|---|
454 ename = ename.split('.')[-1] | 454 ename = ename.split('.')[-1] |
455 exts[ename] = doc.splitlines()[0].strip() | 455 exts[ename] = doc.splitlines()[0].strip() |
456 | 456 |
457 return exts | 457 return exts |
458 | 458 |
459 def notloaded(): | |
460 '''return short names of extensions that failed to load''' | |
461 return [name for name, mod in _extensions.iteritems() if mod is None] | |
462 | |
459 def moduleversion(module): | 463 def moduleversion(module): |
460 '''return version information from given module as a string''' | 464 '''return version information from given module as a string''' |
461 if (util.safehasattr(module, 'getversion') | 465 if (util.safehasattr(module, 'getversion') |
462 and callable(module.getversion)): | 466 and callable(module.getversion)): |
463 version = module.getversion() | 467 version = module.getversion() |