gerrit: do not highlight 0 labels as green
In the past, Gerrit would omit labels that weren't set. For newer CLs,
it seems to always return values, just set to 0. Don't highlight those
as green either as that's the "resting" state.
BUG=None
TEST=`gerrit todo` shows green only for labels with 1 or 2
Change-Id: Iddb5ed44a6db9de47d4e09991e4262464481186a
Reviewed-on: https://chromium-review.googlesource.com/565462
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 8d11679..8cee1e7 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -130,7 +130,7 @@
if show_approvals and not opts.verbose:
approvs = GetApprovalSummary(opts, cl)
for cat in GERRIT_SUMMARY_CATS:
- if approvs[cat] is '':
+ if approvs[cat] is '' or approvs[cat] == 0:
functor = lambda x: x
elif approvs[cat] < 0:
functor = red