/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

  • Committer: Martin Pool
  • Date: 2007-10-08 07:29:57 UTC
  • mfrom: (2894 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2895.
  • Revision ID: mbp@sourcefrog.net-20071008072957-uhm1gl1mqcsdc377
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import urlparse
28
28
 
29
29
from bzrlib import (
 
30
    config,
30
31
    debug,
31
32
    errors,
32
33
    trace,
36
37
from bzrlib.smart import client, medium, protocol
37
38
 
38
39
# must do this otherwise urllib can't parse the urls properly :(
39
 
for scheme in ['ssh', 'bzr', 'bzr+loopback', 'bzr+ssh', 'bzr+http']:
 
40
for scheme in ['ssh', 'bzr', 'bzr+loopback', 'bzr+ssh', 'bzr+http', 'bzr+https']:
40
41
    transport.register_urlparse_netloc_protocol(scheme)
41
42
del scheme
42
43
 
291
292
        # the external path for RemoteTransports is the base
292
293
        return self.base
293
294
 
294
 
    def readv(self, relpath, offsets):
 
295
    def _readv(self, relpath, offsets):
295
296
        if not offsets:
296
297
            return
297
298
 
451
452
 
452
453
    def _build_medium(self):
453
454
        assert self.base.startswith('bzr://')
454
 
        if self._port is None:
455
 
            self._port = BZR_DEFAULT_PORT
456
455
        return medium.SmartTCPClientMedium(self._host, self._port), None
457
456
 
458
457
 
468
467
        # ssh will prompt the user for a password if needed and if none is
469
468
        # provided but it will not give it back, so no credentials can be
470
469
        # stored.
 
470
        location_config = config.LocationConfig(self.base)
 
471
        bzr_remote_path = location_config.get_bzr_remote_path()
471
472
        return medium.SmartSSHClientMedium(self._host, self._port,
472
 
                                           self._user, self._password), None
 
473
            self._user, self._password, bzr_remote_path=bzr_remote_path), None
473
474
 
474
475
 
475
476
class RemoteHTTPTransport(RemoteTransport):
484
485
    """
485
486
 
486
487
    def __init__(self, base, _from_transport=None, http_transport=None):
487
 
        assert base.startswith('bzr+http://')
 
488
        assert ( base.startswith('bzr+http://') or base.startswith('bzr+https://') )
488
489
 
489
490
        if http_transport is None:
490
491
            # FIXME: the password may be lost here because it appears in the