Patchwork D6681: debugcommands: add support for extensions adding their own debug info

login
register
mail settings
Submitter phabricator
Date July 23, 2019, 7:40 p.m.
Message ID <differential-rev-PHID-DREV-ulasx7qwogb4qzxwqrex-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41028/
State Superseded
Headers show

Comments

phabricator - July 23, 2019, 7:40 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6681

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - July 24, 2019, 9:16 a.m.
This revision is now accepted and ready to land.
pulkit added a comment.
pulkit accepted this revision.


  Maybe worth to add about this in relnotes for 5.2

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6681/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6681

To: durin42, #hg-reviewers, pulkit
Cc: pulkit, mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -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: