Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 52116:82e2c99c84f3
cachestat: avoid creating cachestat for http path
The statichttprepo repo attemp to create cachestat for content we access through
http. We modify the couple of place create cachestat object to detect this
situation and avoids it.
This is not marvelous, but there is few of them and the freeze is looming. This
helps on Windows where calling cachestat on http path might create issues.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 26 Oct 2024 01:38:20 +0200 |
parents | fa7059f031a9 |
children | fca7d38e040b |
line wrap: on
line diff
--- a/mercurial/util.py Sat Oct 26 02:03:54 2024 +0200 +++ b/mercurial/util.py Sat Oct 26 01:38:20 2024 +0200 @@ -514,6 +514,16 @@ raise +class uncacheable_cachestat: + stat: Optional[os.stat_result] + + def __init__(self) -> None: + self.stat = None + + def cacheable(self) -> bool: + return False + + class fileobjectproxy: """A proxy around file objects that tells a watcher when events occur.