/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Martin Pool
  • Date: 2007-08-28 02:02:09 UTC
  • mfrom: (2749 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2758.
  • Revision ID: mbp@sourcefrog.net-20070828020209-gbhb0onl14e1fjty
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    osutils,
34
34
    urlutils,
35
35
    symbol_versioning,
 
36
    transport,
36
37
    )
37
38
from bzrlib.trace import mutter
38
39
from bzrlib.transport import LateReadError
135
136
 
136
137
        :param relpath: The relative path to the file
137
138
        """
 
139
        canonical_url = self.abspath(relpath)
 
140
        if canonical_url in transport._file_streams:
 
141
            transport._file_streams[canonical_url].flush()
138
142
        try:
139
143
            path = self._abspath(relpath)
140
144
            return open(path, 'rb')
298
302
        """Create a directory at the given path."""
299
303
        self._mkdir(self._abspath(relpath), mode=mode)
300
304
 
 
305
    def open_write_stream(self, relpath, mode=None):
 
306
        """See Transport.open_write_stream."""
 
307
        # initialise the file
 
308
        self.put_bytes_non_atomic(relpath, "", mode=mode)
 
309
        handle = open(self._abspath(relpath), 'wb')
 
310
        transport._file_streams[self.abspath(relpath)] = handle
 
311
        return transport.FileFileStream(self, relpath, handle)
 
312
 
301
313
    def _get_append_file(self, relpath, mode=None):
302
314
        """Call os.open() for the given relpath"""
303
315
        file_abspath = self._abspath(relpath)