[PATCH] [RFC] wireproto: avoid discovery when local graph is a subset of remote

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Wed Mar 16 06:55:40 CDT 2011


On Mon, Mar 14, 2011 at 7:52 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Sun, 2011-03-13 at 13:09 +0100, Peter Arrenbrecht wrote:
>> # HG changeset patch
>> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
>> # Date 1300018073 -3600
>> [RFC] wireproto: avoid discovery when local graph is a subset of remote
>>
>> The idea is to immediately send local's heads to the server to check whether the server
>> knows them all. If it does, we can request a changegroup immediately. This required the
>> introduction of two new wireproto calls:
>>
>>   known([Node]) -> [1/0]
>>     Returns 1/0 for each node, indicating whether it's known by the server.
>
> Ok. Separate patch, please.

Shall do. Assuming this will need its own capability.

>>   changegroupdiff(commonheads, heads, ...)
>>     Returns the changegroup for everything ancestral of heads, but not ancestral of
>>     commonheads.
>
> This is a problem. We've got like four features that want to send a new
> type of changegroup, I'm not going to add four new commands. We've had
> varargs support in the protocol for most of a year now precisely so that
> a future changegroup command could take feature flags.
>
> We should aim to add only one new changegroup command. And ideally
> engineer it such that we can hide all the fallback code in wireproto.

Benoit said you wanted something like getbundle(). So is this what you
are thinking of:

  getbundle(self, source, heads=None, common=None, extras=None)

which can then be extended as needed with additional params for
lightweight copies etc.? Remarks:

 * I did not include "bases=None" here because there seems to be
consensus that in the future we should switch to common instead of
bases. And there still is changegroupsubset.

 * I have a default of None for heads because one option for one less
roundtrip for pull when local is a subset of remote is to simply try
getbundle(common=localheads) and specify that getbundle must return an
error if any of the nodes in common are not, in fact, known (and
therefore by definition not a head of common).

-parren


More information about the Mercurial-devel mailing list