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>
This commit is contained in:
Shawn O. Pearce 2011-10-11 14:12:46 -07:00
parent df5ee52050
commit 1a68dc58eb

View File

@ -575,6 +575,16 @@ class Remote(object):
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()