/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

Implement RemoteBranch.lock_write/unlock as smart operations.

Because Branch.lock_write/unlock actually also lock/unlock the repository, I've
slightly changed lock_write's interface to accept and return 'tokens' rather
than 'token'.  i.e. a 2-tuple of (branch token, repo token), or None.

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
                raise errors.ReadOnlyError(self)
241
241
            self._lock.validate_token(token)
242
242
            self._lock_count += 1
 
243
            return token
243
244
        else:
244
245
            token_from_lock = self._lock.lock_write(token=token)
245
246
            #note('write locking %s', self)