~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/readonly.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Implementation of Transport that adapts another transport to be readonly."""
18
18
 
19
19
from bzrlib.errors import TransportNotPossible, NoSmartMedium
20
 
from bzrlib.transport.decorator import TransportDecorator, DecoratorServer
21
 
 
22
 
 
23
 
class ReadonlyTransportDecorator(TransportDecorator):
 
20
from bzrlib.transport import decorator
 
21
 
 
22
 
 
23
class ReadonlyTransportDecorator(decorator.TransportDecorator):
24
24
    """A decorator that can convert any transport to be readonly.
25
25
 
26
26
    This is requested via the 'readonly+' prefix to get_transport().
78
78
        raise NoSmartMedium(self)
79
79
 
80
80
 
81
 
 
82
 
class ReadonlyServer(DecoratorServer):
83
 
    """Server for the ReadonlyTransportDecorator for testing with."""
84
 
 
85
 
    def get_decorator_class(self):
86
 
        return ReadonlyTransportDecorator
87
 
 
88
 
 
89
81
def get_test_permutations():
90
82
    """Return the permutations to be used in testing."""
91
 
    return [(ReadonlyTransportDecorator, ReadonlyServer),
92
 
            ]
 
83
    from bzrlib.tests import test_server
 
84
    return [(ReadonlyTransportDecorator, test_server.ReadonlyServer),]