Mercurial > hg-stable
changeset 17154:d592759aabc7
store: abstract out how we retrieve a file's size
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Mon, 25 Jun 2012 15:14:06 -0700 |
parents | 54da604fefee |
children | 88ff28bcd980 |
files | mercurial/store.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/store.py Wed Jun 27 22:03:27 2012 +0900 +++ b/mercurial/store.py Mon Jun 25 15:14:06 2012 -0700 @@ -391,15 +391,16 @@ def join(self, f): return self.path + '/' + self.encode(f) + def getsize(self, path): + return os.stat(self.path + '/' + path).st_size + def datafiles(self): rewrite = False existing = [] - spath = self.path for f in self.fncache: ef = self.encode(f) try: - st = os.stat(spath + '/' + ef) - yield f, ef, st.st_size + yield f, ef, self.getsize(ef) existing.append(f) except OSError: # nonexistent entry