# HG changeset patch # User Boris Feld # Date 2017-07-15 21:05:04 # Node ID 4133c0b0fcd781eb45ff82ceebbc5040da9f23e6 # Parent d645fdfb749f5fb0921010425b7998dd3dbe971a cachevfs: add a vfs dedicated to cache Most of the cache content lives in '.hg/cache/'. Moreover they are computed exclusively from data in the '.hg/store' directory. This creates issues with the share extension as the '.hg/store' directory is shared but the '.hg/cache' is not. On large repositories, this makes this prevent some usage of the share extension inefficient as some caches can take minutes to be recomputed. To improve the situation, we introduce a new 'cachevfs' that will be dedicated to cache reading and writing. In the next patches of this series, we'll migrate the 4 existing caches to it and update the share extension. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -423,6 +423,8 @@ class localrepository(object): self.svfs = self.store.vfs self.sjoin = self.store.join self.vfs.createmode = self.store.createmode + self.cachevfs = vfsmod.vfs(self.vfs.join('cache')) + self.cachevfs.createmode = self.store.createmode if (self.ui.configbool('devel', 'all-warnings') or self.ui.configbool('devel', 'check-locks')): if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py +++ b/mercurial/statichttprepo.py @@ -124,6 +124,7 @@ class statichttprepository(localrepo.loc vfsclass = build_opener(ui, authinfo) self.vfs = vfsclass(self.path) + self.cachevfs = vfsclass(self.vfs.join('cache')) self._phasedefaults = [] self.names = namespaces.namespaces()