Mercurial > hg
changeset 29838:8540133f91a1
version: always build list of extension versions
This patch just moves "if ui.verbose:" to the inner loop, as preparation
for formatter support.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 16 Aug 2016 16:03:09 +0900 |
parents | 5b886289a1ca |
children | 110ed1868f86 |
files | mercurial/commands.py tests/test-extension.t |
diffstat | 2 files changed, 18 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Mar 13 19:59:39 2016 +0900 +++ b/mercurial/commands.py Tue Aug 16 16:03:09 2016 +0900 @@ -7255,21 +7255,21 @@ )) ui.note(_("\nEnabled extensions:\n\n")) - if ui.verbose: - # 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): + # 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): + if ui.verbose: ui.write(" %-*s %s %s\n" % (maxnamelen, name, place[i], vers[i]))
--- a/tests/test-extension.t Sun Mar 13 19:59:39 2016 +0900 +++ b/tests/test-extension.t Tue Aug 16 16:03:09 2016 +0900 @@ -1236,6 +1236,9 @@ throw external 1.twentythree + $ hg version -q --config extensions.throw=throw.py + Mercurial Distributed SCM (version *) (glob) + Refuse to load extensions with minimum version requirements $ cat > minversion1.py << EOF