/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: Breezy landing bot
  • Author(s): Vincent Ladeuil
  • Date: 2019-11-19 20:32:00 UTC
  • mfrom: (7413.1.2 trunk)
  • Revision ID: breezy.the.bot@gmail.com-20191119203200-fy55qqighr2xkr8r
Merge lp:brz/3.0 after 3.0.2 release.

Merged from https://code.launchpad.net/~vila/brz/trunk/+merge/375724

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):