Avoid negative block sizes in lazyparser.
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Wed, 13 Sep 2006 14:37:51 -0300
changeset 3086 e7fc04dc6349
parent 3085 dc784839516d
child 3087 eeaf9bcdfa25
Avoid negative block sizes in lazyparser. This fixes a bug introduced by changeset baa3873eb387 .
mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -143,7 +143,7 @@ class lazyparser(object):
                 # the revlog may have grown since we've started running,
                 # but we don't have space in self.index for more entries.
                 # limit blocksize so that we don't get too much data.
-                blocksize = self.datasize - blockstart
+                blocksize = max(self.datasize - blockstart, 0)
             data = self.dataf.read(blocksize)
         lend = len(data) / self.s
         i = blockstart / self.s