sftp branch

Robey Pointer robey at lag.net
Sun Jul 17 09:16:05 BST 2005


Ahh, the things I'll do to quell boredom on the weekend as an  
invalid, while my friends are out having fun. :)

Here's a draft SFTPBranch, using paramiko.  It seems to work okay --  
it's slow, but on par with HTTP in my very unscientific tests:

$ time ../bzr.bugfixed/bzr branch ../bzr.bugfixed
     real    2m31.663s; user    1m7.052s; sys     0m13.896s
$ time ../bzr.bugfixed/bzr branch http://ralph/~robey/bzr.bugfixed
     real    8m38.356s; user    2m4.452s; sys     0m46.267s
$ time ../bzr.bugfixed/bzr branch sftp://robey@ralph/home/robey/code/ 
bzr-test/bzr.bugfixed
     real    8m11.554s; user    2m52.869s; sys     0m31.807s

I think the reason Aaron was having trouble before was that some  
aspects of RemoteBranch rely on python auto-closing a file when it's  
GC'd.  I can't currently do this in paramiko because file objects are  
parts of cycles (and therefore can't have functioning __del__  
methods) but I think I may be able to fix that soon using weak  
references.

This requires paramiko 1.4, which isn't released yet, but is in arch  
(check www.lag.net/paramiko).  I wanted to use the new SSH-agent  
stuff and a couple of other new features.

Windows people can't avoid being asked for a password, because  
Windows has no standard "~/.ssh" location (for private key storage)  
and no unix-domain sockets for SSH-agent communication.  Sucks.  One  
solution might be to check "~/.bzr.conf" for private keys too.  I  
currently store new host keys in "~/.bzr.conf" for the same reason.

As you can see, almost all of the code is devoted to connecting,  
checking the server host key, and authenticating, so it's not very  
wedded to the current Branch/Store system (which I gathered is  
changing soon).

robey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sftpbranch.py
Type: text/x-python-script
Size: 10891 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050717/b1b2d978/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050717/b1b2d978/attachment.pgp 


More information about the bazaar mailing list