~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Robert Collins
  • Date: 2007-11-22 00:29:58 UTC
  • mto: This revision was merged to the branch mainline in revision 3014.
  • Revision ID: robertc@robertcollins.net-20071122002958-szgbifl258kcstzp
Honour file modes for write streams.

Show diffs side-by-side

added added

removed removed

Lines of Context:
307
307
        """See Transport.open_write_stream."""
308
308
        # initialise the file
309
309
        self.put_bytes_non_atomic(relpath, "", mode=mode)
310
 
        handle = open(self._abspath(relpath), 'wb')
 
310
        abspath = self._abspath(relpath)
 
311
        handle = open(abspath, 'wb')
 
312
        if mode is not None:
 
313
            self._check_mode_and_size(abspath, handle.fileno(), mode)
311
314
        transport._file_streams[self.abspath(relpath)] = handle
312
315
        return transport.FileFileStream(self, relpath, handle)
313
316