219 # This will match the files for which we need to care |
219 # This will match the files for which we need to care |
220 # about inconsistent newlines. |
220 # about inconsistent newlines. |
221 self.match = match.match(root, b'', [], include, exclude) |
221 self.match = match.match(root, b'', [], include, exclude) |
222 |
222 |
223 def copytoui(self, ui): |
223 def copytoui(self, ui): |
|
224 newpatterns = set(pattern for pattern, key, m in self.patterns) |
|
225 for section in (b'decode', b'encode'): |
|
226 for oldpattern, _filter in ui.configitems(section): |
|
227 if oldpattern not in newpatterns: |
|
228 if ui.configsource(section, oldpattern) == b'eol': |
|
229 ui.setconfig(section, oldpattern, b'!', b'eol') |
224 for pattern, key, m in self.patterns: |
230 for pattern, key, m in self.patterns: |
225 try: |
231 try: |
226 ui.setconfig(b'decode', pattern, self._decode[key], b'eol') |
232 ui.setconfig(b'decode', pattern, self._decode[key], b'eol') |
227 ui.setconfig(b'encode', pattern, self._encode[key], b'eol') |
233 ui.setconfig(b'encode', pattern, self._encode[key], b'eol') |
228 except KeyError: |
234 except KeyError: |