##// END OF EJS Templates
win32mbcs: use extsetup() to wrap functions only once....
Shun-ichi GOTO -
r13067:96969544 stable
parent child Browse files
Show More
@@ -33,7 +33,8 b' This extension is not needed for:'
33 Note that there are some limitations on using this extension:
33 Note that there are some limitations on using this extension:
34
34
35 - You should use single encoding in one repository.
35 - You should use single encoding in one repository.
36
36 - If the repository path ends with 0x5c, .hg/hgrc cannot be read.
37 - win32mbcs is not compatible with fixutf8 extention.
37
38
38 By default, win32mbcs uses encoding.encoding decided by Mercurial.
39 By default, win32mbcs uses encoding.encoding decided by Mercurial.
39 You can specify the encoding by config option::
40 You can specify the encoding by config option::
@@ -48,7 +49,7 b' import os, sys'
48 from mercurial.i18n import _
49 from mercurial.i18n import _
49 from mercurial import util, encoding
50 from mercurial import util, encoding
50
51
51 _encoding = None # see reposetup()
52 _encoding = None # see extsetup
52
53
53 def decode(arg):
54 def decode(arg):
54 if isinstance(arg, str):
55 if isinstance(arg, str):
@@ -136,7 +137,7 b" problematic_encodings = '''big5 big5-tw "
136 sjis s_jis shift_jis_2004 shiftjis2004 sjis_2004 sjis2004
137 sjis s_jis shift_jis_2004 shiftjis2004 sjis_2004 sjis2004
137 shift_jisx0213 shiftjisx0213 sjisx0213 s_jisx0213 950 cp950 ms950 '''
138 shift_jisx0213 shiftjisx0213 sjisx0213 s_jisx0213 950 cp950 ms950 '''
138
139
139 def reposetup(ui, repo):
140 def extsetup(ui):
140 # TODO: decide use of config section for this extension
141 # TODO: decide use of config section for this extension
141 if not os.path.supports_unicode_filenames:
142 if not os.path.supports_unicode_filenames:
142 ui.warn(_("[win32mbcs] cannot activate on this platform.\n"))
143 ui.warn(_("[win32mbcs] cannot activate on this platform.\n"))
@@ -149,6 +150,10 b' def reposetup(ui, repo):'
149 for f in funcs.split():
150 for f in funcs.split():
150 wrapname(f, wrapper)
151 wrapname(f, wrapper)
151 wrapname("mercurial.osutil.listdir", wrapperforlistdir)
152 wrapname("mercurial.osutil.listdir", wrapperforlistdir)
152 ui.debug("[win32mbcs] activated with encoding: %s\n"
153 # Check sys.args manually instead of using ui.debug() because
153 % _encoding)
154 # command line options is not yet applied when
155 # extensions.loadall() is called.
156 if '--debug' in sys.argv:
157 ui.write("[win32mbcs] activated with encoding: %s\n"
158 % _encoding)
154
159
General Comments 0
You need to be logged in to leave comments. Login now