##// END OF EJS Templates
cachevfs: use the new vfs in when computing branchmap cache...
Boris Feld -
r33534:2715a4fc default
parent child Browse files
Show More
@@ -28,14 +28,14 b' unpack_from = struct.unpack_from'
28
28
29 def _filename(repo):
29 def _filename(repo):
30 """name of a branchcache file for a given repo or repoview"""
30 """name of a branchcache file for a given repo or repoview"""
31 filename = "cache/branch2"
31 filename = "branch2"
32 if repo.filtername:
32 if repo.filtername:
33 filename = '%s-%s' % (filename, repo.filtername)
33 filename = '%s-%s' % (filename, repo.filtername)
34 return filename
34 return filename
35
35
36 def read(repo):
36 def read(repo):
37 try:
37 try:
38 f = repo.vfs(_filename(repo))
38 f = repo.cachevfs(_filename(repo))
39 lines = f.read().split('\n')
39 lines = f.read().split('\n')
40 f.close()
40 f.close()
41 except (IOError, OSError):
41 except (IOError, OSError):
@@ -228,7 +228,7 b' class branchcache(dict):'
228
228
229 def write(self, repo):
229 def write(self, repo):
230 try:
230 try:
231 f = repo.vfs(_filename(repo), "w", atomictemp=True)
231 f = repo.cachevfs(_filename(repo), "w", atomictemp=True)
232 cachekey = [hex(self.tipnode), '%d' % self.tiprev]
232 cachekey = [hex(self.tipnode), '%d' % self.tiprev]
233 if self.filteredhash is not None:
233 if self.filteredhash is not None:
234 cachekey.append(hex(self.filteredhash))
234 cachekey.append(hex(self.filteredhash))
General Comments 0
You need to be logged in to leave comments. Login now