=== modified file 'groupcompress.py' --- groupcompress.py 2008-07-25 02:50:05 +0000 +++ groupcompress.py 2008-07-25 20:18:06 +0000 @@ -484,6 +484,12 @@ absent_keys = keys.difference(set(locations)) for key in absent_keys: yield AbsentContentFactory(key) + + # This is a special case when we are extracting a few texts from the + # same zdata chunk. It isn't perfect, but for revision texts we often + # grab several next to eachother. + last_read_memo = None + last_plain = None for key in present_keys: if key in self._unadded_refs: lines, sha1 = self._compressor.extract(key) @@ -492,9 +498,14 @@ index_memo, _, parents, (method, _) = locations[key] # read read_memo = index_memo[0:3] - zdata = self._access.get_raw_records([read_memo]).next() - # decompress - plain = zlib.decompress(zdata) + if last_read_memo == read_memo: + plain = last_plain + else: + zdata = self._access.get_raw_records([read_memo]).next() + # decompress + plain = zlib.decompress(zdata) + last_read_memo = read_memo + last_plain = plain # parse delta_lines = split_lines(plain[index_memo[3]:index_memo[4]]) label, sha1, delta = parse(delta_lines)