~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/chroot.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 16:42:20 UTC
  • mto: This revision was merged to the branch mainline in revision 6512.
  • Revision ID: v.ladeuil+lp@free.fr-20120313164220-atkou2zprhlspmwg
Mention that a given config option cannot be safely handled via both APIs at the same time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2009 Canonical Ltd
 
1
# Copyright (C) 2006-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
18
18
root.
19
19
"""
20
20
 
 
21
from __future__ import absolute_import
 
22
 
21
23
from bzrlib.transport import (
22
 
    get_transport,
23
24
    pathfilter,
24
25
    register_transport,
25
 
    Server,
26
 
    Transport,
27
 
    unregister_transport,
28
26
    )
29
27
 
30
28
 
65
63
        return self._relpath_from_server_root(relpath)
66
64
 
67
65
 
68
 
class TestingChrootServer(ChrootServer):
69
 
 
70
 
    def __init__(self):
71
 
        """TestingChrootServer is not usable until start_server is called."""
72
 
        ChrootServer.__init__(self, None)
73
 
 
74
 
    def start_server(self, backing_server=None):
75
 
        """Setup the Chroot on backing_server."""
76
 
        if backing_server is not None:
77
 
            self.backing_transport = get_transport(backing_server.get_url())
78
 
        else:
79
 
            self.backing_transport = get_transport('.')
80
 
        ChrootServer.start_server(self)
81
 
 
82
 
 
83
66
def get_test_permutations():
84
67
    """Return the permutations to be used in testing."""
85
 
    return [(ChrootTransport, TestingChrootServer)]
 
68
    from bzrlib.tests import test_server
 
69
    return [(ChrootTransport, test_server.TestingChrootServer)]