# HG changeset patch # User Yuya Nishihara # Date 1471330989 -32400 # Node ID 8540133f91a1215759bef1088af1ecefb882fbbd # Parent 5b886289a1ca8fa6716dff4c7b7b80d691c06ca3 version: always build list of extension versions This patch just moves "if ui.verbose:" to the inner loop, as preparation for formatter support. diff -r 5b886289a1ca -r 8540133f91a1 mercurial/commands.py --- 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])) diff -r 5b886289a1ca -r 8540133f91a1 tests/test-extension.t --- 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