comparison hgext/largefiles/overrides.py @ 48390:322525db4c98

status: use filesystem time boundary to invalidate racy mtime We record the filesystem time at the start of the status walk and use that as a boundary to detect files that might be modified during (or right after) the status run without the mtime allowing that edition to be detected. We currently do this at a second precision. In a later patch, we will use nanosecond precision when available. To cope with "broken" time on the file system where file could be in the future, we also keep mtime for file over one day in the future. See inline comment for details. Large file tests get a bit more confused as we reduce the odds for race condition. As a "side effect", the win32text extension is happy again. Differential Revision: https://phab.mercurial-scm.org/D11794
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 18 Nov 2021 13:12:40 +0100
parents 941fbaab5aff
children 6b1049d71c3e
comparison
equal deleted inserted replaced
48389:03644a929d6e 48390:322525db4c98
1517 opts = {} 1517 opts = {}
1518 if not lfutil.islfilesrepo(repo): 1518 if not lfutil.islfilesrepo(repo):
1519 return orig(repo, matcher, prefix, uipathfn, opts) 1519 return orig(repo, matcher, prefix, uipathfn, opts)
1520 # Get the list of missing largefiles so we can remove them 1520 # Get the list of missing largefiles so we can remove them
1521 lfdirstate = lfutil.openlfdirstate(repo.ui, repo) 1521 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1522 unsure, s = lfdirstate.status( 1522 unsure, s, mtime_boundary = lfdirstate.status(
1523 matchmod.always(), 1523 matchmod.always(),
1524 subrepos=[], 1524 subrepos=[],
1525 ignored=False, 1525 ignored=False,
1526 clean=False, 1526 clean=False,
1527 unknown=False, 1527 unknown=False,
1744 # 1744 #
1745 # (*) don't care 1745 # (*) don't care
1746 # (*1) deprecated, but used internally (e.g: "rebase --collapse") 1746 # (*1) deprecated, but used internally (e.g: "rebase --collapse")
1747 1747
1748 lfdirstate = lfutil.openlfdirstate(repo.ui, repo) 1748 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1749 unsure, s = lfdirstate.status( 1749 unsure, s, mtime_boundary = lfdirstate.status(
1750 matchmod.always(), 1750 matchmod.always(),
1751 subrepos=[], 1751 subrepos=[],
1752 ignored=False, 1752 ignored=False,
1753 clean=True, 1753 clean=True,
1754 unknown=False, 1754 unknown=False,