cachevfs: use the new vfs in when computing branchmap cache
This will help sharing the cache between shares.
--- a/mercurial/branchmap.py Sat Jul 15 23:05:04 2017 +0200
+++ b/mercurial/branchmap.py Sat Jul 15 22:42:31 2017 +0200
@@ -28,14 +28,14 @@
def _filename(repo):
"""name of a branchcache file for a given repo or repoview"""
- filename = "cache/branch2"
+ filename = "branch2"
if repo.filtername:
filename = '%s-%s' % (filename, repo.filtername)
return filename
def read(repo):
try:
- f = repo.vfs(_filename(repo))
+ f = repo.cachevfs(_filename(repo))
lines = f.read().split('\n')
f.close()
except (IOError, OSError):
@@ -228,7 +228,7 @@
def write(self, repo):
try:
- f = repo.vfs(_filename(repo), "w", atomictemp=True)
+ f = repo.cachevfs(_filename(repo), "w", atomictemp=True)
cachekey = [hex(self.tipnode), '%d' % self.tiprev]
if self.filteredhash is not None:
cachekey.append(hex(self.filteredhash))