changeset 45008:e1ea913da2ed

version: sort extensions by name in verbose mode External extensions can be assigned any name, but presumably most enabled extensions will be internal ones and having them sorted makes it easier to find specific ones if the list is long. The lists in `hg help extensions` are already sorted. Differential Revision: https://phab.mercurial-scm.org/D8671
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 27 Jun 2020 21:45:20 -0400
parents 47a07bbf400a
children 7d494425167c
files mercurial/commands.py tests/test-extension.t
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Jun 27 20:19:41 2020 +0200
+++ b/mercurial/commands.py	Sat Jun 27 21:45:20 2020 -0400
@@ -7830,7 +7830,7 @@
     names = []
     vers = []
     isinternals = []
-    for name, module in extensions.extensions():
+    for name, module in sorted(extensions.extensions()):
         names.append(name)
         vers.append(extensions.moduleversion(module) or None)
         isinternals.append(extensions.ismoduleinternal(module))
--- a/tests/test-extension.t	Sat Jun 27 20:19:41 2020 +0200
+++ b/tests/test-extension.t	Sat Jun 27 21:45:20 2020 -0400
@@ -1559,8 +1559,8 @@
   
   Enabled extensions:
   
+    strip  internal  
     throw  external  1.twentythree
-    strip  internal  
 
   $ hg version -q --config extensions.throw=throw.py
   Mercurial Distributed SCM (version *) (glob)
@@ -1600,8 +1600,8 @@
 
   $ hg version --config extensions.throw=throw.py --config extensions.strip= \
   > -T'{extensions % "{name}  {pad(ver, 16)}  ({if(bundled, "internal", "external")})\n"}'
+  strip                    (internal)
   throw  1.twentythree     (external)
-  strip                    (internal)
 
 Refuse to load extensions with minimum version requirements