debugcommands: add support for extensions adding their own debug info
We've had a couple of cases where it'd be handy at Google to add data
to `hg debuginstall`'s output. We've kludged around that at various
times, but it seems reasonable to let extensions add their own data
here so extension maintainers can get useful extra data.
Differential Revision: https://phab.mercurial-scm.org/D6681
--- a/mercurial/debugcommands.py Tue Jul 23 14:36:38 2019 -0400
+++ b/mercurial/debugcommands.py Tue Jul 23 14:37:51 2019 -0400
@@ -1383,6 +1383,11 @@
fm.condwrite(err, 'usernameerror', _("checking username...\n %s\n"
" (specify a username in your configuration file)\n"), err)
+ for name, mod in extensions.extensions():
+ handler = getattr(mod, 'debuginstall', None)
+ if handler is not None:
+ problems += handler(ui, fm)
+
fm.condwrite(not problems, '',
_("no problems detected\n"))
if not problems: