##// END OF EJS Templates
pycompat: provide bytes os.linesep
Yuya Nishihara -
r31775:8181f378 default
parent child Browse files
Show More
@@ -101,6 +101,7 b' from mercurial import ('
101 101 error,
102 102 extensions,
103 103 match,
104 pycompat,
104 105 util,
105 106 )
106 107
@@ -170,7 +171,7 b' class eolfile(object):'
170 171
171 172 isrepolf = self.cfg.get('repository', 'native') != 'CRLF'
172 173 self._encode['NATIVE'] = isrepolf and 'to-lf' or 'to-crlf'
173 iswdlf = ui.config('eol', 'native', os.linesep) in ('LF', '\n')
174 iswdlf = ui.config('eol', 'native', pycompat.oslinesep) in ('LF', '\n')
174 175 self._decode['NATIVE'] = iswdlf and 'to-lf' or 'to-crlf'
175 176
176 177 include = []
@@ -42,6 +42,7 b' if ispy3:'
42 42 fsencode = os.fsencode
43 43 fsdecode = os.fsdecode
44 44 # A bytes version of os.name.
45 oslinesep = os.linesep.encode('ascii')
45 46 osname = os.name.encode('ascii')
46 47 ospathsep = os.pathsep.encode('ascii')
47 48 ossep = os.sep.encode('ascii')
@@ -231,6 +232,7 b' else:'
231 232 strkwargs = identity
232 233 byteskwargs = identity
233 234
235 oslinesep = os.linesep
234 236 osname = os.name
235 237 ospathsep = os.pathsep
236 238 ossep = os.sep
@@ -1102,7 +1102,7 b' class ui(object):'
1102 1102
1103 1103 # When stdin is in binary mode on Windows, it can cause
1104 1104 # raw_input() to emit an extra trailing carriage return
1105 if os.linesep == '\r\n' and line and line[-1] == '\r':
1105 if pycompat.oslinesep == '\r\n' and line and line[-1] == '\r':
1106 1106 line = line[:-1]
1107 1107 return line
1108 1108
General Comments 0
You need to be logged in to leave comments. Login now