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

--HG--
extra : rebase_source : 8fcbb2216cf3c6379865b8a2314ead9307175fd2
This commit is contained in:
Gregory Szorc 2016-02-16 12:19:13 -08:00
Родитель 0227eca3bb
Коммит 249a22c846
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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: