##// END OF EJS Templates
win32mbcs: allow win32mbcs extension to be enabled on cygwin platform...
FUJIWARA Katsunori -
r15724:9e6a13c2 default
parent child Browse files
Show More
@@ -127,11 +127,14 b' def wrapname(name, wrapper):'
127 127 # NOTE: os.path.dirname() and os.path.basename() are safe because
128 128 # they use result of os.path.split()
129 129 funcs = '''os.path.join os.path.split os.path.splitext
130 os.path.splitunc os.path.normpath os.makedirs
130 os.path.normpath os.makedirs
131 131 mercurial.util.endswithsep mercurial.util.splitpath mercurial.util.checkcase
132 132 mercurial.util.fspath mercurial.util.pconvert mercurial.util.normpath
133 133 mercurial.util.checkwinfilename mercurial.util.checkosfilename'''
134 134
135 # List of Windows specific functions to be wrapped.
136 winfuncs = '''os.path.splitunc'''
137
135 138 # codec and alias names of sjis and big5 to be faked.
136 139 problematic_encodings = '''big5 big5-tw csbig5 big5hkscs big5-hkscs
137 140 hkscs cp932 932 ms932 mskanji ms-kanji shift_jis csshiftjis shiftjis
@@ -140,7 +143,8 b" problematic_encodings = '''big5 big5-tw "
140 143
141 144 def extsetup(ui):
142 145 # TODO: decide use of config section for this extension
143 if not os.path.supports_unicode_filenames:
146 if ((not os.path.supports_unicode_filenames) and
147 (sys.platform != 'cygwin')):
144 148 ui.warn(_("[win32mbcs] cannot activate on this platform.\n"))
145 149 return
146 150 # determine encoding for filename
@@ -150,6 +154,9 b' def extsetup(ui):'
150 154 if _encoding.lower() in problematic_encodings.split():
151 155 for f in funcs.split():
152 156 wrapname(f, wrapper)
157 if os.name == 'nt':
158 for f in winfuncs.split():
159 wrapname(f, wrapper)
153 160 wrapname("mercurial.osutil.listdir", wrapperforlistdir)
154 161 # Check sys.args manually instead of using ui.debug() because
155 162 # command line options is not yet applied when
General Comments 0
You need to be logged in to leave comments. Login now