Mercurial > hg
comparison hgext/largefiles/lfutil.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 | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
48395:9ae0353c9f5d | 48396:c0d88407b7d4 |
---|---|
259 else: | 259 else: |
260 clean.append(lfile) | 260 clean.append(lfile) |
261 st = wctx[lfile].lstat() | 261 st = wctx[lfile].lstat() |
262 mode = st.st_mode | 262 mode = st.st_mode |
263 size = st.st_size | 263 size = st.st_size |
264 mtime = timestamp.mtime_of(st) | 264 mtime = timestamp.reliable_mtime_of(st, mtime_boundary) |
265 cache_data = (mode, size, mtime) | 265 if mtime is not None: |
266 # We should consider using the mtime_boundary | 266 cache_data = (mode, size, mtime) |
267 # logic here, but largefile never actually had | 267 lfdirstate.set_clean(lfile, cache_data) |
268 # ambiguity protection before, so this confuse | |
269 # the tests and need more thinking. | |
270 lfdirstate.set_clean(lfile, cache_data) | |
271 return s | 268 return s |
272 | 269 |
273 | 270 |
274 def listlfiles(repo, rev=None, matcher=None): | 271 def listlfiles(repo, rev=None, matcher=None): |
275 """return a list of largefiles in the working copy or the | 272 """return a list of largefiles in the working copy or the |