##// END OF EJS Templates
revlog: minor refactor in the chunk gather process...
marmoute -
r52000:c2d2e5b6 default
parent child Browse files
Show More
@@ -901,6 +901,8 b' class _InnerRevlog:'
901
901
902 l = []
902 l = []
903 ladd = l.append
903 ladd = l.append
904 chunks = []
905 ladd = chunks.append
904
906
905 if not self.data_config.with_sparse_read:
907 if not self.data_config.with_sparse_read:
906 slicedchunks = (revs,)
908 slicedchunks = (revs,)
@@ -923,7 +925,8 b' class _InnerRevlog:'
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
@@ -936,17 +939,18 b' class _InnerRevlog:'
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
General Comments 0
You need to be logged in to leave comments. Login now