summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-06-25 16:09:43 -0700
committerXin Li <delphij@google.com>2019-06-26 09:42:21 -0700
commit3698ab7c9200a2b65652e9a5f3a763cd7629af0c (patch)
treed305636465fad949eca56b0b3c3fa630608d05f6 /project.py
parent0c0e934b699cd4b6da623c208069c4ca40a0c405 (diff)
downloadgit-repo-3698ab7c9200a2b65652e9a5f3a763cd7629af0c.tar.gz
Support clone bundle through persistent-http[s].
Bug: https://crbug.com/gerrit/11075 Change-Id: I367c6bfe8da47d886c017a2ac614d4ccb3f8a438
Diffstat (limited to 'project.py')
-rwxr-xr-xproject.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/project.py b/project.py
index ae2bf6f3..8a38c584 100755
--- a/project.py
+++ b/project.py
@@ -2217,13 +2217,17 @@ class Project(object):
2217 cmd += ['--continue-at', '%d' % (size,)] 2217 cmd += ['--continue-at', '%d' % (size,)]
2218 else: 2218 else:
2219 platform_utils.remove(tmpPath) 2219 platform_utils.remove(tmpPath)
2220 if 'http_proxy' in os.environ and 'darwin' == sys.platform: 2220 with GetUrlCookieFile(srcUrl, quiet) as (cookiefile, proxy):
2221 cmd += ['--proxy', os.environ['http_proxy']]
2222 with GetUrlCookieFile(srcUrl, quiet) as (cookiefile, _proxy):
2223 if cookiefile: 2221 if cookiefile:
2224 cmd += ['--cookie', cookiefile, '--cookie-jar', cookiefile] 2222 cmd += ['--cookie', cookiefile, '--cookie-jar', cookiefile]
2225 if srcUrl.startswith('persistent-'): 2223 if proxy:
2226 srcUrl = srcUrl[len('persistent-'):] 2224 cmd += ['--proxy', proxy]
2225 elif 'http_proxy' in os.environ and 'darwin' == sys.platform:
2226 cmd += ['--proxy', os.environ['http_proxy']]
2227 if srcUrl.startswith('persistent-https'):
2228 srcUrl = 'http' + srcUrl[len('persistent-https'):]
2229 elif srcUrl.startswith('persistent-http'):
2230 srcUrl = 'http' + srcUrl[len('persistent-http'):]
2227 cmd += [srcUrl] 2231 cmd += [srcUrl]
2228 2232
2229 if IsTrace(): 2233 if IsTrace():