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

  • Committer: Jelmer Vernooij
  • Date: 2011-12-19 10:58:39 UTC
  • mfrom: (6383 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6386.
  • Revision ID: jelmer@canonical.com-20111219105839-uji05ck4rkm1mj4j
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
17
18
 
18
19
"""Inter-object utility class."""
19
20
 
20
21
 
 
22
from bzrlib.errors import NoCompatibleInter
 
23
 
 
24
 
21
25
class InterObject(object):
22
26
    """This class represents operations taking place between two objects.
23
27
 
75
79
                       the InterObject instance.
76
80
        :param target: the object to be the 'target' member of
77
81
                       the InterObject instance.
 
82
 
78
83
        If an optimised worker exists it will be used otherwise
79
84
        a default Inter worker instance will be created.
80
85
        """
81
86
        for provider in reversed(klass._optimisers):
82
87
            if provider.is_compatible(source, target):
83
88
                return provider(source, target)
84
 
        return klass(source, target)
 
89
        raise NoCompatibleInter(source, target)
85
90
 
86
91
    def lock_read(self):
87
92
        """Take out a logical read lock.