| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Top-level presubmit script for Chromium OS. | 5 """Top-level presubmit script for Chromium OS. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into gcl and git cl. | 8 for more details about the presubmit API built into gcl and git cl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 if inconsistent: | 58 if inconsistent: |
| 59 output.append(output_api.PresubmitPromptWarning( | 59 output.append(output_api.PresubmitPromptWarning( |
| 60 'Following ebuilds are inconsistent with 9999:', items=inconsistent)) | 60 'Following ebuilds are inconsistent with 9999:', items=inconsistent)) |
| 61 return output | 61 return output |
| 62 | 62 |
| 63 def CheckChange(input_api, output_api, committing): | 63 def CheckChange(input_api, output_api, committing): |
| 64 ebuilds = lambda x: input_api.FilterSourceFile(x, white_list=_EBUILD_FILES) | 64 ebuilds = lambda x: input_api.FilterSourceFile(x, white_list=_EBUILD_FILES) |
| 65 results = [] | 65 results = [] |
| 66 results += Check9999Updated(input_api, output_api, | 66 results += Check9999Updated(input_api, output_api, |
| 67 source_file_filter=ebuilds) | 67 source_file_filter=ebuilds) |
| 68 results += CheckFoo(input_api, output_api) |
| 68 return results | 69 return results |
| 69 | 70 |
| 70 def CheckChangeOnUpload(input_api, output_api): | 71 def CheckChangeOnUpload(input_api, output_api): |
| 71 return CheckChange(input_api, output_api, False) | 72 return CheckChange(input_api, output_api, False) |
| 72 | 73 |
| 73 def CheckChangeOnCommit(input_api, output_api): | 74 def CheckChangeOnCommit(input_api, output_api): |
| 74 return CheckChange(input_api, output_api, True) | 75 return CheckChange(input_api, output_api, True) |
| 76 |
| 77 def CheckFoo(input_api, output_api): |
| 78 output = [] |
| 79 if input_api.change.patchset: |
| 80 output.append(output_api.PresubmitPromptWarning( |
| 81 'Patchset is %d' % input_api.change.patchset)) |
| 82 if input_api.change.issue: |
| 83 output.append(output_api.PresubmitPromptWarning( |
| 84 'Issue is %d' % input_api.change.patchset)) |
| 85 |
| 86 return output |
| 87 |
| OLD | NEW |