##// END OF EJS Templates
eol: fix update - don't use and apply removed .hgeol patterns...
Mads Kiilerich -
r43476:dfaa477e default
parent child Browse files
Show More
@@ -221,6 +221,12 class eolfile(object):
221 221 self.match = match.match(root, b'', [], include, exclude)
222 222
223 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 230 for pattern, key, m in self.patterns:
225 231 try:
226 232 ui.setconfig(b'decode', pattern, self._decode[key], b'eol')
@@ -120,12 +120,6 Test EOL update
120 120 first
121 121 -second
122 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 125 % hg clone repo repo-CRLF
@@ -159,12 +153,6 Test EOL update
159 153 first
160 154 -second
161 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 157 Test in repo using eol extension, while keeping an eye on how filters are
170 158 applied:
@@ -177,8 +165,8 applied:
177 165 > eol =
178 166 > EOF
179 167
180 Update to revision 0 which has no .hgeol . Unfortunately, it uses the filter
181 from tip ... which evidently is wrong:
168 Update to revision 0 which has no .hgeol, shouldn't use any filters, and
169 obviously should leave things as tidy as they were before the clean update.
182 170
183 171 $ hg up -c -r 0 -v --debug
184 172 resolving manifests
@@ -193,22 +181,8 from tip ... which evidently is wrong:
193 181 filtering a.txt through tolf
194 182 f: remote created -> g
195 183 getting f
196 filtering f through tolf
197 184 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 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 187 $ hg branch b
214 188 marked working directory as branch b
@@ -250,9 +224,9 Merge changes that apply a filter to f:
250 224 -f\r (esc)
251 225 +f
252 226
253 Abort the merge with up -C to revision 0 ... but notice how .hgeol changes are
254 not detected correctly: f is filtered with tolf even though there is no filter
255 for f in revision 0, and it thus ends up with working directory changes.
227 Abort the merge with up -C to revision 0.
228 Note that files are filtered correctly for revision 0: f is not filtered, a.txt
229 is filtered with tolf, and everything is left tidy.
256 230
257 231 $ touch .hgeol * # ensure consistent dirtyness checks ignoring dirstate
258 232 $ hg up -C -r 0 -v --debug
@@ -269,7 +243,6 for f in revision 0, and it thus ends up
269 243 filtering a.txt through tolf
270 244 f: remote is newer -> g
271 245 getting f
272 filtering f through tolf
273 246 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 247
275 248 $ touch .hgeol *
@@ -277,16 +250,9 for f in revision 0, and it thus ends up
277 250 eol: detected change in .hgeol
278 251 filtering .hgeol through isbinary
279 252 filtering a.txt through tolf
280 M f
281 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 257 $ touch .hgeol *
292 258 $ hg up -C -r 0 -v --debug
@@ -297,9 +263,7 Workaround: Update again - this will rea
297 263 branchmerge: False, force: True, partial: False
298 264 ancestor: 15cbdf8ca3db+, local: 15cbdf8ca3db+, remote: 15cbdf8ca3db
299 265 calling hook preupdate.eol: hgext.eol.preupdate
300 f: remote is newer -> g
301 getting f
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
303 267
304 268 $ touch .hgeol *
305 269 $ hg st --debug
General Comments 0
You need to be logged in to leave comments. Login now