Show More
@@ -1161,6 +1161,7 b' coreconfigitem(' | |||||
1161 | # keeping references to the affected revlogs, especially memory-wise when |
|
1161 | # keeping references to the affected revlogs, especially memory-wise when | |
1162 | # rewriting sidedata. |
|
1162 | # rewriting sidedata. | |
1163 | # * introduce a proper solution to reduce the number of filelog related files. |
|
1163 | # * introduce a proper solution to reduce the number of filelog related files. | |
|
1164 | # * use caching for reading sidedata (similar to what we do for data). | |||
1164 | # * Improvement to consider |
|
1165 | # * Improvement to consider | |
1165 | # - avoid compression header in chunk using the default compression? |
|
1166 | # - avoid compression header in chunk using the default compression? | |
1166 | # - forbid "inline" compression mode entirely? |
|
1167 | # - forbid "inline" compression mode entirely? |
@@ -803,6 +803,10 b' class revlog(object):' | |||||
803 | with func() as fp: |
|
803 | with func() as fp: | |
804 | yield fp |
|
804 | yield fp | |
805 |
|
805 | |||
|
806 | def _sidedatareadfp(self): | |||
|
807 | """file object suitable to read sidedata""" | |||
|
808 | return self._datareadfp() | |||
|
809 | ||||
806 | def tiprev(self): |
|
810 | def tiprev(self): | |
807 | return len(self.index) - 1 |
|
811 | return len(self.index) - 1 | |
808 |
|
812 | |||
@@ -2068,7 +2072,19 b' class revlog(object):' | |||||
2068 | if sidedata_size == 0: |
|
2072 | if sidedata_size == 0: | |
2069 | return {} |
|
2073 | return {} | |
2070 |
|
2074 | |||
2071 | comp_segment = self._getsegment(sidedata_offset, sidedata_size) |
|
2075 | # XXX this need caching, as we do for data | |
|
2076 | with self._sidedatareadfp() as sdf: | |||
|
2077 | sdf.seek(sidedata_offset) | |||
|
2078 | comp_segment = sdf.read(sidedata_size) | |||
|
2079 | ||||
|
2080 | if len(comp_segment) < sidedata_size: | |||
|
2081 | filename = self._datafile | |||
|
2082 | length = sidedata_size | |||
|
2083 | offset = sidedata_offset | |||
|
2084 | got = len(comp_segment) | |||
|
2085 | m = PARTIAL_READ_MSG % (filename, length, offset, got) | |||
|
2086 | raise error.RevlogError(m) | |||
|
2087 | ||||
2072 | comp = self.index[rev][11] |
|
2088 | comp = self.index[rev][11] | |
2073 | if comp == COMP_MODE_PLAIN: |
|
2089 | if comp == COMP_MODE_PLAIN: | |
2074 | segment = comp_segment |
|
2090 | segment = comp_segment |
General Comments 0
You need to be logged in to leave comments.
Login now