[RFC] Server-side branching

Martin Pool mbp at sourcefrog.net
Tue Jun 5 08:06:02 BST 2007


On 6/5/07, Andrew Bennetts <andrew at canonical.com> wrote:
> This is very hackish (see the commit message in the bundle) at the moment, but
> I think this could be useful.  It makes the smart server and client handle
> the repository copying part of:
>
>     bzr branch bzr+ssh://same-host/aaa bzr+ssh://same-host/bbb
>
> entirely on the server, thus avoiding sending the whole branch over the network
> twice.

Yes, that sounds very useful.

> Thoughts?

As we add new commands that do more than the transport layer we should
make sure they're documented somewhere.  The Request class is probably
a good place, so rather than just

+    """Server-side repository content fetching."""

we should probably make a practice of saying what the parameters are,
what specifically it does, and in what bzr version it was introduced
and (where applicable) deprecated.

The name 'fetch_to' seems strange - it's invoked as
target.fetch_to(source) iiuc, so it really acts like 'fetch_from'.

Maybe we should really be passing the whole 'branch' operation across
rather than just the 'fetch'?  Maybe this fetch is an easier step for
now.

+            # XXX: what about <= 0.16 servers that don't have this method?
+            raise errors.UnexpectedSmartServerResponse(response)

Don't we have support now to say that this was specifically 'command
not understood', rather than a more general error?  If not, we should
add it, and the caller (sprout) can then catch that and fall back to
the old method.

Your patch assumes that if the hostname is the same, we can ask the
server to do the branching.  That's probably reasonable in general,
but as Robert notes sometimes it won't work, and the server needs a
way to decline.

-- 
Martin



More information about the bazaar mailing list