~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

  • Committer: Vincent Ladeuil
  • Date: 2015-09-08 07:59:37 UTC
  • mto: This revision was merged to the branch mainline in revision 6604.
  • Revision ID: v.ladeuil+lp@free.fr-20150908075937-u63hgo67v3c2lapt
Skip the missed test in test_transport.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
imported from bzrlib.smart.
21
21
"""
22
22
 
 
23
from __future__ import absolute_import
 
24
 
23
25
__all__ = ['RemoteTransport', 'RemoteTCPTransport', 'RemoteSSHTransport']
24
26
 
25
27
from cStringIO import StringIO
34
36
    urlutils,
35
37
    )
36
38
from bzrlib.smart import client, medium
37
 
from bzrlib.symbol_versioning import (
38
 
    deprecated_method,
39
 
    )
40
39
 
41
40
 
42
41
class _SmartStat(object):
170
169
 
171
170
    def _remote_path(self, relpath):
172
171
        """Returns the Unicode version of the absolute path for relpath."""
173
 
        return self._combine_paths(self._path, relpath)
 
172
        return urlutils.URL._combine_paths(self._parsed_url.path, relpath)
174
173
 
175
174
    def _call(self, method, *args):
176
175
        resp = self._call2(method, *args)
483
482
 
484
483
    def _build_medium(self):
485
484
        client_medium = medium.SmartTCPClientMedium(
486
 
            self._host, self._port, self.base)
 
485
            self._parsed_url.host, self._parsed_url.port, self.base)
487
486
        return client_medium, None
488
487
 
489
488
 
496
495
 
497
496
    def _build_medium(self):
498
497
        client_medium = medium.SmartTCPClientMedium(
499
 
            self._host, self._port, self.base)
 
498
            self._parsed_url.host, self._parsed_url.port, self.base)
500
499
        client_medium._protocol_version = 2
501
500
        client_medium._remember_remote_is_before((1, 6))
502
501
        return client_medium, None
512
511
    def _build_medium(self):
513
512
        location_config = config.LocationConfig(self.base)
514
513
        bzr_remote_path = location_config.get_bzr_remote_path()
515
 
        user = self._user
 
514
        user = self._parsed_url.user
516
515
        if user is None:
517
516
            auth = config.AuthenticationConfig()
518
 
            user = auth.get_user('ssh', self._host, self._port)
519
 
        ssh_params = medium.SSHParams(self._host, self._port, user,
520
 
            self._password, bzr_remote_path)
 
517
            user = auth.get_user('ssh', self._parsed_url.host,
 
518
                self._parsed_url.port)
 
519
        ssh_params = medium.SSHParams(self._parsed_url.host,
 
520
                self._parsed_url.port, user, self._parsed_url.password,
 
521
                bzr_remote_path)
521
522
        client_medium = medium.SmartSSHClientMedium(self.base, ssh_params)
522
 
        return client_medium, (user, self._password)
 
523
        return client_medium, (user, self._parsed_url.password)
523
524
 
524
525
 
525
526
class RemoteHTTPTransport(RemoteTransport):
539
540
            # url only for an intial construction (when the url came from the
540
541
            # command-line).
541
542
            http_url = base[len('bzr+'):]
542
 
            self._http_transport = transport.get_transport(http_url)
 
543
            self._http_transport = transport.get_transport_from_url(http_url)
543
544
        else:
544
545
            self._http_transport = http_transport
545
546
        super(RemoteHTTPTransport, self).__init__(