comparison mercurial/debugcommands.py @ 45100:d50d922ca02b

debuginstall: don't translate encoding messages While Microsoft trained us to read mojibake text, it doesn't make sense to print mojibake messages when debugging the exact issue.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 09 Jul 2020 19:16:52 +0900
parents 9f96beb9bafe
children 4a28f5e8408e
comparison
equal deleted inserted replaced
45099:de1d3f4246e9 45100:d50d922ca02b
1463 problems = 0 1463 problems = 0
1464 1464
1465 fm = ui.formatter(b'debuginstall', opts) 1465 fm = ui.formatter(b'debuginstall', opts)
1466 fm.startitem() 1466 fm.startitem()
1467 1467
1468 # encoding 1468 # encoding might be unknown or wrong. don't translate these messages.
1469 fm.write(b'encoding', _(b"checking encoding (%s)...\n"), encoding.encoding) 1469 fm.write(b'encoding', b"checking encoding (%s)...\n", encoding.encoding)
1470 err = None 1470 err = None
1471 try: 1471 try:
1472 codecs.lookup(pycompat.sysstr(encoding.encoding)) 1472 codecs.lookup(pycompat.sysstr(encoding.encoding))
1473 except LookupError as inst: 1473 except LookupError as inst:
1474 err = stringutil.forcebytestr(inst) 1474 err = stringutil.forcebytestr(inst)
1475 problems += 1 1475 problems += 1
1476 fm.condwrite( 1476 fm.condwrite(
1477 err, 1477 err,
1478 b'encodingerror', 1478 b'encodingerror',
1479 _(b" %s\n (check that your locale is properly set)\n"), 1479 b" %s\n (check that your locale is properly set)\n",
1480 err, 1480 err,
1481 ) 1481 )
1482 1482
1483 # Python 1483 # Python
1484 pythonlib = None 1484 pythonlib = None