[PATCH 2 of 2] bundle2: add support for changegroup2

sune.foldager at me.com sune.foldager at me.com
Wed Sep 3 03:03:50 CDT 2014

On 02/09/2014, at 16:06, sune.foldager at me.com wrote:

> On 02/09/2014, at 15:11, Mike Hommey <mh at glandium.org> wrote:
>> On Tue, Sep 02, 2014 at 01:50:49PM +0200, sune.foldager at me.com wrote:
>>> On 02/09/2014, at 13:36, Mike Hommey <mh at glandium.org> wrote:
>>>> On Tue, Sep 02, 2014 at 12:46:50PM +0200, sune.foldager at me.com
>>>> wrote:
>>>>> I accidentally included a commented-out print-statement in the
>>>>> delta parent function below.
>>>>> Pierre-Yves wanted bundle2 to be able to include both cg1 and cg2,
>>>>> but I don’t see why we need that; this change will break existing
>>>>> bundle2 anyway, so people who use it will need to update both ends
>>>>> in all cases. Pierre-Yves, what do you think?
>>>> FWIW, one usecase of my most recent patch was to allow for a
>>>> mercurial server to provide a bundle2 with one part being a link to
>>>> an existing bundle10 we refresh every day at Mozilla, and have the
>>>> client understand that. That requires bundle2 to be able to include
>>>> both cg1 and cg2.
>>> I don’t think I understand.. do you have custom code that reads the
>>> bundle2’s and extracts the cg1 (which is pretty much a bundle1) and
>>> applies it to some other repo automatically, or something like that?
>> No, I have code that adds a new part type to bundle2 that gives a
>> url pointer to a cg1, and the patch I recently sent [1] takes care of
>> the client handling that. To avoid code repetition (and for
>> consistency), that relies on the bundle2 handling of the
>> b2x:changegroup part, which needs to support cg1 for that to work.
>> 1. http://www.selenic.com/pipermail/mercurial-devel/2014-September/061279.html
> Ok. I don’t think it’s a good idea to use readbundle at that point, since it’s intended to read actual bundles (1 or 2), and not changegroups. Of course bundle 1’s are identical to changegroups but not so for bundle2, and I think we’d like to return something richer than just a changegroup from readbundle at some point.

To expand a bit, I want to move writebundle to exchange as well, and change things a bit. The current design is not great, as writebundle takes a bundle (currently just  cg1) and a bundletype. We want to be able to pass in bundle10s and bundle2s, not just bundle10=cg1. That means bundletype has to match the passed in bundle which is obviously unfortunate. Instead writebundle should just get the compression type passed in, if even that, and then get the necessary bundle header from the bundle object. We will still need to support passing in the old types (HG10UN etc.) due to the wire protocol. I’ll make a patch for this :)


More information about the Mercurial-devel mailing list