upload: Honor REPO_HOST_PORT_INFO environment variable
REPO_HOST_PORT_INFO can be set to 'host:port' and be used
instead of the review URL given in the manifest.
Change-Id: I440bdecb2c2249fe5285ec5d0c28a937b4053450
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/git_config.py b/git_config.py
index ac41d5b..a52677c 100644
--- a/git_config.py
+++ b/git_config.py
@@ -575,6 +575,16 @@
self._review_protocol = info[0]
self._review_host = info[1]
self._review_port = info[2]
+ elif 'REPO_HOST_PORT_INFO' in os.environ:
+ info = os.environ['REPO_HOST_PORT_INFO']
+ self._review_protocol = 'ssh'
+ self._review_host = info.split(" ")[0]
+ self._review_port = info.split(" ")[1]
+
+ REVIEW_CACHE[u] = (
+ self._review_protocol,
+ self._review_host,
+ self._review_port)
else:
try:
info = urllib2.urlopen(u).read()