diff mercurial/dispatch.py @ 26263:bf2bfc6f45fb

traceback: allow providing a local support contact point The extensions blaming code is fine for casual users but pretty terrible for corporate environments that can deploy a large amount of extensions to unsuspecting users. Reports will likely blame a random "innocent" extension (in our case crecord) and the hint in the message will triggers endless debug attempts from the user. We introduce a "ui.supportcontact" option that allow such big company to redirect their users to their own support desk. This disables all extensions blaming and just point people to the local support in all cases.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 11 Sep 2015 12:45:19 -0700
parents 3e79ec0ba589
children ccab61d84ea7
line wrap: on
line diff
--- a/mercurial/dispatch.py	Thu Sep 17 11:50:55 2015 -0700
+++ b/mercurial/dispatch.py	Fri Sep 11 12:45:19 2015 -0700
@@ -335,7 +335,7 @@
         compare = myver.split('+')[0]
         ct = tuplever(compare)
         worst = None, ct, ''
-        if True:
+        if ui.config('ui', 'supportcontact', None) is None:
             for name, mod in extensions.extensions():
                 testedwith = getattr(mod, 'testedwith', '')
                 report = getattr(mod, 'buglink', _('the extension author.'))
@@ -367,9 +367,11 @@
                          '** If that fixes the bug please report it to %s\n')
                        % (name, testedwith, name, report))
         else:
+            bugtracker = ui.config('ui', 'supportcontact', None)
+            if bugtracker is None:
+                bugtracker = _("http://mercurial.selenic.com/wiki/BugTracker")
             warning = (_("** unknown exception encountered, "
-                         "please report by visiting\n") +
-                       _("** http://mercurial.selenic.com/wiki/BugTracker\n"))
+                         "please report by visiting\n** ") + bugtracker + '\n')
         warning += ((_("** Python %s\n") % sys.version.replace('\n', '')) +
                     (_("** Mercurial Distributed SCM (version %s)\n") % myver) +
                     (_("** Extensions loaded: %s\n") %