~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

Completely rework chrooted transports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
 
114
114
    def get_backing_transport(self, backing_transport_server):
115
115
        """Get a backing transport from a server we are decorating."""
116
 
        return transport.get_transport('chroot+' + backing_transport_server.get_url())
 
116
        return transport.get_transport(backing_transport_server.get_url())
117
117
 
118
118
    def setUp(self, backing_transport_server=None):
119
119
        """Set up server for testing"""
 
120
        from bzrlib.transport.chroot import ChrootServer
120
121
        if backing_transport_server is None:
121
122
            from bzrlib.transport.local import LocalURLServer
122
123
            backing_transport_server = LocalURLServer()
123
 
        self.backing_transport = self.get_backing_transport(backing_transport_server)
 
124
        self.chroot_server = ChrootServer(
 
125
            self.get_backing_transport(backing_transport_server))
 
126
        self.chroot_server.setUp()
 
127
        self.backing_transport = transport.get_transport(
 
128
            self.chroot_server.get_url())
124
129
        self.start_background_thread()
125
130
 
126
131
    def tearDown(self):
127
132
        self.stop_background_thread()
 
133
        self.chroot_server.tearDown()
128
134
 
129
135
    def get_url(self):
130
136
        """Return the url of the server"""
141
147
 
142
148
    def get_backing_transport(self, backing_transport_server):
143
149
        """Get a backing transport from a server we are decorating."""
144
 
        url = 'chroot+readonly+' + backing_transport_server.get_url()
 
150
        url = 'readonly+' + backing_transport_server.get_url()
145
151
        return transport.get_transport(url)
146
152