~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    )
37
37
from bzrlib.trace import mutter
38
38
from bzrlib.transport import (
 
39
    AppendBasedFileStream,
39
40
    _file_streams,
40
41
    LateReadError,
41
42
    register_transport,
170
171
            raise FileExists(relpath)
171
172
        self._dirs[_abspath]=mode
172
173
 
173
 
    def open_file_stream(self, relpath):
174
 
        """See Transport.open_file_stream."""
175
 
        def append_data(bytes):
176
 
            self.append_bytes(relpath, bytes)
177
 
        self.put_bytes(relpath, "")
178
 
        _file_streams[self.abspath(relpath)] = append_data
179
 
        return append_data
 
174
    def open_write_stream(self, relpath, mode=None):
 
175
        """See Transport.open_write_stream."""
 
176
        self.put_bytes(relpath, "", mode)
 
177
        result = AppendBasedFileStream(self, relpath)
 
178
        _file_streams[self.abspath(relpath)] = result
 
179
        return result
180
180
 
181
181
    def listable(self):
182
182
        """See Transport.listable."""