[PATCH 4 of 4] bundle2: Remove unused heads and common arguments to getbundle2partsgenerator functions

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Sep 24 23:21:25 CDT 2014



On 09/24/2014 09:16 PM, Mike Hommey wrote:
> On Wed, Sep 24, 2014 at 08:59:10PM -0700, Pierre-Yves David wrote:
>>
>>
>> On 09/24/2014 07:56 PM, Mike Hommey wrote:
>>> # HG changeset patch
>>> # User Mike Hommey <mh at glandium.org>
>>> # Date 1411613656 -32400
>>> #      Thu Sep 25 11:54:16 2014 +0900
>>> # Node ID e36dcfe3f313c0183524050f32b74fc040182995
>>> # Parent  17baf7a6335c720094b1e4d1b2b2c9d9911b5ba5
>>> bundle2: Remove unused heads and common arguments to getbundle2partsgenerator functions
>>
>> I had something a bit more radical in mind, heads and common should stop
>> being passed explicitly at any of the bundle2 function. The first arguments
>> would be bundler, repo, source, bundlecaps, and bundlecaps2. And the heads +
>> common one would be passed through kwargs in all cases.
>> (so nothing in wrong in the patch, but the callling should change too as
>> well as arguments order in getchangegrouppart)
>
> I'm not sure what there is to gain from changing:
>            func(bundler, repo, source, heads=heads, common=common,
>                         bundlecaps=bundlecaps, b2caps=b2caps, **kwargs)
>
> to
>            kwargs['heads'] = heads
>            kwargs['common'] = common
>            func(bundler, repo, source, bundlecaps=bundlecaps, b2caps=b2caps,
>                 **kwargs)
>
> when from the callee's perspective there's no difference. There would be
> a difference if kwargs was passed as a plain argument, not as **kwargs.

The difference is only semantical. it highly the fact heads and common 
should not be seen as special.

It will also help people that want to drop the keyword argument in front 
on bundlecaps and b2caps (such brave people)


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list