~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
        # TODO: Upgrade locking to support using a Transport,
197
197
        # and potentially a remote locking protocol
198
198
        if self._lock_mode:
199
 
            if self._lock_mode != 'w':
 
199
            if self._lock_mode != 'w' or not self.get_transaction().writeable():
200
200
                raise ReadOnlyError(self)
201
201
            self._lock_count += 1
202
202
        else:
203
203
            self._lock.lock_write()
204
204
            self._lock_mode = 'w'
205
205
            self._lock_count = 1
206
 
            self._set_transaction(transactions.PassThroughTransaction())
 
206
            self._set_transaction(transactions.WriteTransaction())
207
207
 
208
208
    def lock_read(self):
209
209
        # mutter("lock read: %s (%s)", self, self._lock_count)