changeset 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 76454cbc11e4
children 26175823b9d4 4f5a6df2af92
files mercurial/context.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Fri Jul 16 14:44:30 2010 +0200
+++ b/mercurial/context.py	Fri Jul 16 16:33:55 2010 +0900
@@ -925,7 +925,7 @@
         return []
 
     def size(self):
-        return os.stat(self._repo.wjoin(self._path)).st_size
+        return os.lstat(self._repo.wjoin(self._path)).st_size
     def date(self):
         t, tz = self._changectx.date()
         try: