Chromium Code Reviews| Index: presubmit_canned_checks.py |
| diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py |
| index af88a39b1e8b35099655b3ac1688edfb33c6171e..b8dc3a738b4afe8562097899f3fb5e7947d54b2d 100644 |
| --- a/presubmit_canned_checks.py |
| +++ b/presubmit_canned_checks.py |
| @@ -791,6 +791,25 @@ def CheckOwners(input_api, output_api, source_file_filter=None): |
| return [] |
| +def CheckIssueNotClosed(input_api, output_api): |
| + """Verify issue is not closed. |
| + |
| + We should not be working with a closed review. CQ and dcommit set this bit, |
| + so it is a pretty good indicator of whether an issue has been committed. |
| + """ |
| + |
| + issue = input_api.change.issue |
| + if issue: |
| + issue_props = input_api.rietveld.get_issue_properties( |
|
M-A Ruel
2012/11/19 13:04:01
input_api.rietveld could be None in the case it's
Isaac (away)
2012/11/21 20:24:32
Done, added to _GetRietveldIssueProps in latest pa
|
| + issue=int(issue), messages=False) |
|
M-A Ruel
2012/11/19 13:04:01
Is the int() call necessary? If so, it's a bug in
Isaac (away)
2012/11/21 20:24:32
It was required, fixed in latest patchset.
|
| + if issue_props['closed']: |
| + return [output_api.PresubmitError( |
| + 'Issue %s is closed. If this issue was already used for a commit,\n' |
| + 'please reset the issue number associated with this branch with:\n' |
| + 'git cl issue 0\n' % issue |
| + )] |
| + return [] |
| + |
|
M-A Ruel
2012/11/19 13:04:01
2 lines
Isaac (away)
2012/11/21 20:24:32
Done.
|
| def _RietveldOwnerAndReviewers(input_api, email_regexp, approval_needed=False): |
| """Return the owner and reviewers of a change, if any. |
| @@ -940,6 +959,10 @@ def PanProjectChecks(input_api, output_api, |
| results.extend(input_api.canned_checks.CheckOwners( |
| input_api, output_api, source_file_filter=None)) |
| + snapshot("checking review not closed") |
| + results.extend(input_api.canned_checks.CheckIssueNotClosed( |
| + input_api, output_api)) |
| + |
| snapshot("checking long lines") |
| results.extend(input_api.canned_checks.CheckLongLines( |
| input_api, output_api, source_file_filter=sources)) |