[PATCH 3 of 6] hg: replace repository(remoteui) with peer()

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Mon Jun 13 06:31:26 CDT 2011


On Mon, Jun 13, 2011 at 12:04 AM, Matt Mackall <mpm at selenic.com> wrote:
> On Wed, 2011-06-08 at 18:45 +0200, Peter Arrenbrecht wrote:
>> # HG changeset patch
>> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
>> # Date 1307550324 -7200
>> hg: replace repository(remoteui) with peer()
>
> I've spent a while poking at this; looks like refactoring things into a
> state where they can be finished before the 1.9 freeze isn't going to
> happen.
>
> My goal is to have peer.local() return a repo object if one is available
> and to have no method going the other way.

Yes, that makes it quite a bit harder if you still want to aim for
peer and repo having different method names to ensure we don't
accidentally use a repo where we should use a peer, and vice versa. I
guess it essentially means code like the one in transplant will have
to keep track of the peer associated with "source" by itself, instead
of being able to just call source.peer() where needed. I can see how
not having .peer() forces users to more clearly think about peers and
repos, instead of simply using .peer() and .repo() to switch
willy-nilly. But maybe our review process would be enough to avoid
that?

I guess this also means we still don't have a proper place where
batching can be added. I could simply add it to wirerepo for now and
only use it in discovery if the capability is supported, which
localrepo would not. My goal is to have batching support in servers in
1.9 if at all possible.

-parren


More information about the Mercurial-devel mailing list