[PATCH] [RFC] wireproto: avoid discovery when local graph is a subset of remote
Matt Mackall
mpm at selenic.com
Wed Mar 16 13:45:00 UTC 2011
On Wed, 2011-03-16 at 12:55 +0100, Peter Arrenbrecht wrote:
> 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)
I think what's missing here is '**options'. That has to be in the
prototype from the beginning.
> * 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
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list