summaryrefslogtreecommitdiffstats
path: root/contrib/trivial_rebase.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/trivial_rebase.py')
-rwxr-xr-xcontrib/trivial_rebase.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/trivial_rebase.py b/contrib/trivial_rebase.py
index 7764470430..30e60afea4 100755
--- a/contrib/trivial_rebase.py
+++ b/contrib/trivial_rebase.py
@@ -131,7 +131,7 @@ class TrivialRebase:
Returns a list of approval dicts.
"""
- sql_query = ("\"SELECT value,account_id,category_id FROM patch_set_approvals "
+ sql_query = ("\"SELECT value,account_id,category_id AS label FROM patch_set_approvals "
"WHERE change_id = %s AND patch_set_id = %s AND value != 0\""
% (self.changeId, (self.patchset - 1)))
gsql_out = self.GsqlQuery(sql_query)
@@ -221,19 +221,20 @@ class TrivialRebase:
# Note: Sites with different 'copy_min_score' values in the
# approval_categories DB table might want different behavior here.
# Additional categories should also be added if desired.
- if approval["category_id"] == "Code-Review" and approval['value'] != '-2':
- self.AppendAcctApproval(approval['account_id'], '--code-review %s' % approval['value'])
- elif approval["category_id"] == "Verified":
+ if approval["label"] == "Code-Review":
+ if approval['value'] != '-2':
+ self.AppendAcctApproval(approval['account_id'],
+ '--label Code-Review=%s' % approval['value'])
+ elif approval["label"] == "Verified":
# Don't re-add verifies
- # self.AppendAcctApproval(approval['account_id'], '--verified %s' % approval['value'])
+ # self.AppendAcctApproval(approval['account_id'], '--label Verified=%s' % approval['value'])
continue
- elif approval["category_id"] == "SUBM":
+ elif approval["label"] == "SUBM":
# We don't care about previous submit attempts
continue
else:
- self.AppendAcctApproval(approval['account_id'], '--%s %s' %
- (approval['category_id'].lower().replace(' ', '-'),
- approval['value']))
+ self.AppendAcctApproval(approval['account_id'], '--label %s=%s' %
+ (approval['label'], approval['value']))
gerrit_review_msg = ("\'Automatically re-added by Gerrit trivial rebase "
"detection script.\'")