Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 11605:ce95d8b87d22 stable
context: use os.lstat instead of os.stat to fetch file size
When file is a link, we want the size of the link itself, not the size
of the file it points to.
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Fri, 16 Jul 2010 16:33:55 +0900 |
parents | a463e3c50212 |
children | eb07fbc21e9c 927d63be166b |
comparison
equal
deleted
inserted
replaced
11600:76454cbc11e4 | 11605:ce95d8b87d22 |
---|---|
923 | 923 |
924 def children(self): | 924 def children(self): |
925 return [] | 925 return [] |
926 | 926 |
927 def size(self): | 927 def size(self): |
928 return os.stat(self._repo.wjoin(self._path)).st_size | 928 return os.lstat(self._repo.wjoin(self._path)).st_size |
929 def date(self): | 929 def date(self): |
930 t, tz = self._changectx.date() | 930 t, tz = self._changectx.date() |
931 try: | 931 try: |
932 return (int(os.lstat(self._repo.wjoin(self._path)).st_mtime), tz) | 932 return (int(os.lstat(self._repo.wjoin(self._path)).st_mtime), tz) |
933 except OSError, err: | 933 except OSError, err: |