##// END OF EJS Templates
debuginstall: use codecs.lookup() to detect invalid encoding...
Yuya Nishihara -
r34131:902219a9 default
parent child Browse files
Show More
@@ -7,6 +7,7 b''
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import codecs
10 import collections
11 import collections
11 import difflib
12 import difflib
12 import errno
13 import errno
@@ -997,8 +998,8 b' def debuginstall(ui, **opts):'
997 fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
998 fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
998 err = None
999 err = None
999 try:
1000 try:
1000 encoding.fromlocal("test")
1001 codecs.lookup(pycompat.sysstr(encoding.encoding))
1001 except error.Abort as inst:
1002 except LookupError as inst:
1002 err = inst
1003 err = inst
1003 problems += 1
1004 problems += 1
1004 fm.condwrite(err, 'encodingerror', _(" %s\n"
1005 fm.condwrite(err, 'encodingerror', _(" %s\n"
@@ -76,6 +76,11 b' hg debuginstall with no username'
76 1 problems detected, please check your install!
76 1 problems detected, please check your install!
77 [1]
77 [1]
78
78
79 hg debuginstall with invalid encoding
80 $ HGENCODING=invalidenc hg debuginstall | grep encoding
81 checking encoding (invalidenc)...
82 unknown encoding: invalidenc
83
79 path variables are expanded (~ is the same as $TESTTMP)
84 path variables are expanded (~ is the same as $TESTTMP)
80 $ mkdir tools
85 $ mkdir tools
81 $ touch tools/testeditor.exe
86 $ touch tools/testeditor.exe
General Comments 0
You need to be logged in to leave comments. Login now