context: use os.lstat instead of os.stat to fetch file size stable
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Fri, 16 Jul 2010 16:33:55 +0900
branchstable
changeset 11605 ce95d8b87d22
parent 11600 76454cbc11e4
child 11610 26175823b9d4
child 11611 4f5a6df2af92
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.
mercurial/context.py
--- 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: