~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.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:
69
69
    CommitBuilder,
70
70
    MetaDirRepositoryFormat,
71
71
    RepositoryFormat,
 
72
    RepositoryWriteLockResult,
72
73
    RootCommitBuilder,
73
74
    StreamSource,
74
75
    )
2354
2355
                # Writes don't affect fallback repos
2355
2356
                repo.lock_read()
2356
2357
            self._refresh_data()
 
2358
        return RepositoryWriteLockResult(self.unlock, None)
2357
2359
 
2358
2360
    def lock_read(self):
2359
2361
        locked = self.is_locked()
2368
2370
            for repo in self._fallback_repositories:
2369
2371
                repo.lock_read()
2370
2372
            self._refresh_data()
 
2373
        return self
2371
2374
 
2372
2375
    def leave_lock_in_place(self):
2373
2376
        # not supported - raise an error