Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: git_cl.py

Issue 2419123002: Fix logic to detect Gerrit CL in CQ (Closed)
Patch Set: Initial upload Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 174d46b3be6f0fa740e246577b7278f63dbbde5a..a61bb9144687a796f002f51cbce6c48299ccbfa5 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2337,8 +2337,15 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
cq_label = data['labels'].get('Commit-Queue', {})
if cq_label:
- # Vote value is a stringified integer, which we expect from 0 to 2.
- vote_value = cq_label.get('value', '0')
+ votes = cq_label.get('all', [])
+ highest_vote = 0
+ for v in votes:
+ highest_vote = max(highest_vote, v.get('value', 0))
+ vote_value = str(highest_vote)
+ if vote_value != '0':
+ # Add a '+' if the value is not 0 to match the values in the label.
+ # The cq_label does not have negatives.
+ vote_value = '+' + vote_value
vote_text = cq_label.get('values', {}).get(vote_value, '')
if vote_text.lower() == 'commit':
return 'commit'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698