revlog: fix undefined variable introduced in 5726bb290bfe
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 25 May 2009 13:52:09 +0200
changeset 8619 6f21613d25a2
parent 8618 cf6f567e27e9
child 8620 b38f275bb5c2
revlog: fix undefined variable introduced in 5726bb290bfe
mercurial/revlog.py
--- 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)