diff mercurial/commands.py @ 30462:356406ac454f

debuginstall: print compression engine support Since compression engines may be provided by extensions and since not all registered compression engines may be available to use, it seems useful to provide a mechanism to see the state of known compression engines. This commit teaches `hg debuginstall` to print info on known and available compression engines.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Nov 2016 10:54:21 -0800
parents 932b18c95e11
children 13251523b20c
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Nov 20 16:56:21 2016 -0800
+++ b/mercurial/commands.py	Sat Nov 19 10:54:21 2016 -0800
@@ -2579,6 +2579,16 @@
         problems += 1
     fm.condwrite(err, 'extensionserror', " %s\n", err)
 
+    compengines = util.compengines._engines.values()
+    fm.write('compengines', _('checking registered compression engines (%s)\n'),
+             fm.formatlist(sorted(e.name() for e in compengines),
+                           name='compengine', fmt='%s', sep=', '))
+    fm.write('compenginesavail', _('checking available compression engines '
+                                   '(%s)\n'),
+             fm.formatlist(sorted(e.name() for e in compengines
+                                  if e.available()),
+                           name='compengine', fmt='%s', sep=', '))
+
     # templates
     p = templater.templatepaths()
     fm.write('templatedirs', 'checking templates (%s)...\n', ' '.join(p))