Mercurial > hg
comparison hgext/eol.py @ 31775:8181f378b073
pycompat: provide bytes os.linesep
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 29 Mar 2017 21:23:28 +0900 |
parents | 4cffaf8c4853 |
children | fe9b33bcec6a |
comparison
equal
deleted
inserted
replaced
31774:7d2cbe11ae48 | 31775:8181f378b073 |
---|---|
99 from mercurial import ( | 99 from mercurial import ( |
100 config, | 100 config, |
101 error, | 101 error, |
102 extensions, | 102 extensions, |
103 match, | 103 match, |
104 pycompat, | |
104 util, | 105 util, |
105 ) | 106 ) |
106 | 107 |
107 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | 108 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
108 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | 109 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
168 # We can then parse the user's patterns. | 169 # We can then parse the user's patterns. |
169 self.cfg.parse('.hgeol', data) | 170 self.cfg.parse('.hgeol', data) |
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 = [] |
177 exclude = [] | 178 exclude = [] |
178 self.patterns = [] | 179 self.patterns = [] |