Rev 3020: Honour file modes for write streams. in http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

Robert Collins robertc at robertcollins.net
Thu Nov 22 00:30:12 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

------------------------------------------------------------
revno: 3020
revision-id:robertc at robertcollins.net-20071122002958-szgbifl258kcstzp
parent: robertc at robertcollins.net-20071122000512-27cvsv9vs6k0s4hn
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pack.read-locks
timestamp: Thu 2007-11-22 11:29:58 +1100
message:
  Honour file modes for write streams.
modified:
  bzrlib/transport/local.py      local_transport.py-20050711165921-9b1f142bfe480c24
=== modified file 'bzrlib/transport/local.py'
--- a/bzrlib/transport/local.py	2007-10-04 22:00:07 +0000
+++ b/bzrlib/transport/local.py	2007-11-22 00:29:58 +0000
@@ -307,7 +307,10 @@
         """See Transport.open_write_stream."""
         # initialise the file
         self.put_bytes_non_atomic(relpath, "", mode=mode)
-        handle = open(self._abspath(relpath), 'wb')
+        abspath = self._abspath(relpath)
+        handle = open(abspath, 'wb')
+        if mode is not None:
+            self._check_mode_and_size(abspath, handle.fileno(), mode)
         transport._file_streams[self.abspath(relpath)] = handle
         return transport.FileFileStream(self, relpath, handle)
 



More information about the bazaar-commits mailing list