# HG changeset patch # User Benoit Boissinot # Date 1243252329 -7200 # Node ID 6f21613d25a272a371249ef357cc53c2592dd999 # Parent cf6f567e27e9f5ec9e2d20a04e172275c96a859b revlog: fix undefined variable introduced in 5726bb290bfe diff -r cf6f567e27e9 -r 6f21613d25a2 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)