equal
deleted
inserted
replaced
2208 def tolf(s): |
2208 def tolf(s): |
2209 return _eolre.sub('\n', s) |
2209 return _eolre.sub('\n', s) |
2210 |
2210 |
2211 def tocrlf(s): |
2211 def tocrlf(s): |
2212 return _eolre.sub('\r\n', s) |
2212 return _eolre.sub('\r\n', s) |
|
2213 |
|
2214 if pycompat.oslinesep == '\r\n': |
|
2215 tonativeeol = tocrlf |
|
2216 fromnativeeol = tolf |
|
2217 else: |
|
2218 tonativeeol = pycompat.identity |
|
2219 fromnativeeol = pycompat.identity |
2213 |
2220 |
2214 def escapestr(s): |
2221 def escapestr(s): |
2215 # call underlying function of s.encode('string_escape') directly for |
2222 # call underlying function of s.encode('string_escape') directly for |
2216 # Python 3 compatibility |
2223 # Python 3 compatibility |
2217 return codecs.escape_encode(s)[0] |
2224 return codecs.escape_encode(s)[0] |