##// END OF EJS Templates
store: abstract out how we retrieve a file's size
Bryan O'Sullivan -
r17154:d592759a default
parent child Browse files
Show More
@@ -391,15 +391,16 b' class fncachestore(basicstore):'
391 def join(self, f):
391 def join(self, f):
392 return self.path + '/' + self.encode(f)
392 return self.path + '/' + self.encode(f)
393
393
394 def getsize(self, path):
395 return os.stat(self.path + '/' + path).st_size
396
394 def datafiles(self):
397 def datafiles(self):
395 rewrite = False
398 rewrite = False
396 existing = []
399 existing = []
397 spath = self.path
398 for f in self.fncache:
400 for f in self.fncache:
399 ef = self.encode(f)
401 ef = self.encode(f)
400 try:
402 try:
401 st = os.stat(spath + '/' + ef)
403 yield f, ef, self.getsize(ef)
402 yield f, ef, st.st_size
403 existing.append(f)
404 existing.append(f)
404 except OSError:
405 except OSError:
405 # nonexistent entry
406 # nonexistent entry
General Comments 0
You need to be logged in to leave comments. Login now