# HG changeset patch # User Alexis S. L. Carvalho # Date 1158169071 10800 # Node ID e7fc04dc6349cc171aba8c6cdeb4f2716386c440 # Parent dc784839516d1104bb48282a87e4cc6c4adc9cf1 Avoid negative block sizes in lazyparser. This fixes a bug introduced by changeset baa3873eb387 . diff --git a/mercurial/revlog.py b/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