diff options
| author | T.R. Fullhart <tfullhart@google.com> | 2014-09-10 13:44:39 -0700 |
|---|---|---|
| committer | T.R. Fullhart <tfullhart@google.com> | 2014-09-10 13:45:52 -0700 |
| commit | 4863307299bee9a644a94957f06bed48d898532e (patch) | |
| tree | 51f200682b734f230e4ce193c23f20f8aea53101 | |
| parent | f75870beac41d046d0abc4cd1c03621a7a460f5a (diff) | |
| download | git-repo-4863307299bee9a644a94957f06bed48d898532e.tar.gz | |
Add support for rpc:// protocol schemes.
Change-Id: I0e500e45cacc20ac04b43435c4bd189299e9e97b
| -rw-r--r-- | manifest_xml.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 3517c151..6d70c86b 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -86,16 +86,20 @@ class _XmlRemote(object): | |||
| 86 | # about here are: | 86 | # about here are: |
| 87 | # * no scheme in the base url, like <hostname:port> | 87 | # * no scheme in the base url, like <hostname:port> |
| 88 | # * persistent-https:// | 88 | # * persistent-https:// |
| 89 | # * rpc:// | ||
| 89 | # We handle this by replacing these with obscure protocols | 90 | # We handle this by replacing these with obscure protocols |
| 90 | # and then replacing them with the original when we are done. | 91 | # and then replacing them with the original when we are done. |
| 91 | # gopher -> <none> | 92 | # gopher -> <none> |
| 92 | # wais -> persistent-https | 93 | # wais -> persistent-https |
| 94 | # nntp -> rpc | ||
| 93 | if manifestUrl.find(':') != manifestUrl.find('/') - 1: | 95 | if manifestUrl.find(':') != manifestUrl.find('/') - 1: |
| 94 | manifestUrl = 'gopher://' + manifestUrl | 96 | manifestUrl = 'gopher://' + manifestUrl |
| 95 | manifestUrl = re.sub(r'^persistent-https://', 'wais://', manifestUrl) | 97 | manifestUrl = re.sub(r'^persistent-https://', 'wais://', manifestUrl) |
| 98 | manifestUrl = re.sub(r'^rpc://', 'nntp://', manifestUrl) | ||
| 96 | url = urllib.parse.urljoin(manifestUrl, url) | 99 | url = urllib.parse.urljoin(manifestUrl, url) |
| 97 | url = re.sub(r'^gopher://', '', url) | 100 | url = re.sub(r'^gopher://', '', url) |
| 98 | url = re.sub(r'^wais://', 'persistent-https://', url) | 101 | url = re.sub(r'^wais://', 'persistent-https://', url) |
| 102 | url = re.sub(r'^nntp://', 'rpc://', url) | ||
| 99 | return url | 103 | return url |
| 100 | 104 | ||
| 101 | def ToRemoteSpec(self, projectName): | 105 | def ToRemoteSpec(self, projectName): |
