/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: John Arbash Meinel
  • Date: 2006-09-15 00:44:57 UTC
  • mfrom: (2009 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2050.
  • Revision ID: john@arbash-meinel.com-20060915004457-902cec0526a39337
[merge] bzr.dev 2009

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    the needs_read_lock and needs_write_lock decorators.)
37
37
    """
38
38
 
39
 
    # _optimisers = set()
40
 
    # Each concrete InterObject type should have its own optimisers set.
 
39
    # _optimisers = list()
 
40
    # Each concrete InterObject type should have its own optimisers list.
41
41
 
42
42
    def __init__(self, source, target):
43
43
        """Construct a default InterObject instance. Please use 'get'.
74
74
        If an optimised worker exists it will be used otherwise
75
75
        a default Inter worker instance will be created.
76
76
        """
77
 
        for provider in klass._optimisers:
 
77
        for provider in reversed(klass._optimisers):
78
78
            if provider.is_compatible(source, target):
79
79
                return provider(source, target)
80
80
        return klass(source, target)
98
98
    @classmethod
99
99
    def register_optimiser(klass, optimiser):
100
100
        """Register an InterObject optimiser."""
101
 
        klass._optimisers.add(optimiser)
 
101
        klass._optimisers.append(optimiser)
102
102
 
103
103
    def unlock(self):
104
104
        """Release the locks on source and target."""