/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 breezy/git/remote.py

  • Committer: Jelmer Vernooij
  • Date: 2019-12-22 23:16:21 UTC
  • mfrom: (7422 work)
  • mto: This revision was merged to the branch mainline in revision 7426.
  • Revision ID: jelmer@jelmer.uk-20191222231621-3p14u9zaypv3q8zl
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
 
124
124
try:
125
125
    import urllib.parse as urlparse
126
 
    from urllib.parse import splituser, splitnport
 
126
    from urllib.parse import splituser
127
127
except ImportError:
128
128
    import urlparse
129
 
    from urllib import splituser, splitnport
 
129
    from urllib import splituser
130
130
 
131
131
# urlparse only supports a limited number of schemes by default
132
132
register_urlparse_netloc_protocol('git')
165
165
    :param url: Git URL
166
166
    :return: Tuple with host, port, username, path.
167
167
    """
168
 
    (scheme, netloc, loc, _, _) = urlparse.urlsplit(url)
169
 
    path = urlparse.unquote(loc)
 
168
    parsed_url = urlparse.urlparse(url)
 
169
    path = urlparse.unquote(parsed_url.path)
170
170
    if path.startswith("/~"):
171
171
        path = path[1:]
172
 
    (username, hostport) = splituser(netloc)
173
 
    (host, port) = splitnport(hostport, None)
174
 
    return (host, port, username, path)
 
172
    return ((parsed_url.hostname or '', parsed_url.port, parsed_url.username, path))
175
173
 
176
174
 
177
175
class RemoteGitError(BzrError):
843
841
    def get_file_text(self, path):
844
842
        raise GitSmartRemoteNotSupported(self.get_file_text, self)
845
843
 
 
844
    def list_files(self, include_root=False, from_dir=None, recursive=True):
 
845
        raise GitSmartRemoteNotSupported(self.list_files, self)
 
846
 
846
847
 
847
848
class RemoteGitRepository(GitRepository):
848
849