Mercurial > hg
comparison mercurial/revlog.py @ 3089:e7fc04dc6349
Avoid negative block sizes in lazyparser.
This fixes a bug introduced by changeset baa3873eb387 .
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Wed, 13 Sep 2006 14:37:51 -0300 |
parents | baa3873eb387 |
children | cff3c58a5766 |
comparison
equal
deleted
inserted
replaced
3088:dc784839516d | 3089:e7fc04dc6349 |
---|---|
141 self.dataf.seek(blockstart) | 141 self.dataf.seek(blockstart) |
142 if blockstart + blocksize > self.datasize: | 142 if blockstart + blocksize > self.datasize: |
143 # the revlog may have grown since we've started running, | 143 # the revlog may have grown since we've started running, |
144 # but we don't have space in self.index for more entries. | 144 # but we don't have space in self.index for more entries. |
145 # limit blocksize so that we don't get too much data. | 145 # limit blocksize so that we don't get too much data. |
146 blocksize = self.datasize - blockstart | 146 blocksize = max(self.datasize - blockstart, 0) |
147 data = self.dataf.read(blocksize) | 147 data = self.dataf.read(blocksize) |
148 lend = len(data) / self.s | 148 lend = len(data) / self.s |
149 i = blockstart / self.s | 149 i = blockstart / self.s |
150 off = 0 | 150 off = 0 |
151 for x in xrange(lend): | 151 for x in xrange(lend): |