[merge] Transport.{append,get,put}_bytes

Robert Collins robertc at robertcollins.net
Mon Aug 28 02:14:41 BST 2006


On Sun, 2006-08-27 at 19:55 -0500, John Arbash Meinel wrote:


> ^- Actually, 'control_files' is a LockableFiles, not a Transport. So it
> would have to be upgraded as well. (we have put() and put_utf8(), urls
> are technically ascii, so they *could* work as put_utf8, but it isn't
> quite right)

Meh, I forgot. Yes, ControlFiles has 'put for files and put_utf8 for
strings'.

We could make that consistent with transport easily enough - add
put_bytes.

> > 
> > And there would be no strange-errors thrown from put after we finish the
> > conversion - it would just be another deprecated function, which would
> > call either put_file or put_bytes.
> > 
> > -Rob
> >  
> 
> Do you want to change append as well then? I don't know that anyone is
> passing a string, but since Transport._pump() supports both, I'm pretty
> sure it would have worked before we switched to _pump_to_fd.

Yes, I was using put_file as a specific example. My point is that we
should be making the interface more clear [which is what your patch
seeks to do] - and put() does not imply file or stream or bytes or
unicode etc etc, so I think that rather than mutating the current apis,
we should just add two more precise apis, for each thing that is using
heuristics at the moment, and make the old implementation be a
deprecated forwarder.

-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/20060828/36646aec/attachment.pgp 


More information about the bazaar mailing list