comparison hgext/largefiles/reposetup.py @ 48396:c0d88407b7d4

largefile: use the proper "mtime boundary" logic during fixup This will prevent ambiguous cache entry to be used in racy situation. This fix flakiness in test and some real live misbehavior. Differential Revision: https://phab.mercurial-scm.org/D11800
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 23 Nov 2021 18:13:33 +0100
parents 322525db4c98
children 497c2655c71e
comparison
equal deleted inserted replaced
48395:9ae0353c9f5d 48396:c0d88407b7d4
226 if listclean: 226 if listclean:
227 clean.append(lfile) 227 clean.append(lfile)
228 s = wctx[lfile].lstat() 228 s = wctx[lfile].lstat()
229 mode = s.st_mode 229 mode = s.st_mode
230 size = s.st_size 230 size = s.st_size
231 mtime = timestamp.mtime_of(s) 231 mtime = timestamp.reliable_mtime_of(
232 cache_data = (mode, size, mtime) 232 s, mtime_boundary
233 # We should consider using the mtime_boundary 233 )
234 # logic here, but largefile never actually had 234 if mtime is not None:
235 # ambiguity protection before, so this confuse 235 cache_data = (mode, size, mtime)
236 # the tests and need more thinking. 236 lfdirstate.set_clean(lfile, cache_data)
237 lfdirstate.set_clean(lfile, cache_data)
238 else: 237 else:
239 tocheck = unsure + modified + added + clean 238 tocheck = unsure + modified + added + clean
240 modified, added, clean = [], [], [] 239 modified, added, clean = [], [], []
241 checkexec = self.dirstate._checkexec 240 checkexec = self.dirstate._checkexec
242 241