~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:29:17 UTC
  • mfrom: (2961 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152917-nrsumxpk3dikso2c
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
transport_list_registry = TransportListRegistry()
147
147
 
148
148
 
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)
 
152
    if register_netloc:
 
153
        assert prefix.endswith('://')
 
154
        register_urlparse_netloc_protocol(prefix[:-3])
151
155
 
152
156
 
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."
1721
 
            default_port=80)
 
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."
1726
 
            default_port=443)
 
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."
1731
 
            default_port=80)
 
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."
1736
 
            default_port=443)
 
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')
 
1795
 
 
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)
 
1800
del scheme
 
1801
 
1790
1802
register_transport_proto('bzr://',
1791
1803
            help="Fast access using the Bazaar smart server.",
1792
 
            default_port=4155)
 
1804
            default_port=4155, register_netloc=True)
1793
1805
 
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."
1799
 
            default_port=80)
 
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."
1805
 
             )
 
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')