RsyncBranch?

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 27 18:59:27 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all

Martin mentioned the possibility of implementing a RemoteBranch that
used rsync, and I think that's a neat idea.  It would be able to do
multicopy without breaking a sweat.  As for get_url, it gets a bit
hairy, because AFAICT, rsync doesn't have a way to write a single file
to stdout.  And so you need temp files.  And so you need to arrange for
the temp file to be deleted when its work is done.

So it comes down to a question of what get_url is supposed to be.

One approach would be for get_url to handle all supported protocols.
That would be a nice, uniform interface, and it would make it easy to
support new protocols-- you'd just need to add support in get_url.

Another approach would be for there to be multiple get_url functions.
To create an http branch, you'd instantiate RemoteBranch with a get_url
parameter:
RemoteBranch(url, get_url=http_get_url)

This would allow you to make an RsyncGetUrl handler that took a
parameter for a temporary directory.  To create an rsync branch:

RemoteBranch(url, get_url=RsyncGetUrl(temp_dir))

For that case, it's probably better to have a Transport object so we can
stick multicopy support in the same place as get_url support.

Maybe we should just implement an object that can release resources on exit?

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCwD5/0F+nu1YWqI0RAqIcAJ9CeG90nEb4cO4Tlhil/7f9MBQCBQCdGXT+
BXBvbM6WLKQ3omk3w3KTTQU=
=TEFh
-----END PGP SIGNATURE-----




More information about the bazaar mailing list