~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.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) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-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
39
39
from bzrlib.transport import LateReadError
40
40
""")
41
41
 
42
 
from bzrlib.transport import Transport, Server
 
42
from bzrlib import transport
43
43
 
44
44
 
45
45
_append_flags = os.O_CREAT | os.O_APPEND | os.O_WRONLY | osutils.O_BINARY
46
46
_put_non_atomic_flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | osutils.O_BINARY
47
47
 
48
48
 
49
 
class LocalTransport(Transport):
 
49
class LocalTransport(transport.Transport):
50
50
    """This is the transport agent for local filesystem access."""
51
51
 
52
52
    def __init__(self, base):
554
554
            return EmulatedWin32LocalTransport(abspath)
555
555
 
556
556
 
557
 
class LocalURLServer(Server):
558
 
    """A pretend server for local transports, using file:// urls.
559
 
 
560
 
    Of course no actual server is required to access the local filesystem, so
561
 
    this just exists to tell the test code how to get to it.
562
 
    """
563
 
 
564
 
    def start_server(self):
565
 
        pass
566
 
 
567
 
    def get_url(self):
568
 
        """See Transport.Server.get_url."""
569
 
        return urlutils.local_path_to_url('')
570
 
 
571
 
 
572
557
def get_test_permutations():
573
558
    """Return the permutations to be used in testing."""
574
 
    return [
575
 
            (LocalTransport, LocalURLServer),
576
 
            ]
 
559
    from bzrlib.tests import test_server
 
560
    return [(LocalTransport, test_server.LocalURLServer),]