~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

  • Committer: Martin Pool
  • Date: 2007-10-12 08:00:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2913.
  • Revision ID: mbp@sourcefrog.net-20071012080007-vf80woayyom8s8e1
Rename update_to_one_parent_via_delta to more wieldy update_basis_by_delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
 
188
188
            :return: A token which can be used to switch back to a read lock.
189
189
            """
190
 
            if self.filename in _fcntl_WriteLock._open_locks:
191
 
                raise AssertionError('file already locked: %r'
192
 
                    % (self.filename,))
 
190
            assert self.filename not in _fcntl_WriteLock._open_locks
193
191
            try:
194
192
                wlock = _fcntl_TemporaryWriteLock(self)
195
193
            except errors.LockError:
215
213
                # write lock.
216
214
                raise errors.LockContention(self.filename)
217
215
 
218
 
            if self.filename in _fcntl_WriteLock._open_locks:
219
 
                raise AssertionError('file already locked: %r'
220
 
                    % (self.filename,))
 
216
            assert self.filename not in _fcntl_WriteLock._open_locks
221
217
 
222
218
            # See if we can open the file for writing. Another process might
223
219
            # have a read lock. We don't use self._open() because we don't want