~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

Merge more bzr.dev, addressing some bugs. [still broken]

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
            self._serialise_optional_mode(mode))
218
218
        self._translate_error(resp)
219
219
 
220
 
    def open_file_stream(self, relpath):
221
 
        """See Transport.open_file_stream."""
222
 
        def append_data(bytes):
223
 
            self.append_bytes(relpath, bytes)
224
 
        self.put_bytes(relpath, "")
225
 
        transport._file_streams[self.abspath(relpath)] = append_data
226
 
        return append_data
 
220
    def open_write_stream(self, relpath, mode=None):
 
221
        """See Transport.open_write_stream."""
 
222
        self.put_bytes(relpath, "", mode)
 
223
        result = transport.AppendBasedFileStream(self, relpath)
 
224
        transport._file_streams[self.abspath(relpath)] = result
 
225
        return result
227
226
 
228
227
    def put_bytes(self, relpath, upload_contents, mode=None):
229
228
        # FIXME: upload_file is probably not safe for non-ascii characters -