From 33e88a4e19aa1eb306fe66431e8b0621773eb66c Mon Sep 17 00:00:00 2001 From: Andrii Shyshkalov Date: Fri, 27 Jan 2017 14:45:30 +0100 Subject: [PATCH] Gerrit git cl status: do not treat CQ comment as reviewer reply. R=sergiyb@chromium.org,agable@chromium.org BUG= Change-Id: I7684923c19fe7441cdd52b7707c28f01c95a4ba4 Reviewed-on: https://chromium-review.googlesource.com/433699 Commit-Queue: Andrii Shyshkalov Reviewed-by: Sergiy Byelozyorov --- git_cl.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/git_cl.py b/git_cl.py index 839d2e556..ef702b95b 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2387,13 +2387,15 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): return 'unsent' messages = data.get('messages', []) - if messages: - owner = data['owner'].get('_account_id') - last_message_author = messages[-1].get('author', {}).get('_account_id') - if owner != last_message_author: + owner = data['owner'].get('_account_id') + while messages: + last_message_author = messages.pop().get('author', {}) + if last_message_author.get('email') == COMMIT_BOT_EMAIL: + # Ignore replies from CQ. + continue + if owner != last_message_author.get('_account_id'): # Some reply from non-owner. return 'reply' - return 'waiting' def GetMostRecentPatchset(self):