[PATCH 3 of 3] bundle2: store changeset count when creating file bundles

Augie Fackler raf at durin42.com
Mon Jul 18 08:01:35 EDT 2016


On Sun, Jul 17, 2016 at 03:18:23PM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1468793631 25200
> #      Sun Jul 17 15:13:51 2016 -0700
> # Node ID 9680b2eabdafc7ed9428fee7aeff9f65c1511d96
> # Parent  ae56588f5d45ba9443a96c612c70fbfb1f4042df
> bundle2: store changeset count when creating file bundles

Queued, thanks

>
> 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.

Yeah, I agree that this refactoring makes sense. If you'd like to pair
on it at the sprint (or virtually before then), do let me know.

AF


More information about the Mercurial-devel mailing list