[PATCH 5 of 6 V2] peer: remove lock and addchangegroup from peer and restructure push

Sune Foldager cryo at cyanite.org
Mon Jul 16 16:50:50 CDT 2012


On 2012-07-16 16:12, Matt Mackall wrote:
>On Fri, 2012-07-13 at 22:12 +0200, Sune Foldager wrote:
>> # HG changeset patch
>> # User Sune Foldager <cryo at cyanite.org>
>> # Date 1342209203 -7200
>> # Node ID 258587d53651fcd9088bd338fac667b9ecc19243
>> # Parent  a5e5cf65a270907eca0e1249a2699b64b7a05d0d
>> peer: remove lock and addchangegroup from peer and restructure push
>>
>> The lock/addchangegroup code path for local remotes assumed no support for
>> unbundle on localrepo/peer. This is now no longer the case.
>
>This really doesn't look like a design win. If we were doing away with
>lock on push entirely, great, let's do this. But I don't see that we're
>going to drop push locking on local peers or ssh.. ever. So this just
>makes things a bit uglier.

Well, I tend to agree, but at the same time it also removes lock and
addchangegroup from the peer API, which keeps it clean. We already have
special-case code for local remotes in several other places as well.

It also makes it a bit more explicit when we're using the legacy ssh path.

But more importantly, since localpeer (like all peers) supports 'unbundle',
the old code path for local repos will now never be invoked, and it will
use unbundle on local remotes. Since we'll need to check for that case
now anyway, I thought I might as well combine that with the legacy ssh
case, since they are doing the exact same thing.

(of course tests won't pick up on this slowdown.)

>I've queued patches 1-4 for default, thanks.

Awesome :)

-Sune


More information about the Mercurial-devel mailing list