Show More
@@ -50,7 +50,6 b' class _testrevlog:' | |||||
50 | from .. import revlog |
|
50 | from .. import revlog | |
51 |
|
51 | |||
52 | self._data = data |
|
52 | self._data = data | |
53 | self._srmingapsize = mingap |
|
|||
54 | self.data_config = revlog.DataConfig() |
|
53 | self.data_config = revlog.DataConfig() | |
55 | self.data_config.sr_density_threshold = density |
|
54 | self.data_config.sr_density_threshold = density | |
56 | self.data_config.sr_min_gap_size = mingap |
|
55 | self.data_config.sr_min_gap_size = mingap | |
@@ -91,11 +90,11 b' def slicechunk(revlog, revs, targetsize=' | |||||
91 |
|
90 | |||
92 | The initial chunk is sliced until the overall density (payload/chunks-span |
|
91 | The initial chunk is sliced until the overall density (payload/chunks-span | |
93 | ratio) is above `revlog.data_config.sr_density_threshold`. No gap smaller |
|
92 | ratio) is above `revlog.data_config.sr_density_threshold`. No gap smaller | |
94 | than `revlog._srmingapsize` is skipped. |
|
93 | than `revlog.data_config.sr_min_gap_size` is skipped. | |
95 |
|
94 | |||
96 | If `targetsize` is set, no chunk larger than `targetsize` will be yield. |
|
95 | If `targetsize` is set, no chunk larger than `targetsize` will be yield. | |
97 | For consistency with other slicing choice, this limit won't go lower than |
|
96 | For consistency with other slicing choice, this limit won't go lower than | |
98 | `revlog._srmingapsize`. |
|
97 | `revlog.data_config.sr_min_gap_size`. | |
99 |
|
98 | |||
100 | If individual revisions chunk are larger than this limit, they will still |
|
99 | If individual revisions chunk are larger than this limit, they will still | |
101 | be raised individually. |
|
100 | be raised individually. | |
@@ -144,14 +143,16 b' def slicechunk(revlog, revs, targetsize=' | |||||
144 | [[-1], [13], [15]] |
|
143 | [[-1], [13], [15]] | |
145 | """ |
|
144 | """ | |
146 | if targetsize is not None: |
|
145 | if targetsize is not None: | |
147 | targetsize = max(targetsize, revlog._srmingapsize) |
|
146 | targetsize = max(targetsize, revlog.data_config.sr_min_gap_size) | |
148 | # targetsize should not be specified when evaluating delta candidates: |
|
147 | # targetsize should not be specified when evaluating delta candidates: | |
149 | # * targetsize is used to ensure we stay within specification when reading, |
|
148 | # * targetsize is used to ensure we stay within specification when reading, | |
150 | densityslicing = getattr(revlog.index, 'slicechunktodensity', None) |
|
149 | densityslicing = getattr(revlog.index, 'slicechunktodensity', None) | |
151 | if densityslicing is None: |
|
150 | if densityslicing is None: | |
152 | densityslicing = lambda x, y, z: _slicechunktodensity(revlog, x, y, z) |
|
151 | densityslicing = lambda x, y, z: _slicechunktodensity(revlog, x, y, z) | |
153 | for chunk in densityslicing( |
|
152 | for chunk in densityslicing( | |
154 | revs, revlog.data_config.sr_density_threshold, revlog._srmingapsize |
|
153 | revs, | |
|
154 | revlog.data_config.sr_density_threshold, | |||
|
155 | revlog.data_config.sr_min_gap_size, | |||
155 | ): |
|
156 | ): | |
156 | for subchunk in _slicechunktosize(revlog, chunk, targetsize): |
|
157 | for subchunk in _slicechunktosize(revlog, chunk, targetsize): | |
157 | yield subchunk |
|
158 | yield subchunk |
General Comments 0
You need to be logged in to leave comments.
Login now