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

sune.foldager at me.com sune.foldager at me.com
Tue Sep 2 09:06:31 CDT 2014


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.

I think bundle2 will fully support being written and read from disk soon as well. How do you propose this would work? It’s not like we can generate both changegroup formats and stick them in all bundle2s generated all the time. Could you just refer to a bundle2 instead of bundle10 in the future when we can produce bundle2’s to disk?

Maybe I’m confused :p

-Sune


More information about the Mercurial-devel mailing list