Avoid a stacktrace when no reviews are pending

Simply skip the whole function when the remote has no reviews and print
out a friendly user message.

Change-Id: I4c07f05d4b797af056ee08016b150088f3b182db
This commit is contained in:
Antoine Musso
2014-06-27 17:56:03 +02:00
parent c162732aa7
commit 7aca8e69ce

View File

@@ -788,6 +788,10 @@ def list_reviews(remote):
exception=CannotQueryOpenChangesets,
parse_exc=CannotParseOpenChangesets)
if not reviews:
print("No pending reviews")
return
REVIEW_FIELDS = ('number', 'branch', 'subject')
FIELDS = range(len(REVIEW_FIELDS))
if check_color_support():