/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/remote.py

  • Committer: Robert Collins
  • Date: 2010-05-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1000
1000
    def lock_read(self):
1001
1001
        """Lock the repository for read operations.
1002
1002
 
1003
 
        :return: A bzrlib.lock.LogicalLockResult.
 
1003
        :return: An object with an unlock method which will release the lock
 
1004
            obtained.
1004
1005
        """
1005
1006
        # wrong eventually - want a local lock cache context
1006
1007
        if not self._lock_mode:
1014
1015
                repo.lock_read()
1015
1016
        else:
1016
1017
            self._lock_count += 1
1017
 
        return lock.LogicalLockResult(self.unlock)
 
1018
        return self
1018
1019
 
1019
1020
    def _remote_lock_write(self, token):
1020
1021
        path = self.bzrdir._path_for_remote_call(self._client)
2395
2396
    def lock_read(self):
2396
2397
        """Lock the branch for read operations.
2397
2398
 
2398
 
        :return: A bzrlib.lock.LogicalLockResult.
 
2399
        :return: An object with an unlock method which will release the lock
 
2400
            obtained.
2399
2401
        """
2400
2402
        self.repository.lock_read()
2401
2403
        if not self._lock_mode:
2406
2408
                self._real_branch.lock_read()
2407
2409
        else:
2408
2410
            self._lock_count += 1
2409
 
        return lock.LogicalLockResult(self.unlock)
 
2411
        return self
2410
2412
 
2411
2413
    def _remote_lock_write(self, token):
2412
2414
        if token is None: