[merge] Transport.*_{bytes,file}

Robert Collins robertc at robertcollins.net
Wed Sep 6 00:37:01 BST 2006


On Tue, 2006-09-05 at 17:56 -0500, John Arbash Meinel wrote:
> The attached patch changes the Transport api, such that append() and
> put() are deprecated, and meant to be replaced by
> append_bytes/append_file, put_bytes/put_file. This is mostly for api
> clarity. (It also helps that you can now grep for append_{file,bytes}
> rather than getting false positives on all of the list.append() calls).
> The patch also changes all of bzrlib to use these new functions.
> 
> I implement 'get_bytes()', as well as tests for it, though I chose not
> to change get => get_bytes just yet. It has always returned a file-like
> object, and it would be a lot of churn to change it to get_file. I can
> do that upon request, though.
> 
> It also implements Transport.non_atomic_put_{bytes,file}. Which has 2
> differences from just calling append_*.

Some thoughts:

rather than non_atomic_put_*, how about put_*_non_atomic - this will
make searches for ('\.put_') and the like more useful. Also, alpha
sorting of the methods will keep them together.

In test_transport_implementations, append looks untested now - could we
keep a smoke test (via applyDeprecated for instance) that it still works
with the old parameter types). (I may have missed the tests for it - I
did see ones for put and the multi functions).

You may find applyDeprecated cleaner to use for the transport
implementations than callDeprecated.

With answers to those (any answer you are happy with :)) - +1.

-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: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060906/8d2031b6/attachment.pgp 


More information about the bazaar mailing list