146
146
transport_list_registry = TransportListRegistry()
149
def register_transport_proto(prefix, help=None, info=None, default_port=None):
149
def register_transport_proto(prefix, help=None, info=None, default_port=None,
150
register_netloc=False):
150
151
transport_list_registry.register_transport(prefix, help, default_port)
153
assert prefix.endswith('://')
154
register_urlparse_netloc_protocol(prefix[:-3])
153
157
def register_lazy_transport(prefix, module, classname):
1713
1717
# Note that sftp:// has no default_port, because the user's ~/.ssh/config
1714
1718
# can set it to arbitrary values based on hostname.
1715
1719
register_transport_proto('sftp://',
1716
help="Access using SFTP (most SSH servers provide SFTP).")
1720
help="Access using SFTP (most SSH servers provide SFTP).",
1721
register_netloc=True)
1717
1722
register_lazy_transport('sftp://', 'bzrlib.transport.sftp', 'SFTPTransport')
1718
1723
# Decorated http transport
1719
1724
register_transport_proto('http+urllib://',
1720
1725
# help="Read-only access of branches exported on the web."
1726
default_port=80, register_netloc=True)
1722
1727
register_lazy_transport('http+urllib://', 'bzrlib.transport.http._urllib',
1723
1728
'HttpTransport_urllib')
1724
1729
register_transport_proto('https+urllib://',
1725
1730
# help="Read-only access of branches exported on the web using SSL."
1731
default_port=443, register_netloc=True)
1727
1732
register_lazy_transport('https+urllib://', 'bzrlib.transport.http._urllib',
1728
1733
'HttpTransport_urllib')
1729
1734
register_transport_proto('http+pycurl://',
1730
1735
# help="Read-only access of branches exported on the web."
1736
default_port=80, register_netloc=True)
1732
1737
register_lazy_transport('http+pycurl://', 'bzrlib.transport.http._pycurl',
1733
1738
'PyCurlTransport')
1734
1739
register_transport_proto('https+pycurl://',
1735
1740
# help="Read-only access of branches exported on the web using SSL."
1741
default_port=443, register_netloc=True)
1737
1742
register_lazy_transport('https+pycurl://', 'bzrlib.transport.http._pycurl',
1738
1743
'PyCurlTransport')
1739
1744
# Default http transports (last declared wins (if it can be imported))
1787
1792
register_lazy_transport('vfat+',
1788
1793
'bzrlib.transport.fakevfat',
1789
1794
'FakeVFATTransportDecorator')
1796
# These two schemes were registered, but don't seem to have an actual transport
1797
# protocol registered
1798
for scheme in ['ssh', 'bzr+loopback']:
1799
register_urlparse_netloc_protocol(scheme)
1790
1802
register_transport_proto('bzr://',
1791
1803
help="Fast access using the Bazaar smart server.",
1804
default_port=4155, register_netloc=True)
1794
1806
register_lazy_transport('bzr://',
1795
1807
'bzrlib.transport.remote',
1796
1808
'RemoteTCPTransport')
1797
1809
register_transport_proto('bzr+http://',
1798
1810
# help="Fast access using the Bazaar smart server over HTTP."
1811
default_port=80, register_netloc=True)
1800
1812
register_lazy_transport('bzr+http://',
1801
1813
'bzrlib.transport.remote',
1802
1814
'RemoteHTTPTransport')
1803
1815
register_transport_proto('bzr+https://',
1804
1816
# help="Fast access using the Bazaar smart server over HTTPS."
1817
register_netloc=True)
1806
1818
register_lazy_transport('bzr+https://',
1807
1819
'bzrlib.transport.remote',
1808
1820
'RemoteHTTPTransport')
1809
1821
# Note that bzr+ssh:// has no default_port, because the user's ~/.ssh/config
1810
1822
# can set it to arbitrary values based on hostname.
1811
1823
register_transport_proto('bzr+ssh://',
1812
help="Fast access using the Bazaar smart server over SSH.")
1824
help="Fast access using the Bazaar smart server over SSH.",
1825
register_netloc=True)
1813
1826
register_lazy_transport('bzr+ssh://',
1814
1827
'bzrlib.transport.remote',
1815
1828
'RemoteSSHTransport')