Mercurial > hg
comparison tests/test-bundle.t @ 27251:d9bfe6289acf
revlog: don't consider nullrev when choosing delta base
In the most complex case, we try using the incoming delta base, then
we try both parents, and then we try the previous revlog entry. If
none of these result in a good delta, we natually use the null
revision as base. However, we sometimes consider the nullrev before we
have exhausted our other options. Specifically, when both parents are
null, we use the nullrev as delta base if it produces a good delta
(according to _isgooddelta()), and we fail to try the previous revlog
entry as delta base. After 20a9226bdc8a (addrevision: use general
delta when the incoming base delta is bad, 2015-12-01), it can also
happen for non-merge commits when the incoming delta is not good.
The Firefox repo (from many months back) shrinks a tiny bit with this
patch: from 1.855GB to 1.830GB (1.4%). The hg repo itself shrinks even
less: by less than 0.1%. There may be repos that get larger instead.
This undoes the unexplained test change in 20a9226bdc8a.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 04 Dec 2015 17:46:56 -0800 |
parents | 20a9226bdc8a |
children | d6d3cf5fda6f |
comparison
equal
deleted
inserted
replaced
27250:bff71fe05768 | 27251:d9bfe6289acf |
---|---|
264 [255] | 264 [255] |
265 | 265 |
266 packed1 is produced properly | 266 packed1 is produced properly |
267 | 267 |
268 $ hg -R test debugcreatestreamclonebundle packed.hg | 268 $ hg -R test debugcreatestreamclonebundle packed.hg |
269 writing 2667 bytes for 6 files | 269 writing 2663 bytes for 6 files |
270 bundle requirements: generaldelta, revlogv1 | 270 bundle requirements: generaldelta, revlogv1 |
271 | 271 |
272 $ f -B 64 --size --sha1 --hexdump packed.hg | 272 $ f -B 64 --size --sha1 --hexdump packed.hg |
273 packed.hg: size=2830, sha1=c28255110a88ffa52ddc44985cad295b1ab349bc | 273 packed.hg: size=2826, sha1=e139f97692a142b19cdcff64a69697d5307ce6d4 |
274 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........| | 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 6b 00 16 67 65 6e 65 72 61 6c 64 |.....k..generald| | 275 0010: 00 00 00 00 0a 67 00 16 67 65 6e 65 72 61 6c 64 |.....g..generald| |
276 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da| | 276 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da| |
277 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil| | 277 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil| |
278 | 278 |
279 generaldelta requirement is listed in stream clone bundles | 279 generaldelta requirement is listed in stream clone bundles |
280 | 280 |