##// 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 error,
101 error,
102 extensions,
102 extensions,
103 match,
103 match,
104 pycompat,
104 util,
105 util,
105 )
106 )
106
107
@@ -170,7 +171,7 b' class eolfile(object):'
170
171
171 isrepolf = self.cfg.get('repository', 'native') != 'CRLF'
172 isrepolf = self.cfg.get('repository', 'native') != 'CRLF'
172 self._encode['NATIVE'] = isrepolf and 'to-lf' or 'to-crlf'
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 self._decode['NATIVE'] = iswdlf and 'to-lf' or 'to-crlf'
175 self._decode['NATIVE'] = iswdlf and 'to-lf' or 'to-crlf'
175
176
176 include = []
177 include = []
@@ -42,6 +42,7 b' if ispy3:'
42 fsencode = os.fsencode
42 fsencode = os.fsencode
43 fsdecode = os.fsdecode
43 fsdecode = os.fsdecode
44 # A bytes version of os.name.
44 # A bytes version of os.name.
45 oslinesep = os.linesep.encode('ascii')
45 osname = os.name.encode('ascii')
46 osname = os.name.encode('ascii')
46 ospathsep = os.pathsep.encode('ascii')
47 ospathsep = os.pathsep.encode('ascii')
47 ossep = os.sep.encode('ascii')
48 ossep = os.sep.encode('ascii')
@@ -231,6 +232,7 b' else:'
231 strkwargs = identity
232 strkwargs = identity
232 byteskwargs = identity
233 byteskwargs = identity
233
234
235 oslinesep = os.linesep
234 osname = os.name
236 osname = os.name
235 ospathsep = os.pathsep
237 ospathsep = os.pathsep
236 ossep = os.sep
238 ossep = os.sep
@@ -1102,7 +1102,7 b' class ui(object):'
1102
1102
1103 # When stdin is in binary mode on Windows, it can cause
1103 # When stdin is in binary mode on Windows, it can cause
1104 # raw_input() to emit an extra trailing carriage return
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 line = line[:-1]
1106 line = line[:-1]
1107 return line
1107 return line
1108
1108
General Comments 0
You need to be logged in to leave comments. Login now