~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-16 02:42:33 UTC
  • mfrom: (2906.1.1 reconcile-speed)
  • Revision ID: pqm@pqm.ubuntu.com-20071016024233-6fmmyqoh0cfnsni8
(Andrew Bennetts) Speed up reconcile by not repeatedly fetching the full inventories, by cache heads and parents queries, and by fetching revision trees in batches.

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