# HG changeset patch # User liscju # Date 1454674823 -3600 # Node ID 96bfd28752132d3b8f982fcd5c3a469068a074ec # Parent e77ac31b64a1649185f8357905e55c298383b045 version: verbose list internal and external extension source (issue4731) diff -r e77ac31b64a1 -r 96bfd2875213 mercurial/commands.py --- a/mercurial/commands.py Tue Feb 02 21:20:04 2016 -0800 +++ b/mercurial/commands.py Fri Feb 05 13:20:23 2016 +0100 @@ -7030,10 +7030,16 @@ # format names and versions into columns names = [] vers = [] + place = [] for name, module in extensions.extensions(): names.append(name) vers.append(extensions.moduleversion(module)) + if extensions.ismoduleinternal(module): + place.append(_("internal")) + else: + place.append(_("external")) if names: maxnamelen = max(len(n) for n in names) for i, name in enumerate(names): - ui.write(" %-*s %s\n" % (maxnamelen, name, vers[i])) + ui.write(" %-*s %s %s\n" % + (maxnamelen, name, place[i], vers[i])) diff -r e77ac31b64a1 -r 96bfd2875213 mercurial/extensions.py --- a/mercurial/extensions.py Tue Feb 02 21:20:04 2016 -0800 +++ b/mercurial/extensions.py Fri Feb 05 13:20:23 2016 +0100 @@ -468,3 +468,7 @@ if isinstance(version, (list, tuple)): version = '.'.join(str(o) for o in version) return version + +def ismoduleinternal(module): + exttestedwith = getattr(module, 'testedwith', None) + return exttestedwith == "internal" diff -r e77ac31b64a1 -r 96bfd2875213 tests/test-extension.t --- a/tests/test-extension.t Tue Feb 02 21:20:04 2016 -0800 +++ b/tests/test-extension.t Fri Feb 05 13:20:23 2016 +0100 @@ -1003,7 +1003,7 @@ Enabled extensions: - throw 1.2.3 + throw external 1.2.3 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py $ rm -f throw.pyc throw.pyo $ hg version -v --config extensions.throw=throw.py @@ -1016,7 +1016,7 @@ Enabled extensions: - throw 1.twentythree + throw external 1.twentythree Refuse to load extensions with minimum version requirements