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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
def git_url_to_bzr_url(location):
30
30
    url = URL.from_string(location)
31
 
    if url.scheme not in KNOWN_GIT_SCHEMES and not url.scheme.startswith('chroot-'):
 
31
    if (url.scheme not in KNOWN_GIT_SCHEMES
 
32
            and not url.scheme.startswith('chroot-')):
32
33
        try:
33
34
            (username, host, path) = parse_rsync_url(location)
34
35
        except ValueError:
35
36
            return location
36
37
        else:
37
38
            url = URL(
38
 
                    scheme='git+ssh',
39
 
                    quoted_user=(quote(username) if username else None),
40
 
                    quoted_password=None,
41
 
                    quoted_host=quote(host),
42
 
                    port=None,
43
 
                    quoted_path=quote(path, safe="/~"))
 
39
                scheme='git+ssh',
 
40
                quoted_user=(quote(username) if username else None),
 
41
                quoted_password=None,
 
42
                quoted_host=quote(host),
 
43
                port=None,
 
44
                quoted_path=quote(path, safe="/~"))
44
45
        return str(url)
45
46
    else:
46
47
        return location