~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/pathfilter.py

  • Committer: Martin Pool
  • Date: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
174
174
        return self._call('stat', relpath)
175
175
 
176
176
 
177
 
class TestingPathFilteringServer(PathFilteringServer):
178
 
 
179
 
    def __init__(self):
180
 
        """TestingChrootServer is not usable until start_server is called."""
181
 
 
182
 
    def start_server(self, backing_server=None):
183
 
        """Setup the Chroot on backing_server."""
184
 
        if backing_server is not None:
185
 
            self.backing_transport = get_transport(backing_server.get_url())
186
 
        else:
187
 
            self.backing_transport = get_transport('.')
188
 
        self.backing_transport.clone('added-by-filter').ensure_base()
189
 
        self.filter_func = lambda x: 'added-by-filter/' + x
190
 
        PathFilteringServer.start_server(self)
191
 
 
192
 
 
193
177
def get_test_permutations():
194
178
    """Return the permutations to be used in testing."""
195
 
    return [(PathFilteringTransport, TestingPathFilteringServer)]
 
179
    from bzrlib.tests import test_server
 
180
    return [(PathFilteringTransport, test_server.TestingPathFilteringServer)]