diff options
| -rw-r--r-- | manifest_xml.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 890c954d..8b57bf52 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -38,8 +38,9 @@ MANIFEST_FILE_NAME = 'manifest.xml' | |||
| 38 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' | 38 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' |
| 39 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' | 39 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' |
| 40 | 40 | ||
| 41 | urllib.parse.uses_relative.extend(['ssh', 'git']) | 41 | # urljoin gets confused if the scheme is not known. |
| 42 | urllib.parse.uses_netloc.extend(['ssh', 'git']) | 42 | urllib.parse.uses_relative.extend(['ssh', 'git', 'persistent-https', 'rpc']) |
| 43 | urllib.parse.uses_netloc.extend(['ssh', 'git', 'persistent-https', 'rpc']) | ||
| 43 | 44 | ||
| 44 | class _Default(object): | 45 | class _Default(object): |
| 45 | """Project defaults within the manifest.""" | 46 | """Project defaults within the manifest.""" |
| @@ -85,21 +86,13 @@ class _XmlRemote(object): | |||
| 85 | # urljoin will gets confused over quite a few things. The ones we care | 86 | # urljoin will gets confused over quite a few things. The ones we care |
| 86 | # about here are: | 87 | # about here are: |
| 87 | # * no scheme in the base url, like <hostname:port> | 88 | # * no scheme in the base url, like <hostname:port> |
| 88 | # * persistent-https:// | 89 | # We handle no scheme by replacing it with an obscure protocol, gopher |
| 89 | # * rpc:// | 90 | # and then replacing it with the original when we are done. |
| 90 | # We handle this by replacing these with obscure protocols | 91 | |
| 91 | # and then replacing them with the original when we are done. | ||
| 92 | # gopher -> <none> | ||
| 93 | # wais -> persistent-https | ||
| 94 | # nntp -> rpc | ||
| 95 | if manifestUrl.find(':') != manifestUrl.find('/') - 1: | 92 | if manifestUrl.find(':') != manifestUrl.find('/') - 1: |
| 96 | manifestUrl = 'gopher://' + manifestUrl | 93 | url = urllib.parse.urljoin('gopher://' + manifestUrl, url)[9:] |
| 97 | manifestUrl = re.sub(r'^persistent-https://', 'wais://', manifestUrl) | 94 | else: |
| 98 | manifestUrl = re.sub(r'^rpc://', 'nntp://', manifestUrl) | 95 | url = urllib.parse.urljoin(manifestUrl, url) |
| 99 | url = urllib.parse.urljoin(manifestUrl, url) | ||
| 100 | url = re.sub(r'^gopher://', '', url) | ||
| 101 | url = re.sub(r'^wais://', 'persistent-https://', url) | ||
| 102 | url = re.sub(r'^nntp://', 'rpc://', url) | ||
| 103 | return url | 96 | return url |
| 104 | 97 | ||
| 105 | def ToRemoteSpec(self, projectName): | 98 | def ToRemoteSpec(self, projectName): |
