Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 5b9cd73c authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

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
parent 9ae0353c9f5d
Pipeline #29851 failed with stages
in 38 minutes and 17 seconds
......@@ -261,13 +261,10 @@ def lfdirstatestatus(lfdirstate, repo):
st = wctx[lfile].lstat()
mode = st.st_mode
size = st.st_size
mtime = timestamp.mtime_of(st)
cache_data = (mode, size, mtime)
# We should consider using the mtime_boundary
# logic here, but largefile never actually had
# ambiguity protection before, so this confuse
# the tests and need more thinking.
lfdirstate.set_clean(lfile, cache_data)
mtime = timestamp.reliable_mtime_of(st, mtime_boundary)
if mtime is not None:
cache_data = (mode, size, mtime)
lfdirstate.set_clean(lfile, cache_data)
return s
......
......@@ -228,13 +228,12 @@ def reposetup(ui, repo):
s = wctx[lfile].lstat()
mode = s.st_mode
size = s.st_size
mtime = timestamp.mtime_of(s)
cache_data = (mode, size, mtime)
# We should consider using the mtime_boundary
# logic here, but largefile never actually had
# ambiguity protection before, so this confuse
# the tests and need more thinking.
lfdirstate.set_clean(lfile, cache_data)
mtime = timestamp.reliable_mtime_of(
s, mtime_boundary
)
if mtime is not None:
cache_data = (mode, size, mtime)
lfdirstate.set_clean(lfile, cache_data)
else:
tocheck = unsure + modified + added + clean
modified, added, clean = [], [], []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment