summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--manifest_xml.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 476472fb..02a5f9ae 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -46,16 +46,20 @@ class _XmlRemote(object):
46 self.fetchUrl = fetch 46 self.fetchUrl = fetch
47 self.manifestUrl = manifestUrl 47 self.manifestUrl = manifestUrl
48 self.reviewUrl = review 48 self.reviewUrl = review
49 self.resolvedFetchUrl = self._resolveFetchUrl()
49 50
50 def ToRemoteSpec(self, projectName): 51 def _resolveFetchUrl(self):
51 url = self.fetchUrl.rstrip('/') + '/' + projectName + '.git' 52 url = self.fetchUrl.rstrip('/')
52 manifestUrl = self.manifestUrl.rstrip('/') 53 manifestUrl = self.manifestUrl.rstrip('/')
53 # urljoin will get confused if there is no scheme in the base url 54 # urljoin will get confused if there is no scheme in the base url
54 # ie, if manifestUrl is of the form <hostname:port> 55 # ie, if manifestUrl is of the form <hostname:port>
55 if manifestUrl.find(':') != manifestUrl.find('/') - 1: 56 if manifestUrl.find(':') != manifestUrl.find('/') - 1:
56 manifestUrl = 'gopher://' + manifestUrl 57 manifestUrl = 'gopher://' + manifestUrl
57 url = urlparse.urljoin(manifestUrl, url) 58 url = urlparse.urljoin(manifestUrl, url)
58 url = re.sub(r'^gopher://', '', url) 59 return re.sub(r'^gopher://', '', url)
60
61 def ToRemoteSpec(self, projectName):
62 url = self.resolvedFetchUrl + '/' + projectName
59 return RemoteSpec(self.name, url, self.reviewUrl) 63 return RemoteSpec(self.name, url, self.reviewUrl)
60 64
61class XmlManifest(object): 65class XmlManifest(object):
@@ -368,7 +372,7 @@ class XmlManifest(object):
368 raise ManifestParseError, 'refusing to mirror %s' % m_url 372 raise ManifestParseError, 'refusing to mirror %s' % m_url
369 373
370 if self._default and self._default.remote: 374 if self._default and self._default.remote:
371 url = self._default.remote.fetchUrl 375 url = self._default.remote.resolvedFetchUrl
372 if not url.endswith('/'): 376 if not url.endswith('/'):
373 url += '/' 377 url += '/'
374 if m_url.startswith(url): 378 if m_url.startswith(url):