##// END OF EJS Templates
keyword: wrap dirstate mutation in `changing_files` context...
marmoute -
r51046:092db646 default
parent child Browse files
Show More
@@ -421,31 +421,31 b' def reposetup(ui, repo):'
421 wlock = None
421 wlock = None
422 try:
422 try:
423 wlock = self.wlock()
423 wlock = self.wlock()
424 for f in self.dirstate:
424 with self.dirstate.changing_files(self):
425 if not self.dirstate.get_entry(f).maybe_clean:
425 for f in self.dirstate:
426 continue
426 if not self.dirstate.get_entry(f).maybe_clean:
427 if oldeol is not None:
428 if not oldeol.match(f) and not neweol.match(f):
429 continue
427 continue
430 oldkey = None
428 if oldeol is not None:
431 for pattern, key, m in oldeol.patterns:
429 if not oldeol.match(f) and not neweol.match(f):
432 if m(f):
430 continue
433 oldkey = key
431 oldkey = None
434 break
432 for pattern, key, m in oldeol.patterns:
435 newkey = None
433 if m(f):
436 for pattern, key, m in neweol.patterns:
434 oldkey = key
437 if m(f):
435 break
438 newkey = key
436 newkey = None
439 break
437 for pattern, key, m in neweol.patterns:
440 if oldkey == newkey:
438 if m(f):
441 continue
439 newkey = key
442 # all normal files need to be looked at again since
440 break
443 # the new .hgeol file specify a different filter
441 if oldkey == newkey:
444 self.dirstate.set_possibly_dirty(f)
442 continue
445 # Write the cache to update mtime and cache .hgeol
443 # all normal files need to be looked at again since
446 with self.vfs(b"eol.cache", b"w") as f:
444 # the new .hgeol file specify a different filter
447 f.write(hgeoldata)
445 self.dirstate.set_possibly_dirty(f)
448 self.dirstate.write(self.currenttransaction())
446 # Write the cache to update mtime and cache .hgeol
447 with self.vfs(b"eol.cache", b"w") as f:
448 f.write(hgeoldata)
449 except errormod.LockUnavailable:
449 except errormod.LockUnavailable:
450 # If we cannot lock the repository and clear the
450 # If we cannot lock the repository and clear the
451 # dirstate, then a commit might not see all files
451 # dirstate, then a commit might not see all files
General Comments 0
You need to be logged in to leave comments. Login now