~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-30 18:28:17 UTC
  • mfrom: (5967.10.2 test-cat)
  • Revision ID: pqm@pqm.ubuntu.com-20110630182817-83a5q9r9rxfkdn8r
(mbp) don't use subprocesses for testing cat (Martin Pool)

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