Show More
@@ -1424,22 +1424,23 b' class revlog(object):' | |||
|
1424 | 1424 | |
|
1425 | 1425 | # should we try to build a delta? |
|
1426 | 1426 | if prev != nullrev: |
|
1427 | tested = set() | |
|
1427 | 1428 | if cachedelta and self._generaldelta and self._lazydeltabase: |
|
1428 | 1429 | # Assume what we received from the server is a good choice |
|
1429 | 1430 | # build delta will reuse the cache |
|
1430 | 1431 | candidatedelta = builddelta(cachedelta[0]) |
|
1432 | tested.add(candidatedelta[3]) | |
|
1431 | 1433 | if self._isgooddelta(candidatedelta, textlen): |
|
1432 | 1434 | delta = candidatedelta |
|
1433 | elif prev != candidatedelta[3]: | |
|
1434 | # Try against prev to hopefully save us a fulltext. | |
|
1435 | delta = builddelta(prev) | |
|
1436 | elif self._generaldelta: | |
|
1435 | if delta is None and self._generaldelta: | |
|
1437 | 1436 | parents = [p1r, p2r] |
|
1438 | if not self._aggressivemergedeltas: | |
|
1437 | # exclude already lazy tested base if any | |
|
1438 | parents = [p for p in parents if p not in tested] | |
|
1439 | if parents and not self._aggressivemergedeltas: | |
|
1439 | 1440 | # Pick whichever parent is closer to us (to minimize the |
|
1440 |
# chance of having to build a fulltext). |
|
|
1441 | # nullrev == -1, any non-merge commit will always pick p1r. | |
|
1441 | # chance of having to build a fulltext). | |
|
1442 | 1442 | parents = [max(parents)] |
|
1443 | tested.update(parents) | |
|
1443 | 1444 | pdeltas = [] |
|
1444 | 1445 | for p in parents: |
|
1445 | 1446 | pd = builddelta(p) |
@@ -1447,11 +1448,9 b' class revlog(object):' | |||
|
1447 | 1448 | pdeltas.append(pd) |
|
1448 | 1449 | if pdeltas: |
|
1449 | 1450 | delta = min(pdeltas, key=lambda x: x[1]) |
|
1450 |
|
|
|
1451 |
|
|
|
1452 |
|
|
|
1453 | delta = builddelta(prev) | |
|
1454 | else: | |
|
1451 | if delta is None and prev not in tested: | |
|
1452 | # other approach failed try against prev to hopefully save us a | |
|
1453 | # fulltext. | |
|
1455 | 1454 | delta = builddelta(prev) |
|
1456 | 1455 | if delta is not None: |
|
1457 | 1456 | dist, l, data, base, chainbase, chainlen, compresseddeltalen = delta |
@@ -266,13 +266,13 b' Cannot produce streaming clone bundles w' | |||
|
266 | 266 | packed1 is produced properly |
|
267 | 267 | |
|
268 | 268 | $ hg -R test debugcreatestreamclonebundle packed.hg |
|
269 |
writing 266 |
|
|
269 | writing 2667 bytes for 6 files | |
|
270 | 270 | bundle requirements: generaldelta, revlogv1 |
|
271 | 271 | |
|
272 | 272 | $ f -B 64 --size --sha1 --hexdump packed.hg |
|
273 | packed.hg: size=2826, sha1=e139f97692a142b19cdcff64a69697d5307ce6d4 | |
|
273 | packed.hg: size=2830, sha1=c28255110a88ffa52ddc44985cad295b1ab349bc | |
|
274 | 274 | 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........| |
|
275 |
0010: 00 00 00 00 0a 6 |
|
|
275 | 0010: 00 00 00 00 0a 6b 00 16 67 65 6e 65 72 61 6c 64 |.....k..generald| | |
|
276 | 276 | 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da| |
|
277 | 277 | 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil| |
|
278 | 278 |
@@ -105,7 +105,7 b' delta coming from the server base delta ' | |||
|
105 | 105 | 0 0 104 -1 0 cef96823c800 000000000000 000000000000 |
|
106 | 106 | 1 104 57 0 1 58ab9a8d541d cef96823c800 000000000000 |
|
107 | 107 | 2 161 57 1 2 134fdc6fd680 cef96823c800 000000000000 |
|
108 |
3 218 |
|
|
108 | 3 218 57 0 3 723508934dad cef96823c800 000000000000 | |
|
109 | 109 | $ hg -R full debugindex -m |
|
110 | 110 | rev offset length delta linkrev nodeid p1 p2 |
|
111 | 111 | 0 0 104 -1 0 cef96823c800 000000000000 000000000000 |
General Comments 0
You need to be logged in to leave comments.
Login now