dispatch: quote the extension when printing the bug report
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 27 Nov 2020 15:39:27 -0500
changeset 45952 a2104b9b1787
parent 45951 c26cb33e5219
child 45953 d896c958e428
dispatch: quote the extension when printing the bug report I think this reads better in the wall of text. Differential Revision: https://phab.mercurial-scm.org/D9438
mercurial/dispatch.py
tests/test-blackbox.t
tests/test-devel-warnings.t
tests/test-extension.t
--- a/mercurial/dispatch.py	Fri Nov 27 14:31:59 2020 -0500
+++ b/mercurial/dispatch.py	Fri Nov 27 15:39:27 2020 -0500
@@ -1289,9 +1289,9 @@
         extver = version or _(b"(version N/A)")
         warning = _(
             b'** Unknown exception encountered with '
-            b'possibly-broken third-party extension %s %s\n'
+            b'possibly-broken third-party extension "%s" %s\n'
             b'** which supports versions %s of Mercurial.\n'
-            b'** Please disable %s and try your action again.\n'
+            b'** Please disable "%s" and try your action again.\n'
             b'** If that fixes the bug please report it to %s\n'
         ) % (name, extver, testedwith, name, stringutil.forcebytestr(report))
     else:
--- a/tests/test-blackbox.t	Fri Nov 27 14:31:59 2020 -0500
+++ b/tests/test-blackbox.t	Fri Nov 27 15:39:27 2020 -0500
@@ -482,7 +482,7 @@
 #endif
 
   $ head -1 .hg/blackbox.log
-  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension mock (version N/A)
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension "mock" (version N/A)
   $ tail -2 .hg/blackbox.log
   RuntimeError: raise
   
--- a/tests/test-devel-warnings.t	Fri Nov 27 14:31:59 2020 -0500
+++ b/tests/test-devel-warnings.t	Fri Nov 27 15:39:27 2020 -0500
@@ -310,9 +310,9 @@
 Test programming error failure:
 
   $ hg buggytransaction 2>&1 | egrep -v '^  '
-  ** Unknown exception encountered with possibly-broken third-party extension buggylocking (version N/A)
+  ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
   ** which supports versions unknown of Mercurial.
-  ** Please disable buggylocking and try your action again.
+  ** Please disable "buggylocking" and try your action again.
   ** If that fixes the bug please report it to the extension author.
   ** Python * (glob)
   ** Mercurial Distributed SCM (*) (glob)
@@ -322,9 +322,9 @@
   *ProgrammingError: transaction requires locking (glob)
 
   $ hg programmingerror 2>&1 | egrep -v '^  '
-  ** Unknown exception encountered with possibly-broken third-party extension buggylocking (version N/A)
+  ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
   ** which supports versions unknown of Mercurial.
-  ** Please disable buggylocking and try your action again.
+  ** Please disable "buggylocking" and try your action again.
   ** If that fixes the bug please report it to the extension author.
   ** Python * (glob)
   ** Mercurial Distributed SCM (*) (glob)
--- a/tests/test-extension.t	Fri Nov 27 14:31:59 2020 -0500
+++ b/tests/test-extension.t	Fri Nov 27 15:39:27 2020 -0500
@@ -1415,9 +1415,9 @@
 
 No declared supported version, extension complains:
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
-  ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
+  ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
   ** which supports versions unknown of Mercurial.
-  ** Please disable throw and try your action again.
+  ** Please disable "throw" and try your action again.
   ** If that fixes the bug please report it to the extension author.
   ** Python * (glob)
   ** Mercurial Distributed SCM * (glob)
@@ -1427,9 +1427,9 @@
 the value is improperly a str instead of bytes):
   $ echo "testedwith = ''" >> throw.py
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
-  ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
+  ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
   ** which supports versions unknown of Mercurial.
-  ** Please disable throw and try your action again.
+  ** Please disable "throw" and try your action again.
   ** If that fixes the bug please report it to the extension author.
   ** Python * (glob)
   ** Mercurial Distributed SCM (*) (glob)
@@ -1441,9 +1441,9 @@
   $ rm -f throw.pyc throw.pyo
   $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
-  ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
+  ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
   ** which supports versions unknown of Mercurial.
-  ** Please disable throw and try your action again.
+  ** Please disable "throw" and try your action again.
   ** If that fixes the bug please report it to http://example.com/bts
   ** Python * (glob)
   ** Mercurial Distributed SCM (*) (glob)
@@ -1458,9 +1458,9 @@
   $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
   >   throw 2>&1 | egrep '^\*\*'
-  ** Unknown exception encountered with possibly-broken third-party extension older (version N/A)
+  ** Unknown exception encountered with possibly-broken third-party extension "older" (version N/A)
   ** which supports versions 1.9 of Mercurial.
-  ** Please disable older and try your action again.
+  ** Please disable "older" and try your action again.
   ** If that fixes the bug please report it to the extension author.
   ** Python * (glob)
   ** Mercurial Distributed SCM (version 2.2)
@@ -1472,9 +1472,9 @@
   $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
   >   throw 2>&1 | egrep '^\*\*'
-  ** Unknown exception encountered with possibly-broken third-party extension older (version N/A)
+  ** Unknown exception encountered with possibly-broken third-party extension "older" (version N/A)
   ** which supports versions 1.9 of Mercurial.
-  ** Please disable older and try your action again.
+  ** Please disable "older" and try your action again.
   ** If that fixes the bug please report it to the extension author.
   ** Python * (glob)
   ** Mercurial Distributed SCM (version 2.1)
@@ -1486,9 +1486,9 @@
   $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
   >   throw 2>&1 | egrep '^\*\*'
-  ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
+  ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
   ** which supports versions 2.1 of Mercurial.
-  ** Please disable throw and try your action again.
+  ** Please disable "throw" and try your action again.
   ** If that fixes the bug please report it to http://example.com/bts
   ** Python * (glob)
   ** Mercurial Distributed SCM (version 1.9.3)