[MERGE] Transport support for pack repositories
mbp at canonical.com
Wed Aug 8 03:50:11 BST 2007
Martin Pool has voted resubmit.
Status is now: Resubmit
Adding a way to more clearly do multiple reads or writes to a file
I think these should act more like regular python file objects unless
there is a good reason to do otherwise. That would mean returning an
object on which you can call write, rather than just the write-like
method itself. That doesn't oblige us to support all the other methods
as well as write but it leaves room for change in the future.
I would then give that object a close method, rather than calling
close_file_stream() on the transport. It seems like that would also
dispense with the need for a global _file_streams.
Also one might conceivably want to have read-mode file streams, or
read/write, and it seems strange that open_file_stream would give you
one you can only write to. So again I'd suggest being more like python
and having it take a parameter that can be 'r', 'w' or whatever. It's
fine with me if the only value that's accepted for now is 'w'.
Then this could be unified with get, which returns a readable file-like
object. That's a poor name for it, but get()'s callers can be changed
to call this.
For details, see:
More information about the bazaar