/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/transactions.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:
36
36
the object is an expensive one for obtaining.
37
37
"""
38
38
 
39
 
from __future__ import absolute_import
40
 
 
41
39
import sys
42
40
 
43
 
from . import errors as errors
44
 
from .identitymap import IdentityMap, NullIdentityMap
45
 
from .trace import mutter
 
41
import bzrlib.errors as errors
 
42
from bzrlib.identitymap import IdentityMap, NullIdentityMap
 
43
from bzrlib.trace import mutter
46
44
 
47
45
 
48
46
class ReadOnlyTransaction(object):
101
99
            # _clean_objects
102
100
            # _clean_queue
103
101
            # 1 missing ?
104
 
            if (sys.getrefcount(self._clean_queue[offset]) <= 7
105
 
                    and not self._clean_queue[offset] in self._precious_objects):
 
102
            if (sys.getrefcount(self._clean_queue[offset]) <= 7 and
 
103
                not self._clean_queue[offset] in self._precious_objects):
106
104
                removed = self._clean_queue[offset]
107
105
                self._clean_objects.remove(removed)
108
106
                del self._clean_queue[offset]