diff mercurial/dispatch.py @ 45954:a120d1c9c704

dispatch: print the version of each extension in the bug report, if available Sometimes the wrong extensions is blamed, so we might as well print the version info for all of them. Additionally, since the internal extensions are never blamed, this is a good way to make the pygit2 version available in a bug report. Differential Revision: https://phab.mercurial-scm.org/D9440
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 27 Nov 2020 15:54:46 -0500
parents d896c958e428
children 7e1b4154cdca
line wrap: on
line diff
--- a/mercurial/dispatch.py	Fri Nov 27 15:45:37 2020 -0500
+++ b/mercurial/dispatch.py	Fri Nov 27 15:54:46 2020 -0500
@@ -1307,12 +1307,22 @@
             + b'\n'
         )
     sysversion = pycompat.sysbytes(sys.version).replace(b'\n', b'')
+
+    def ext_with_ver(x):
+        ext = x[0]
+        ver = extensions.moduleversion(x[1])
+        if ver:
+            ext += b' ' + ver
+        return ext
+
     warning += (
         (_(b"** Python %s\n") % sysversion)
         + (_(b"** Mercurial Distributed SCM (version %s)\n") % util.version())
         + (
             _(b"** Extensions loaded: %s\n")
-            % b", ".join([x[0] for x in sorted(extensions.extensions())])
+            % b", ".join(
+                [ext_with_ver(x) for x in sorted(extensions.extensions())]
+            )
         )
     )
     return warning