changeset 8619:6f21613d25a2

revlog: fix undefined variable introduced in 5726bb290bfe
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 25 May 2009 13:52:09 +0200
parents cf6f567e27e9
children b38f275bb5c2
files mercurial/revlog.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Sun May 24 22:17:10 2009 +0200
+++ b/mercurial/revlog.py	Mon May 25 13:52:09 2009 +0200
@@ -362,8 +362,13 @@
         self.size = struct.calcsize(indexformatng)
 
     def parseindex(self, fp, data, inline):
-        if len(data) == _prereadsize:
+        size = len(data)
+        if size == _prereadsize:
             if util.openhardlinks() and not inline:
+                try:
+                    size = util.fstat(fp).st_size
+                except AttributeError:
+                    size = 0
                 # big index, let's parse it on demand
                 parser = lazyparser(fp, size)
                 index = lazyindex(parser)