Show More
@@ -121,6 +121,9 b" configitem('eol', 'fix-trailing-newline'" | |||
|
121 | 121 | configitem('eol', 'native', |
|
122 | 122 | default=pycompat.oslinesep, |
|
123 | 123 | ) |
|
124 | configitem('eol', 'only-consistent', | |
|
125 | default=True, | |
|
126 | ) | |
|
124 | 127 | |
|
125 | 128 | # Matches a lone LF, i.e., one that is not part of CRLF. |
|
126 | 129 | singlelf = re.compile('(^|[^\r])\n') |
@@ -132,7 +135,7 b' def tolf(s, params, ui, **kwargs):' | |||
|
132 | 135 | """Filter to convert to LF EOLs.""" |
|
133 | 136 | if util.binary(s): |
|
134 | 137 | return s |
|
135 |
if ui.configbool('eol', 'only-consistent' |
|
|
138 | if ui.configbool('eol', 'only-consistent') and inconsistenteol(s): | |
|
136 | 139 | return s |
|
137 | 140 | if (ui.configbool('eol', 'fix-trailing-newline') |
|
138 | 141 | and s and s[-1] != '\n'): |
@@ -143,7 +146,7 b' def tocrlf(s, params, ui, **kwargs):' | |||
|
143 | 146 | """Filter to convert to CRLF EOLs.""" |
|
144 | 147 | if util.binary(s): |
|
145 | 148 | return s |
|
146 |
if ui.configbool('eol', 'only-consistent' |
|
|
149 | if ui.configbool('eol', 'only-consistent') and inconsistenteol(s): | |
|
147 | 150 | return s |
|
148 | 151 | if (ui.configbool('eol', 'fix-trailing-newline') |
|
149 | 152 | and s and s[-1] != '\n'): |
General Comments 0
You need to be logged in to leave comments.
Login now