# HG changeset patch # User Nicolas Dumazet # Date 2010-07-16 07:33:55 # Node ID ce95d8b87d22033f6d8a9a8208b8a84521ae2614 # Parent 76454cbc11e48d692262843d0c87e81bbb2c053c 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. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -925,7 +925,7 @@ class workingfilectx(filectx): 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: