A GIO transport

Martin Pool mbp at canonical.com
Mon May 3 01:16:10 BST 2010


On 2 May 2010 00:06, Mattias Eriksson <snaggen at acc.umu.se> wrote:
> Hi,
>
> Here is a first attempt att creating a gio transport for bzr. The reason
> I wrote this is that I'd lite to store a bzr repo on my Apple
> TimeCapsule that only provides afp and smb file access. So by using gio
> as a transport it should be possible to use all protocols supported by
> the gnome gio library (currently ssh/sftp, ftp, dav, smb, obex I think),
> but I have only tested it with smb and ssh. Note that this is not a
> merge request since I think there are still some work to do.

That's a great feature, thanks for putting it up.

It's so small I would be ok with just merging it in when it's ready.
We would want to make sure that it does not load gio unless it's
needed, and that it copes if gio is not available including in tests,
but we have plenty of infrastructure for doing this.

You have in the header "Copyright Mattias Eriksson, Canonical" which
is a bit ambiguous; what I would suggest you do is put your name in as
author and do the Canonical contributor agreement to assign copyright.
 This is optional if you want it to just be a plugin.

Rather than listing all the protocols supported by gio in your
transport registration it would eventually be nice to say that
anything started with gio+ is supported and then we see if gio can
actually handle the next part of the scheme.

> Some things I need help with:
>     1. Authentication, currently this is handled with no interaction
>        with the built in authentication mechanisms, since I do not know
>        how that handles asking for domain for protocols that requires
>        this (smb). I'm also thinking that i might be good to hook in to
>        gnome-keyring if available (since the gio transport already
>        depends on gio and gtk), does this sound like a good idea or
>        just crazy?

I think looking at gnome-keyring with a soft dependency on bzr-gtk
would be fine, but perhaps it's possible to do this purely through
bzrlib's authentication interface.

Perhaps the simplest way to handle the domain is to just take the
username as DOMAIN\USER?

>     2. This module should only be loaded if gio is available I think,
>        how can this be done (or only if the url starts with gio+)? or
>        is this how things work already?

I think your current code will be fine if you don't use a gio+ url,
and then will give an error that gio is not present.  This is probably
fine.

>     3. Tests, I can't seem to figure out how to create a working
>        testsuite. I tried to base it on the sftp tests but the
>        authentication doesn't work for some reason.



More information about the bazaar mailing list