Show More
@@ -221,6 +221,12 b' class eolfile(object):' | |||||
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') |
@@ -120,12 +120,6 b' Test EOL update' | |||||
120 | first |
|
120 | first | |
121 | -second |
|
121 | -second | |
122 | third |
|
122 | third | |
123 | diff --git a/f b/f |
|
|||
124 | --- a/f |
|
|||
125 | +++ b/f |
|
|||
126 | @@ -1,1 +1,1 @@ |
|
|||
127 | -f\r (esc) |
|
|||
128 | +f |
|
|||
129 |
$ |
|
123 | $ dotest CRLF | |
130 |
|
124 | |||
131 | % hg clone repo repo-CRLF |
|
125 | % hg clone repo repo-CRLF | |
@@ -159,12 +153,6 b' Test EOL update' | |||||
159 | first |
|
153 | first | |
160 | -second |
|
154 | -second | |
161 | third |
|
155 | third | |
162 | diff --git a/f b/f |
|
|||
163 | --- a/f |
|
|||
164 | +++ b/f |
|
|||
165 | @@ -1,1 +1,1 @@ |
|
|||
166 | -f\r (esc) |
|
|||
167 | +f |
|
|||
168 |
|
156 | |||
169 | Test in repo using eol extension, while keeping an eye on how filters are |
|
157 | Test in repo using eol extension, while keeping an eye on how filters are | |
170 | applied: |
|
158 | applied: | |
@@ -177,8 +165,8 b' applied:' | |||||
177 | > eol = |
|
165 | > eol = | |
178 | > EOF |
|
166 | > EOF | |
179 |
|
167 | |||
180 |
Update to revision 0 which has no .hgeol |
|
168 | Update to revision 0 which has no .hgeol, shouldn't use any filters, and | |
181 | from tip ... which evidently is wrong: |
|
169 | obviously should leave things as tidy as they were before the clean update. | |
182 |
|
170 | |||
183 | $ hg up -c -r 0 -v --debug |
|
171 | $ hg up -c -r 0 -v --debug | |
184 | resolving manifests |
|
172 | resolving manifests | |
@@ -193,22 +181,8 b' from tip ... which evidently is wrong:' | |||||
193 | filtering a.txt through tolf |
|
181 | filtering a.txt through tolf | |
194 | f: remote created -> g |
|
182 | f: remote created -> g | |
195 | getting f |
|
183 | getting f | |
196 | filtering f through tolf |
|
|||
197 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
184 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
198 | $ hg st |
|
185 | $ hg st | |
199 | M f |
|
|||
200 | $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate |
|
|||
201 | $ hg up -C -r 0 -v --debug |
|
|||
202 | eol: detected change in .hgeol |
|
|||
203 | filtering .hgeol through isbinary |
|
|||
204 | filtering a.txt through tolf |
|
|||
205 | resolving manifests |
|
|||
206 | branchmerge: False, force: True, partial: False |
|
|||
207 | ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db |
|
|||
208 | calling hook preupdate.eol: hgext.eol.preupdate |
|
|||
209 | f: remote is newer -> g |
|
|||
210 | getting f |
|
|||
211 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
212 |
|
186 | |||
213 | $ hg branch b |
|
187 | $ hg branch b | |
214 | marked working directory as branch b |
|
188 | marked working directory as branch b | |
@@ -250,9 +224,9 b' Merge changes that apply a filter to f:' | |||||
250 | -f\r (esc) |
|
224 | -f\r (esc) | |
251 | +f |
|
225 | +f | |
252 |
|
226 | |||
253 |
Abort the merge with up -C to revision 0 |
|
227 | Abort the merge with up -C to revision 0. | |
254 | not detected correctly: f is filtered with tolf even though there is no filter |
|
228 | Note that files are filtered correctly for revision 0: f is not filtered, a.txt | |
255 | for f in revision 0, and it thus ends up with working directory changes. |
|
229 | is filtered with tolf, and everything is left tidy. | |
256 |
|
230 | |||
257 | $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate |
|
231 | $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate | |
258 | $ hg up -C -r 0 -v --debug |
|
232 | $ hg up -C -r 0 -v --debug | |
@@ -269,7 +243,6 b' for f in revision 0, and it thus ends up' | |||||
269 | filtering a.txt through tolf |
|
243 | filtering a.txt through tolf | |
270 | f: remote is newer -> g |
|
244 | f: remote is newer -> g | |
271 | getting f |
|
245 | getting f | |
272 | filtering f through tolf |
|
|||
273 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
246 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
274 |
|
247 | |||
275 | $ touch .hgeol * |
|
248 | $ touch .hgeol * | |
@@ -277,16 +250,9 b' for f in revision 0, and it thus ends up' | |||||
277 | eol: detected change in .hgeol |
|
250 | eol: detected change in .hgeol | |
278 | filtering .hgeol through isbinary |
|
251 | filtering .hgeol through isbinary | |
279 | filtering a.txt through tolf |
|
252 | filtering a.txt through tolf | |
280 | M f |
|
|||
281 | $ hg diff |
|
253 | $ hg diff | |
282 | diff --git a/f b/f |
|
|||
283 | --- a/f |
|
|||
284 | +++ b/f |
|
|||
285 | @@ -1,1 +1,1 @@ |
|
|||
286 | -f\r (esc) |
|
|||
287 | +f |
|
|||
288 |
|
254 | |||
289 | Workaround: Update again - this will read the right .hgeol: |
|
255 | Things were clean, and updating again will not change anything: | |
290 |
|
256 | |||
291 | $ touch .hgeol * |
|
257 | $ touch .hgeol * | |
292 | $ hg up -C -r 0 -v --debug |
|
258 | $ hg up -C -r 0 -v --debug | |
@@ -297,9 +263,7 b' Workaround: Update again - this will rea' | |||||
297 | branchmerge: False, force: True, partial: False |
|
263 | branchmerge: False, force: True, partial: False | |
298 | ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db |
|
264 | ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db | |
299 | calling hook preupdate.eol: hgext.eol.preupdate |
|
265 | calling hook preupdate.eol: hgext.eol.preupdate | |
300 | f: remote is newer -> g |
|
266 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
301 | getting f |
|
|||
302 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
303 |
|
267 | |||
304 | $ touch .hgeol * |
|
268 | $ touch .hgeol * | |
305 | $ hg st --debug |
|
269 | $ hg st --debug |
General Comments 0
You need to be logged in to leave comments.
Login now