/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/sftp.py

  • Committer: John Arbash Meinel
  • Date: 2006-05-02 20:46:11 UTC
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: john@arbash-meinel.com-20060502204611-02caa5c20fb84ef8
Moved url functions into bzrlib.urlutils

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    register_urlparse_netloc_protocol,
46
46
    Server,
47
47
    Transport,
48
 
    urlescape,
49
 
    urlunescape,
50
48
    )
51
49
import bzrlib.ui
 
50
import bzrlib.urlutils as urlutils
52
51
 
53
52
try:
54
53
    import paramiko
339
338
        """
340
339
        # FIXME: share the common code across transports
341
340
        assert isinstance(relpath, basestring)
342
 
        relpath = urlunescape(relpath).split('/')
 
341
        relpath = urlutils.unescape(relpath).split('/')
343
342
        basepath = self._path.split('/')
344
343
        if len(basepath) > 0 and basepath[-1] == '':
345
344
            basepath = basepath[:-1]
673
672
                raise TransportError('%s: invalid port number' % port)
674
673
        host = urllib.unquote(host)
675
674
 
676
 
        path = urlunescape(path)
 
675
        path = urlutils.unescape(path)
677
676
 
678
677
        # the initial slash should be removed from the path, and treated
679
678
        # as a homedir relative path (the path begins with a double slash
986
985
 
987
986
    def get_url(self):
988
987
        """See bzrlib.transport.Server.get_url."""
989
 
        return self._get_sftp_url(urlescape(self._homedir[1:]))
 
988
        return self._get_sftp_url(urlutils.escape(self._homedir[1:]))
990
989
 
991
990
 
992
991
class SFTPServerWithoutSSH(SFTPServer):
1018
1017
 
1019
1018
    def get_url(self):
1020
1019
        """See bzrlib.transport.Server.get_url."""
1021
 
        return self._get_sftp_url(urlescape(self._homedir[1:]))
 
1020
        return self._get_sftp_url(urlutils.escape(self._homedir[1:]))
1022
1021
 
1023
1022
 
1024
1023
class SFTPHomeDirServer(SFTPServerWithoutSSH):