~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-10-10 21:52:15 UTC
  • Revision ID: robertc@robertcollins.net-20051010215215-6ff59a09c2f7b6b7
lock during fetch, which is a separate code path to the special case of cloning

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
        self._transaction = new_transaction
344
344
 
345
345
    def lock_write(self):
 
346
        mutter("lock write: %s (%s)", self, self._lock_count)
346
347
        # TODO: Upgrade locking to support using a Transport,
347
348
        # and potentially a remote locking protocol
348
349
        if self._lock_mode:
359
360
 
360
361
 
361
362
    def lock_read(self):
 
363
        mutter("lock read: %s (%s)", self, self._lock_count)
362
364
        if self._lock_mode:
363
365
            assert self._lock_mode in ('r', 'w'), \
364
366
                   "invalid lock mode %r" % self._lock_mode
371
373
            self._set_transaction(transactions.ReadOnlyTransaction())
372
374
                        
373
375
    def unlock(self):
 
376
        mutter("unlock: %s (%s)", self, self._lock_count)
374
377
        if not self._lock_mode:
375
378
            raise LockError('branch %r is not locked' % (self))
376
379