##// END OF EJS Templates
dispatch: print the version of the extension being blamed in a bug report...
Matt Harbison -
r46563:c26cb33e default
parent child Browse files
Show More
@@ -1253,7 +1253,7 b' def _exceptionwarning(ui):'
1253 # of date) will be clueful enough to notice the implausible
1253 # of date) will be clueful enough to notice the implausible
1254 # version number and try updating.
1254 # version number and try updating.
1255 ct = util.versiontuple(n=2)
1255 ct = util.versiontuple(n=2)
1256 worst = None, ct, b''
1256 worst = None, ct, b'', b''
1257 if ui.config(b'ui', b'supportcontact') is None:
1257 if ui.config(b'ui', b'supportcontact') is None:
1258 for name, mod in extensions.extensions():
1258 for name, mod in extensions.extensions():
1259 # 'testedwith' should be bytes, but not all extensions are ported
1259 # 'testedwith' should be bytes, but not all extensions are ported
@@ -1261,10 +1261,11 b' def _exceptionwarning(ui):'
1261 testedwith = stringutil.forcebytestr(
1261 testedwith = stringutil.forcebytestr(
1262 getattr(mod, 'testedwith', b'')
1262 getattr(mod, 'testedwith', b'')
1263 )
1263 )
1264 version = extensions.moduleversion(mod)
1264 report = getattr(mod, 'buglink', _(b'the extension author.'))
1265 report = getattr(mod, 'buglink', _(b'the extension author.'))
1265 if not testedwith.strip():
1266 if not testedwith.strip():
1266 # We found an untested extension. It's likely the culprit.
1267 # We found an untested extension. It's likely the culprit.
1267 worst = name, b'unknown', report
1268 worst = name, b'unknown', report, version
1268 break
1269 break
1269
1270
1270 # Never blame on extensions bundled with Mercurial.
1271 # Never blame on extensions bundled with Mercurial.
@@ -1278,20 +1279,21 b' def _exceptionwarning(ui):'
1278 lower = [t for t in tested if t < ct]
1279 lower = [t for t in tested if t < ct]
1279 nearest = max(lower or tested)
1280 nearest = max(lower or tested)
1280 if worst[0] is None or nearest < worst[1]:
1281 if worst[0] is None or nearest < worst[1]:
1281 worst = name, nearest, report
1282 worst = name, nearest, report, version
1282 if worst[0] is not None:
1283 if worst[0] is not None:
1283 name, testedwith, report = worst
1284 name, testedwith, report, version = worst
1284 if not isinstance(testedwith, (bytes, str)):
1285 if not isinstance(testedwith, (bytes, str)):
1285 testedwith = b'.'.join(
1286 testedwith = b'.'.join(
1286 [stringutil.forcebytestr(c) for c in testedwith]
1287 [stringutil.forcebytestr(c) for c in testedwith]
1287 )
1288 )
1289 extver = version or _(b"(version N/A)")
1288 warning = _(
1290 warning = _(
1289 b'** Unknown exception encountered with '
1291 b'** Unknown exception encountered with '
1290 b'possibly-broken third-party extension %s\n'
1292 b'possibly-broken third-party extension %s %s\n'
1291 b'** which supports versions %s of Mercurial.\n'
1293 b'** which supports versions %s of Mercurial.\n'
1292 b'** Please disable %s and try your action again.\n'
1294 b'** Please disable %s and try your action again.\n'
1293 b'** If that fixes the bug please report it to %s\n'
1295 b'** If that fixes the bug please report it to %s\n'
1294 ) % (name, testedwith, name, stringutil.forcebytestr(report))
1296 ) % (name, extver, testedwith, name, stringutil.forcebytestr(report))
1295 else:
1297 else:
1296 bugtracker = ui.config(b'ui', b'supportcontact')
1298 bugtracker = ui.config(b'ui', b'supportcontact')
1297 if bugtracker is None:
1299 if bugtracker is None:
@@ -482,7 +482,7 b' blackbox should work if repo.ui.log is n'
482 #endif
482 #endif
483
483
484 $ head -1 .hg/blackbox.log
484 $ head -1 .hg/blackbox.log
485 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension mock
485 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension mock (version N/A)
486 $ tail -2 .hg/blackbox.log
486 $ tail -2 .hg/blackbox.log
487 RuntimeError: raise
487 RuntimeError: raise
488
488
@@ -310,7 +310,7 b' Stripping from a transaction'
310 Test programming error failure:
310 Test programming error failure:
311
311
312 $ hg buggytransaction 2>&1 | egrep -v '^ '
312 $ hg buggytransaction 2>&1 | egrep -v '^ '
313 ** Unknown exception encountered with possibly-broken third-party extension buggylocking
313 ** Unknown exception encountered with possibly-broken third-party extension buggylocking (version N/A)
314 ** which supports versions unknown of Mercurial.
314 ** which supports versions unknown of Mercurial.
315 ** Please disable buggylocking and try your action again.
315 ** Please disable buggylocking and try your action again.
316 ** If that fixes the bug please report it to the extension author.
316 ** If that fixes the bug please report it to the extension author.
@@ -322,7 +322,7 b' Test programming error failure:'
322 *ProgrammingError: transaction requires locking (glob)
322 *ProgrammingError: transaction requires locking (glob)
323
323
324 $ hg programmingerror 2>&1 | egrep -v '^ '
324 $ hg programmingerror 2>&1 | egrep -v '^ '
325 ** Unknown exception encountered with possibly-broken third-party extension buggylocking
325 ** Unknown exception encountered with possibly-broken third-party extension buggylocking (version N/A)
326 ** which supports versions unknown of Mercurial.
326 ** which supports versions unknown of Mercurial.
327 ** Please disable buggylocking and try your action again.
327 ** Please disable buggylocking and try your action again.
328 ** If that fixes the bug please report it to the extension author.
328 ** If that fixes the bug please report it to the extension author.
@@ -1415,7 +1415,7 b' accessed.'
1415
1415
1416 No declared supported version, extension complains:
1416 No declared supported version, extension complains:
1417 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1417 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1418 ** Unknown exception encountered with possibly-broken third-party extension throw
1418 ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
1419 ** which supports versions unknown of Mercurial.
1419 ** which supports versions unknown of Mercurial.
1420 ** Please disable throw and try your action again.
1420 ** Please disable throw and try your action again.
1421 ** If that fixes the bug please report it to the extension author.
1421 ** If that fixes the bug please report it to the extension author.
@@ -1427,7 +1427,7 b' empty declaration of supported version, '
1427 the value is improperly a str instead of bytes):
1427 the value is improperly a str instead of bytes):
1428 $ echo "testedwith = ''" >> throw.py
1428 $ echo "testedwith = ''" >> throw.py
1429 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1429 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1430 ** Unknown exception encountered with possibly-broken third-party extension throw
1430 ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
1431 ** which supports versions unknown of Mercurial.
1431 ** which supports versions unknown of Mercurial.
1432 ** Please disable throw and try your action again.
1432 ** Please disable throw and try your action again.
1433 ** If that fixes the bug please report it to the extension author.
1433 ** If that fixes the bug please report it to the extension author.
@@ -1441,7 +1441,7 b' improperly a str instead of bytes):'
1441 $ rm -f throw.pyc throw.pyo
1441 $ rm -f throw.pyc throw.pyo
1442 $ rm -Rf __pycache__
1442 $ rm -Rf __pycache__
1443 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1443 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1444 ** Unknown exception encountered with possibly-broken third-party extension throw
1444 ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
1445 ** which supports versions unknown of Mercurial.
1445 ** which supports versions unknown of Mercurial.
1446 ** Please disable throw and try your action again.
1446 ** Please disable throw and try your action again.
1447 ** If that fixes the bug please report it to http://example.com/bts
1447 ** If that fixes the bug please report it to http://example.com/bts
@@ -1458,7 +1458,7 b' If the extensions declare outdated versi'
1458 $ rm -Rf __pycache__
1458 $ rm -Rf __pycache__
1459 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1459 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1460 > throw 2>&1 | egrep '^\*\*'
1460 > throw 2>&1 | egrep '^\*\*'
1461 ** Unknown exception encountered with possibly-broken third-party extension older
1461 ** Unknown exception encountered with possibly-broken third-party extension older (version N/A)
1462 ** which supports versions 1.9 of Mercurial.
1462 ** which supports versions 1.9 of Mercurial.
1463 ** Please disable older and try your action again.
1463 ** Please disable older and try your action again.
1464 ** If that fixes the bug please report it to the extension author.
1464 ** If that fixes the bug please report it to the extension author.
@@ -1472,7 +1472,7 b' One extension only tested with older, on'
1472 $ rm -Rf __pycache__
1472 $ rm -Rf __pycache__
1473 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1473 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1474 > throw 2>&1 | egrep '^\*\*'
1474 > throw 2>&1 | egrep '^\*\*'
1475 ** Unknown exception encountered with possibly-broken third-party extension older
1475 ** Unknown exception encountered with possibly-broken third-party extension older (version N/A)
1476 ** which supports versions 1.9 of Mercurial.
1476 ** which supports versions 1.9 of Mercurial.
1477 ** Please disable older and try your action again.
1477 ** Please disable older and try your action again.
1478 ** If that fixes the bug please report it to the extension author.
1478 ** If that fixes the bug please report it to the extension author.
@@ -1486,7 +1486,7 b' Older extension is tested with current v'
1486 $ rm -Rf __pycache__
1486 $ rm -Rf __pycache__
1487 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1487 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1488 > throw 2>&1 | egrep '^\*\*'
1488 > throw 2>&1 | egrep '^\*\*'
1489 ** Unknown exception encountered with possibly-broken third-party extension throw
1489 ** Unknown exception encountered with possibly-broken third-party extension throw 1.0.0
1490 ** which supports versions 2.1 of Mercurial.
1490 ** which supports versions 2.1 of Mercurial.
1491 ** Please disable throw and try your action again.
1491 ** Please disable throw and try your action again.
1492 ** If that fixes the bug please report it to http://example.com/bts
1492 ** If that fixes the bug please report it to http://example.com/bts
General Comments 0
You need to be logged in to leave comments. Login now