921 try: |
923 try: |
922 offset, data = self.get_segment_for_revs(firstrev, lastrev) |
924 offset, data = self.get_segment_for_revs(firstrev, lastrev) |
923 except OverflowError: |
925 except OverflowError: |
924 # issue4215 - we can't cache a run of chunks greater than |
926 # issue4215 - we can't cache a run of chunks greater than |
925 # 2G on Windows |
927 # 2G on Windows |
926 return [self._chunk(rev) for rev in revschunk] |
928 for rev in revschunk: |
|
929 ladd((rev, self._chunk(rev))) |
927 |
930 |
928 decomp = self.decompress |
931 decomp = self.decompress |
929 # self._decompressor might be None, but will not be used in that case |
932 # self._decompressor might be None, but will not be used in that case |
930 def_decomp = self._decompressor |
933 def_decomp = self._decompressor |
931 for rev in revschunk: |
934 for rev in revschunk: |
934 chunkstart += (rev + 1) * iosize |
937 chunkstart += (rev + 1) * iosize |
935 chunklength = length(rev) |
938 chunklength = length(rev) |
936 comp_mode = self.index[rev][10] |
939 comp_mode = self.index[rev][10] |
937 c = buffer(data, chunkstart - offset, chunklength) |
940 c = buffer(data, chunkstart - offset, chunklength) |
938 if comp_mode == COMP_MODE_PLAIN: |
941 if comp_mode == COMP_MODE_PLAIN: |
939 ladd(c) |
942 c = c |
940 elif comp_mode == COMP_MODE_INLINE: |
943 elif comp_mode == COMP_MODE_INLINE: |
941 ladd(decomp(c)) |
944 c = decomp(c) |
942 elif comp_mode == COMP_MODE_DEFAULT: |
945 elif comp_mode == COMP_MODE_DEFAULT: |
943 ladd(def_decomp(c)) |
946 c = def_decomp(c) |
944 else: |
947 else: |
945 msg = b'unknown compression mode %d' |
948 msg = b'unknown compression mode %d' |
946 msg %= comp_mode |
949 msg %= comp_mode |
947 raise error.RevlogError(msg) |
950 raise error.RevlogError(msg) |
948 |
951 ladd((rev, c)) |
949 return l |
952 |
|
953 return [x[1] for x in chunks] |
950 |
954 |
951 def raw_text(self, node, rev): |
955 def raw_text(self, node, rev): |
952 """return the possibly unvalidated rawtext for a revision |
956 """return the possibly unvalidated rawtext for a revision |
953 |
957 |
954 returns (rev, rawtext, validated) |
958 returns (rev, rawtext, validated) |