Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index 8bfc1061e376bb5825723cc68430cf37f8560444..6a629925cee7ebcac6e5e4e82b08d989ca00faee 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -647,6 +647,10 @@ or verify this branch is set up to track another (via the --track argument to |
| return self.RpcServer().get( |
| '/download/issue%s_%s.diff' % (issue, patchset)) |
| + def GetActualReviewers(self, issue): |
|
Dirk Pranke
2013/04/09 00:15:51
should this be GetRealReviewers to match?
M-A Ruel
2013/04/11 01:11:28
GetApprovingReviewers()
|
| + return get_real_reviewers( |
| + self.RpcServer().get_issue_properties(int(issue), False)) |
| + |
| def SetIssue(self, issue): |
| """Set this branch's issue. If issue=0, clears the issue.""" |
| if issue: |
| @@ -875,6 +879,22 @@ class ChangeDescription(object): |
| return sorted(i for i in reviewers if i) |
| +def get_real_reviewers(props): |
| + """Retrieves the reviewers that approved a cL from the issue properties with |
|
Dirk Pranke
2013/04/09 00:15:51
nit: "CL", not "cL".
I wonder if this should be "
M-A Ruel
2013/04/11 01:11:28
Done.
|
| + messages. |
| + |
| + Note that the list may contain reviewers that are not committer, thus are not |
| + considered by the CQ. |
| + """ |
| + return sorted( |
| + set( |
| + message['sender'] |
| + for message in props['messages'] |
| + if message['approval'] and message['sender'] in props['reviewers'] |
| + ) |
| + ) |
| + |
| + |
| def FindCodereviewSettingsFile(filename='codereview.settings'): |
| """Finds the given file starting in the cwd and going up. |
| @@ -1465,6 +1485,10 @@ def SendUpstream(parser, args, cmd): |
| print 'Visit %s/edit to set it.' % (cl.GetIssueURL()) |
| return 1 |
| + if cl.GetIssue(): |
| + actual_reviewers = ','.join(cl.GetActualReviewers(cl.GetIssue())) |
| + change_desc.update_reviewers(actual_reviewers) |
| + |
| # Keep a separate copy for the commit message. |
| commit_desc = ChangeDescription(change_desc.description) |
| if cl.GetIssue(): |