~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

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
172
170
 
173
171
    def _remote_path(self, relpath):
174
172
        """Returns the Unicode version of the absolute path for relpath."""
175
 
        return urlutils.URL._combine_paths(self._parsed_url.path, relpath)
 
173
        return self._combine_paths(self._path, relpath)
176
174
 
177
175
    def _call(self, method, *args):
178
176
        resp = self._call2(method, *args)
485
483
 
486
484
    def _build_medium(self):
487
485
        client_medium = medium.SmartTCPClientMedium(
488
 
            self._parsed_url.host, self._parsed_url.port, self.base)
 
486
            self._host, self._port, self.base)
489
487
        return client_medium, None
490
488
 
491
489
 
498
496
 
499
497
    def _build_medium(self):
500
498
        client_medium = medium.SmartTCPClientMedium(
501
 
            self._parsed_url.host, self._parsed_url.port, self.base)
 
499
            self._host, self._port, self.base)
502
500
        client_medium._protocol_version = 2
503
501
        client_medium._remember_remote_is_before((1, 6))
504
502
        return client_medium, None
514
512
    def _build_medium(self):
515
513
        location_config = config.LocationConfig(self.base)
516
514
        bzr_remote_path = location_config.get_bzr_remote_path()
517
 
        user = self._parsed_url.user
 
515
        user = self._user
518
516
        if user is None:
519
517
            auth = config.AuthenticationConfig()
520
 
            user = auth.get_user('ssh', self._parsed_url.host,
521
 
                self._parsed_url.port)
522
 
        ssh_params = medium.SSHParams(self._parsed_url.host,
523
 
                self._parsed_url.port, user, self._parsed_url.password,
524
 
                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)
525
521
        client_medium = medium.SmartSSHClientMedium(self.base, ssh_params)
526
 
        return client_medium, (user, self._parsed_url.password)
 
522
        return client_medium, (user, self._password)
527
523
 
528
524
 
529
525
class RemoteHTTPTransport(RemoteTransport):
543
539
            # url only for an intial construction (when the url came from the
544
540
            # command-line).
545
541
            http_url = base[len('bzr+'):]
546
 
            self._http_transport = transport.get_transport_from_url(http_url)
 
542
            self._http_transport = transport.get_transport(http_url)
547
543
        else:
548
544
            self._http_transport = http_transport
549
545
        super(RemoteHTTPTransport, self).__init__(