Show More
@@ -442,6 +442,9 b' class localrepository(object):' | |||||
442 | 'aggressivemergedeltas', False) |
|
442 | 'aggressivemergedeltas', False) | |
443 | self.svfs.options['aggressivemergedeltas'] = aggressivemergedeltas |
|
443 | self.svfs.options['aggressivemergedeltas'] = aggressivemergedeltas | |
444 | self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui) |
|
444 | self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui) | |
|
445 | chainspan = self.ui.configbytes('experimental', 'maxdeltachainspan', -1) | |||
|
446 | if 0 <= chainspan: | |||
|
447 | self.svfs.options['maxdeltachainspan'] = chainspan | |||
445 |
|
448 | |||
446 | for r in self.requirements: |
|
449 | for r in self.requirements: | |
447 | if r.startswith('exp-compression-'): |
|
450 | if r.startswith('exp-compression-'): |
@@ -292,6 +292,7 b' class revlog(object):' | |||||
292 | self._nodecache = {nullid: nullrev} |
|
292 | self._nodecache = {nullid: nullrev} | |
293 | self._nodepos = None |
|
293 | self._nodepos = None | |
294 | self._compengine = 'zlib' |
|
294 | self._compengine = 'zlib' | |
|
295 | self._maxdeltachainspan = -1 | |||
295 |
|
296 | |||
296 | v = REVLOG_DEFAULT_VERSION |
|
297 | v = REVLOG_DEFAULT_VERSION | |
297 | opts = getattr(opener, 'options', None) |
|
298 | opts = getattr(opener, 'options', None) | |
@@ -313,6 +314,8 b' class revlog(object):' | |||||
313 | self._lazydeltabase = bool(opts.get('lazydeltabase', False)) |
|
314 | self._lazydeltabase = bool(opts.get('lazydeltabase', False)) | |
314 | if 'compengine' in opts: |
|
315 | if 'compengine' in opts: | |
315 | self._compengine = opts['compengine'] |
|
316 | self._compengine = opts['compengine'] | |
|
317 | if 'maxdeltachainspan' in opts: | |||
|
318 | self._maxdeltachainspan = opts['maxdeltachainspan'] | |||
316 |
|
319 | |||
317 | if self._chunkcachesize <= 0: |
|
320 | if self._chunkcachesize <= 0: | |
318 | raise RevlogError(_('revlog chunk cache size %r is not greater ' |
|
321 | raise RevlogError(_('revlog chunk cache size %r is not greater ' | |
@@ -1659,7 +1662,13 b' class revlog(object):' | |||||
1659 | # - 'compresseddeltalen' is the sum of the total size of deltas we need |
|
1662 | # - 'compresseddeltalen' is the sum of the total size of deltas we need | |
1660 | # to apply -- bounding it limits the amount of CPU we consume. |
|
1663 | # to apply -- bounding it limits the amount of CPU we consume. | |
1661 | dist, l, data, base, chainbase, chainlen, compresseddeltalen = d |
|
1664 | dist, l, data, base, chainbase, chainlen, compresseddeltalen = d | |
1662 | if (dist > textlen * 4 or l > textlen or |
|
1665 | ||
|
1666 | defaultmax = textlen * 4 | |||
|
1667 | maxdist = self._maxdeltachainspan | |||
|
1668 | if not maxdist: | |||
|
1669 | maxdist = dist # ensure the conditional pass | |||
|
1670 | maxdist = max(maxdist, defaultmax) | |||
|
1671 | if (dist > maxdist or l > textlen or | |||
1663 | compresseddeltalen > textlen * 2 or |
|
1672 | compresseddeltalen > textlen * 2 or | |
1664 | (self._maxchainlen and chainlen > self._maxchainlen)): |
|
1673 | (self._maxchainlen and chainlen > self._maxchainlen)): | |
1665 | return False |
|
1674 | return False |
@@ -161,3 +161,191 b' Test that strip bundle use bundle2' | |||||
161 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft |
|
161 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft | |
162 |
|
162 | |||
163 | $ cd .. |
|
163 | $ cd .. | |
|
164 | ||||
|
165 | test maxdeltachainspan | |||
|
166 | ||||
|
167 | $ hg init source-repo | |||
|
168 | $ cd source-repo | |||
|
169 | $ hg debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc<brancha+2<branchb+2' | |||
|
170 | $ cd .. | |||
|
171 | $ hg -R source-repo debugindex -m | |||
|
172 | rev offset length delta linkrev nodeid p1 p2 | |||
|
173 | 0 0 46 -1 0 19deeef41503 000000000000 000000000000 | |||
|
174 | 1 46 57 0 1 fffc37b38c40 19deeef41503 000000000000 | |||
|
175 | 2 103 57 1 2 5822d75c83d9 fffc37b38c40 000000000000 | |||
|
176 | 3 160 57 2 3 19cf2273e601 5822d75c83d9 000000000000 | |||
|
177 | 4 217 57 3 4 d45ead487afe 19cf2273e601 000000000000 | |||
|
178 | 5 274 57 4 5 96e0c2ce55ed d45ead487afe 000000000000 | |||
|
179 | 6 331 46 -1 6 0c2ea5222c74 000000000000 000000000000 | |||
|
180 | 7 377 57 6 7 4ca08a89134d 0c2ea5222c74 000000000000 | |||
|
181 | 8 434 57 7 8 c973dbfd30ac 4ca08a89134d 000000000000 | |||
|
182 | 9 491 57 8 9 d81d878ff2cd c973dbfd30ac 000000000000 | |||
|
183 | 10 548 58 9 10 dbee7f0dd760 d81d878ff2cd 000000000000 | |||
|
184 | 11 606 58 10 11 474be9f1fd4e dbee7f0dd760 000000000000 | |||
|
185 | 12 664 58 11 12 594a27502c85 474be9f1fd4e 000000000000 | |||
|
186 | 13 722 58 12 13 a7d25307d6a9 594a27502c85 000000000000 | |||
|
187 | 14 780 58 13 14 3eb53082272e a7d25307d6a9 000000000000 | |||
|
188 | 15 838 58 14 15 d1e94c85caf6 3eb53082272e 000000000000 | |||
|
189 | 16 896 58 15 16 8933d9629788 d1e94c85caf6 000000000000 | |||
|
190 | 17 954 58 16 17 a33416e52d91 8933d9629788 000000000000 | |||
|
191 | 18 1012 47 -1 18 4ccbf31021ed 000000000000 000000000000 | |||
|
192 | 19 1059 58 18 19 dcad7a25656c 4ccbf31021ed 000000000000 | |||
|
193 | 20 1117 58 19 20 617c4f8be75f dcad7a25656c 000000000000 | |||
|
194 | 21 1175 58 20 21 975b9c1d75bb 617c4f8be75f 000000000000 | |||
|
195 | 22 1233 58 21 22 74f09cd33b70 975b9c1d75bb 000000000000 | |||
|
196 | 23 1291 58 22 23 54e79bfa7ef1 74f09cd33b70 000000000000 | |||
|
197 | 24 1349 58 23 24 c556e7ff90af 54e79bfa7ef1 000000000000 | |||
|
198 | 25 1407 58 24 25 42daedfe9c6b c556e7ff90af 000000000000 | |||
|
199 | 26 1465 58 25 26 f302566947c7 42daedfe9c6b 000000000000 | |||
|
200 | 27 1523 58 26 27 2346959851cb f302566947c7 000000000000 | |||
|
201 | 28 1581 58 27 28 ca8d867106b4 2346959851cb 000000000000 | |||
|
202 | 29 1639 58 28 29 fd9152decab2 ca8d867106b4 000000000000 | |||
|
203 | 30 1697 58 29 30 3fe34080a79b fd9152decab2 000000000000 | |||
|
204 | 31 1755 58 30 31 bce61a95078e 3fe34080a79b 000000000000 | |||
|
205 | 32 1813 58 31 32 1dd9ba54ba15 bce61a95078e 000000000000 | |||
|
206 | 33 1871 58 32 33 3cd9b90a9972 1dd9ba54ba15 000000000000 | |||
|
207 | 34 1929 58 33 34 5db8c9754ef5 3cd9b90a9972 000000000000 | |||
|
208 | 35 1987 58 34 35 ee4a240cc16c 5db8c9754ef5 000000000000 | |||
|
209 | 36 2045 58 35 36 9e1d38725343 ee4a240cc16c 000000000000 | |||
|
210 | 37 2103 58 36 37 3463f73086a8 9e1d38725343 000000000000 | |||
|
211 | 38 2161 58 37 38 88af72fab449 3463f73086a8 000000000000 | |||
|
212 | 39 2219 58 38 39 472f5ce73785 88af72fab449 000000000000 | |||
|
213 | 40 2277 58 39 40 c91b8351e5b8 472f5ce73785 000000000000 | |||
|
214 | 41 2335 58 40 41 9c8289c5c5c0 c91b8351e5b8 000000000000 | |||
|
215 | 42 2393 58 41 42 a13fd4a09d76 9c8289c5c5c0 000000000000 | |||
|
216 | 43 2451 58 42 43 2ec2c81cafe0 a13fd4a09d76 000000000000 | |||
|
217 | 44 2509 58 43 44 f27fdd174392 2ec2c81cafe0 000000000000 | |||
|
218 | 45 2567 58 44 45 a539ec59fe41 f27fdd174392 000000000000 | |||
|
219 | 46 2625 58 45 46 5e98b9ecb738 a539ec59fe41 000000000000 | |||
|
220 | 47 2683 58 46 47 31e6b47899d0 5e98b9ecb738 000000000000 | |||
|
221 | 48 2741 58 47 48 2cf25d6636bd 31e6b47899d0 000000000000 | |||
|
222 | 49 2799 197 -1 49 9fff62ea0624 96e0c2ce55ed 000000000000 | |||
|
223 | 50 2996 58 49 50 467f8e30a066 9fff62ea0624 000000000000 | |||
|
224 | 51 3054 356 50 51 346db97283df a33416e52d91 000000000000 | |||
|
225 | 52 3410 58 51 52 4e003fd4d5cd 346db97283df 000000000000 | |||
|
226 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes | |||
|
227 | requesting all changes | |||
|
228 | adding changesets | |||
|
229 | adding manifests | |||
|
230 | adding file changes | |||
|
231 | added 53 changesets with 53 changes to 53 files (+2 heads) | |||
|
232 | updating to branch default | |||
|
233 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
234 | $ hg -R relax-chain debugindex -m | |||
|
235 | rev offset length delta linkrev nodeid p1 p2 | |||
|
236 | 0 0 46 -1 0 19deeef41503 000000000000 000000000000 | |||
|
237 | 1 46 57 0 1 fffc37b38c40 19deeef41503 000000000000 | |||
|
238 | 2 103 57 1 2 5822d75c83d9 fffc37b38c40 000000000000 | |||
|
239 | 3 160 57 2 3 19cf2273e601 5822d75c83d9 000000000000 | |||
|
240 | 4 217 57 3 4 d45ead487afe 19cf2273e601 000000000000 | |||
|
241 | 5 274 57 4 5 96e0c2ce55ed d45ead487afe 000000000000 | |||
|
242 | 6 331 46 -1 6 0c2ea5222c74 000000000000 000000000000 | |||
|
243 | 7 377 57 6 7 4ca08a89134d 0c2ea5222c74 000000000000 | |||
|
244 | 8 434 57 7 8 c973dbfd30ac 4ca08a89134d 000000000000 | |||
|
245 | 9 491 57 8 9 d81d878ff2cd c973dbfd30ac 000000000000 | |||
|
246 | 10 548 58 9 10 dbee7f0dd760 d81d878ff2cd 000000000000 | |||
|
247 | 11 606 58 10 11 474be9f1fd4e dbee7f0dd760 000000000000 | |||
|
248 | 12 664 58 11 12 594a27502c85 474be9f1fd4e 000000000000 | |||
|
249 | 13 722 58 12 13 a7d25307d6a9 594a27502c85 000000000000 | |||
|
250 | 14 780 58 13 14 3eb53082272e a7d25307d6a9 000000000000 | |||
|
251 | 15 838 58 14 15 d1e94c85caf6 3eb53082272e 000000000000 | |||
|
252 | 16 896 58 15 16 8933d9629788 d1e94c85caf6 000000000000 | |||
|
253 | 17 954 58 16 17 a33416e52d91 8933d9629788 000000000000 | |||
|
254 | 18 1012 47 -1 18 4ccbf31021ed 000000000000 000000000000 | |||
|
255 | 19 1059 58 18 19 dcad7a25656c 4ccbf31021ed 000000000000 | |||
|
256 | 20 1117 58 19 20 617c4f8be75f dcad7a25656c 000000000000 | |||
|
257 | 21 1175 58 20 21 975b9c1d75bb 617c4f8be75f 000000000000 | |||
|
258 | 22 1233 58 21 22 74f09cd33b70 975b9c1d75bb 000000000000 | |||
|
259 | 23 1291 58 22 23 54e79bfa7ef1 74f09cd33b70 000000000000 | |||
|
260 | 24 1349 58 23 24 c556e7ff90af 54e79bfa7ef1 000000000000 | |||
|
261 | 25 1407 58 24 25 42daedfe9c6b c556e7ff90af 000000000000 | |||
|
262 | 26 1465 58 25 26 f302566947c7 42daedfe9c6b 000000000000 | |||
|
263 | 27 1523 58 26 27 2346959851cb f302566947c7 000000000000 | |||
|
264 | 28 1581 58 27 28 ca8d867106b4 2346959851cb 000000000000 | |||
|
265 | 29 1639 58 28 29 fd9152decab2 ca8d867106b4 000000000000 | |||
|
266 | 30 1697 58 29 30 3fe34080a79b fd9152decab2 000000000000 | |||
|
267 | 31 1755 58 30 31 bce61a95078e 3fe34080a79b 000000000000 | |||
|
268 | 32 1813 58 31 32 1dd9ba54ba15 bce61a95078e 000000000000 | |||
|
269 | 33 1871 58 32 33 3cd9b90a9972 1dd9ba54ba15 000000000000 | |||
|
270 | 34 1929 58 33 34 5db8c9754ef5 3cd9b90a9972 000000000000 | |||
|
271 | 35 1987 58 34 35 ee4a240cc16c 5db8c9754ef5 000000000000 | |||
|
272 | 36 2045 58 35 36 9e1d38725343 ee4a240cc16c 000000000000 | |||
|
273 | 37 2103 58 36 37 3463f73086a8 9e1d38725343 000000000000 | |||
|
274 | 38 2161 58 37 38 88af72fab449 3463f73086a8 000000000000 | |||
|
275 | 39 2219 58 38 39 472f5ce73785 88af72fab449 000000000000 | |||
|
276 | 40 2277 58 39 40 c91b8351e5b8 472f5ce73785 000000000000 | |||
|
277 | 41 2335 58 40 41 9c8289c5c5c0 c91b8351e5b8 000000000000 | |||
|
278 | 42 2393 58 41 42 a13fd4a09d76 9c8289c5c5c0 000000000000 | |||
|
279 | 43 2451 58 42 43 2ec2c81cafe0 a13fd4a09d76 000000000000 | |||
|
280 | 44 2509 58 43 44 f27fdd174392 2ec2c81cafe0 000000000000 | |||
|
281 | 45 2567 58 44 45 a539ec59fe41 f27fdd174392 000000000000 | |||
|
282 | 46 2625 58 45 46 5e98b9ecb738 a539ec59fe41 000000000000 | |||
|
283 | 47 2683 58 46 47 31e6b47899d0 5e98b9ecb738 000000000000 | |||
|
284 | 48 2741 58 47 48 2cf25d6636bd 31e6b47899d0 000000000000 | |||
|
285 | 49 2799 197 -1 49 9fff62ea0624 96e0c2ce55ed 000000000000 | |||
|
286 | 50 2996 58 49 50 467f8e30a066 9fff62ea0624 000000000000 | |||
|
287 | 51 3054 58 17 51 346db97283df a33416e52d91 000000000000 | |||
|
288 | 52 3112 369 -1 52 4e003fd4d5cd 346db97283df 000000000000 | |||
|
289 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.generaldelta=yes | |||
|
290 | requesting all changes | |||
|
291 | adding changesets | |||
|
292 | adding manifests | |||
|
293 | adding file changes | |||
|
294 | added 53 changesets with 53 changes to 53 files (+2 heads) | |||
|
295 | updating to branch default | |||
|
296 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
297 | $ hg -R noconst-chain debugindex -m | |||
|
298 | rev offset length delta linkrev nodeid p1 p2 | |||
|
299 | 0 0 46 -1 0 19deeef41503 000000000000 000000000000 | |||
|
300 | 1 46 57 0 1 fffc37b38c40 19deeef41503 000000000000 | |||
|
301 | 2 103 57 1 2 5822d75c83d9 fffc37b38c40 000000000000 | |||
|
302 | 3 160 57 2 3 19cf2273e601 5822d75c83d9 000000000000 | |||
|
303 | 4 217 57 3 4 d45ead487afe 19cf2273e601 000000000000 | |||
|
304 | 5 274 57 4 5 96e0c2ce55ed d45ead487afe 000000000000 | |||
|
305 | 6 331 46 -1 6 0c2ea5222c74 000000000000 000000000000 | |||
|
306 | 7 377 57 6 7 4ca08a89134d 0c2ea5222c74 000000000000 | |||
|
307 | 8 434 57 7 8 c973dbfd30ac 4ca08a89134d 000000000000 | |||
|
308 | 9 491 57 8 9 d81d878ff2cd c973dbfd30ac 000000000000 | |||
|
309 | 10 548 58 9 10 dbee7f0dd760 d81d878ff2cd 000000000000 | |||
|
310 | 11 606 58 10 11 474be9f1fd4e dbee7f0dd760 000000000000 | |||
|
311 | 12 664 58 11 12 594a27502c85 474be9f1fd4e 000000000000 | |||
|
312 | 13 722 58 12 13 a7d25307d6a9 594a27502c85 000000000000 | |||
|
313 | 14 780 58 13 14 3eb53082272e a7d25307d6a9 000000000000 | |||
|
314 | 15 838 58 14 15 d1e94c85caf6 3eb53082272e 000000000000 | |||
|
315 | 16 896 58 15 16 8933d9629788 d1e94c85caf6 000000000000 | |||
|
316 | 17 954 58 16 17 a33416e52d91 8933d9629788 000000000000 | |||
|
317 | 18 1012 47 -1 18 4ccbf31021ed 000000000000 000000000000 | |||
|
318 | 19 1059 58 18 19 dcad7a25656c 4ccbf31021ed 000000000000 | |||
|
319 | 20 1117 58 19 20 617c4f8be75f dcad7a25656c 000000000000 | |||
|
320 | 21 1175 58 20 21 975b9c1d75bb 617c4f8be75f 000000000000 | |||
|
321 | 22 1233 58 21 22 74f09cd33b70 975b9c1d75bb 000000000000 | |||
|
322 | 23 1291 58 22 23 54e79bfa7ef1 74f09cd33b70 000000000000 | |||
|
323 | 24 1349 58 23 24 c556e7ff90af 54e79bfa7ef1 000000000000 | |||
|
324 | 25 1407 58 24 25 42daedfe9c6b c556e7ff90af 000000000000 | |||
|
325 | 26 1465 58 25 26 f302566947c7 42daedfe9c6b 000000000000 | |||
|
326 | 27 1523 58 26 27 2346959851cb f302566947c7 000000000000 | |||
|
327 | 28 1581 58 27 28 ca8d867106b4 2346959851cb 000000000000 | |||
|
328 | 29 1639 58 28 29 fd9152decab2 ca8d867106b4 000000000000 | |||
|
329 | 30 1697 58 29 30 3fe34080a79b fd9152decab2 000000000000 | |||
|
330 | 31 1755 58 30 31 bce61a95078e 3fe34080a79b 000000000000 | |||
|
331 | 32 1813 58 31 32 1dd9ba54ba15 bce61a95078e 000000000000 | |||
|
332 | 33 1871 58 32 33 3cd9b90a9972 1dd9ba54ba15 000000000000 | |||
|
333 | 34 1929 58 33 34 5db8c9754ef5 3cd9b90a9972 000000000000 | |||
|
334 | 35 1987 58 34 35 ee4a240cc16c 5db8c9754ef5 000000000000 | |||
|
335 | 36 2045 58 35 36 9e1d38725343 ee4a240cc16c 000000000000 | |||
|
336 | 37 2103 58 36 37 3463f73086a8 9e1d38725343 000000000000 | |||
|
337 | 38 2161 58 37 38 88af72fab449 3463f73086a8 000000000000 | |||
|
338 | 39 2219 58 38 39 472f5ce73785 88af72fab449 000000000000 | |||
|
339 | 40 2277 58 39 40 c91b8351e5b8 472f5ce73785 000000000000 | |||
|
340 | 41 2335 58 40 41 9c8289c5c5c0 c91b8351e5b8 000000000000 | |||
|
341 | 42 2393 58 41 42 a13fd4a09d76 9c8289c5c5c0 000000000000 | |||
|
342 | 43 2451 58 42 43 2ec2c81cafe0 a13fd4a09d76 000000000000 | |||
|
343 | 44 2509 58 43 44 f27fdd174392 2ec2c81cafe0 000000000000 | |||
|
344 | 45 2567 58 44 45 a539ec59fe41 f27fdd174392 000000000000 | |||
|
345 | 46 2625 58 45 46 5e98b9ecb738 a539ec59fe41 000000000000 | |||
|
346 | 47 2683 58 46 47 31e6b47899d0 5e98b9ecb738 000000000000 | |||
|
347 | 48 2741 58 47 48 2cf25d6636bd 31e6b47899d0 000000000000 | |||
|
348 | 49 2799 58 5 49 9fff62ea0624 96e0c2ce55ed 000000000000 | |||
|
349 | 50 2857 58 49 50 467f8e30a066 9fff62ea0624 000000000000 | |||
|
350 | 51 2915 58 17 51 346db97283df a33416e52d91 000000000000 | |||
|
351 | 52 2973 58 51 52 4e003fd4d5cd 346db97283df 000000000000 |
General Comments 0
You need to be logged in to leave comments.
Login now