Mercurial > hg
comparison hgext/eol.py @ 34118:4a6ef3a5b282
configitems: register the 'eol.native' config
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 30 Jun 2017 03:39:26 +0200 |
parents | 0f685a229a81 |
children | d4a5193332b3 |
comparison
equal
deleted
inserted
replaced
34117:0f685a229a81 | 34118:4a6ef3a5b282 |
---|---|
116 configitem = registrar.configitem(configtable) | 116 configitem = registrar.configitem(configtable) |
117 | 117 |
118 configitem('eol', 'fix-trailing-newline', | 118 configitem('eol', 'fix-trailing-newline', |
119 default=False, | 119 default=False, |
120 ) | 120 ) |
121 configitem('eol', 'native', | |
122 default=pycompat.oslinesep, | |
123 ) | |
121 | 124 |
122 # Matches a lone LF, i.e., one that is not part of CRLF. | 125 # Matches a lone LF, i.e., one that is not part of CRLF. |
123 singlelf = re.compile('(^|[^\r])\n') | 126 singlelf = re.compile('(^|[^\r])\n') |
124 | 127 |
125 def inconsistenteol(data): | 128 def inconsistenteol(data): |
172 # We can then parse the user's patterns. | 175 # We can then parse the user's patterns. |
173 self.cfg.parse('.hgeol', data) | 176 self.cfg.parse('.hgeol', data) |
174 | 177 |
175 isrepolf = self.cfg.get('repository', 'native') != 'CRLF' | 178 isrepolf = self.cfg.get('repository', 'native') != 'CRLF' |
176 self._encode['NATIVE'] = isrepolf and 'to-lf' or 'to-crlf' | 179 self._encode['NATIVE'] = isrepolf and 'to-lf' or 'to-crlf' |
177 iswdlf = ui.config('eol', 'native', pycompat.oslinesep) in ('LF', '\n') | 180 iswdlf = ui.config('eol', 'native') in ('LF', '\n') |
178 self._decode['NATIVE'] = iswdlf and 'to-lf' or 'to-crlf' | 181 self._decode['NATIVE'] = iswdlf and 'to-lf' or 'to-crlf' |
179 | 182 |
180 include = [] | 183 include = [] |
181 exclude = [] | 184 exclude = [] |
182 self.patterns = [] | 185 self.patterns = [] |