Mercurial > hg
comparison tests/test-bundle.t @ 29593:953839de96ab
bundle2: store changeset count when creating file bundles
The bundle2 changegroup part has an advisory param saying how many
changesets are in the part. Before this patch, we were setting
this part when generating bundle2 parts via the wire protocol but
not when generating local bundle2 files.
A side effect of not setting the changeset count part is that progress
bars don't work when applying changesets. As the tests show, this
impacted clone bundles, shelve, backup bundles, `hg unbundle`, and
anything touching bundle2 files.
This patch adds a backdoor to allow us to pass state from
changegroup generation into the unbundler. We store the number
of changesets in the changegroup in this state and use it to
populate the aforementioned advisory part parameter when generating
the bundle2 bundle.
I concede that I'm not thrilled by how state is being passed in
changegroup.py (it feels a bit hacky). I would love to overhaul the
rather confusing set of functions in changegroup.py with something that
passes rich objects around instead of e.g. low-level generators.
However, given the code freeze for 3.9 is imminent, I'd rather not
undertake this endeavor right now. This feels like the easiest way
to get the parameter added to the changegroup part.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 17 Jul 2016 15:13:51 -0700 |
parents | 2e58dc022caa |
children | 519a02267f90 |
comparison
equal
deleted
inserted
replaced
29592:37cccad55410 | 29593:953839de96ab |
---|---|
706 2 changesets found | 706 2 changesets found |
707 list of changesets: | 707 list of changesets: |
708 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a | 708 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a |
709 057f4db07f61970e1c11e83be79e9d08adc4dc31 | 709 057f4db07f61970e1c11e83be79e9d08adc4dc31 |
710 bundle2-output-bundle: "HG20", (1 params) 1 parts total | 710 bundle2-output-bundle: "HG20", (1 params) 1 parts total |
711 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload | 711 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
712 bundling: 1/2 changesets (50.00%) | 712 bundling: 1/2 changesets (50.00%) |
713 bundling: 2/2 changesets (100.00%) | 713 bundling: 2/2 changesets (100.00%) |
714 bundling: 1/2 manifests (50.00%) | 714 bundling: 1/2 manifests (50.00%) |
715 bundling: 2/2 manifests (100.00%) | 715 bundling: 2/2 manifests (100.00%) |
716 bundling: b 1/3 files (33.33%) | 716 bundling: b 1/3 files (33.33%) |