Bug 1245953 - Fail fast if no VCS info defined; r=garndt

Before, we attempted to build and query a URL that potentially had
"None" in it. This printed some wonky messages in the log and may have
contributed to added latency due to the HTTP request that was doomed to
fail.

MozReview-Commit-ID: JrR5PK33vCn
This commit is contained in:
Gregory Szorc
2016-02-16 12:19:13 -08:00
parent 15dd042e6e
commit 54d23d216c

View File

@@ -149,6 +149,10 @@ def query_vcs_info(repository, revision):
This is intended to be used on hg.mozilla.org/mozilla-central and
similar. It may or may not work for other hg repositories.
"""
if not repository or not revision:
sys.stderr.write('cannot query vcs info because vcs info not provided\n')
return None
PushInfo = namedtuple('PushInfo', ['pushid', 'pushdate'])
try: