graphs and the smart server
Robert Collins
robertc at robertcollins.net
Mon May 7 09:37:55 BST 2007
On Mon, 2007-05-07 at 17:57 +1000, Martin Pool wrote:
> On 5/7/07, Robert Collins <robertc at robertcollins.net> wrote:
> > I propose that we add a __iter__ method to Graph which will allow Graph
> > to be used as the input to various repository methods; then with an
> > InterRepository specialisation for to/from RemoteRepository, we can
> > transparently kick in this remote negotiation logic.
>
> OK - what would that iterate? Can you give some pseudocode for how it
> would be used?
So image an API to obtain a bundle from a repository:
def get_bundle(self, revisions):
on RemoteRepository if revisions is a RemoteGraph, it would send a smart
server method:
Repository.get_bundle(repositorypath, serialised_remote_graph)
This assumes the remote graph was previous obtained by doing some graph
difference logic to determine the needed revisions.
A method like fetch (def fetch(self, source, revision_id)) currently
forwards to an InterRepository.
so on InterRemoteAndLocalRepository.fetch:
def fetch(self, revision_id):
needed_revisions = RemoteGraph(revision_id)
needed_revisions = self.determine_subgraph(needed_revisions)
self.target.apply_bundle(self.source.get_bundle(needed_revisions))
Is what I have in mind.
> > Current prototype/demo code is in two parts:
> > remote graph: sftp://bazaar.launchpad.net/~bzr/bzr/remotegraph
> > 'netsim' plugin: http://bazaar.launchpad.net/~lifeless/+junk/bzr-netsim
>
> That sounds interesting - when posting things like this you might get
> better reviews/conversations if you explained more about what the
> components are. It looks like netsim measures how many roundtrips and
> bytes would be required to send the graph through this mechanism?
I take your point in general. In this particular case I mailed mainly so
that its not stuck on my laptop idling while I'm at UDS. Theres plenty
of docstrings I think, so people playing with it should pick it up
easily.
netsim is a playground for me to version control experiments without
them cluttering up bzr, and as I figure out the right shape I can write
real code TDD style, with a good object model etc to build up to what
the experiment showed would be nice.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070507/d3d39561/attachment-0001.pgp
More information about the bazaar
mailing list