| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Enables directory-specific presubmit checks to run at upload and/or commit. | 6 """Enables directory-specific presubmit checks to run at upload and/or commit. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 __version__ = '1.3.5' | 9 __version__ = '1.3.5' |
| 10 | 10 |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 default_presubmit: A default presubmit script to execute in any case. | 938 default_presubmit: A default presubmit script to execute in any case. |
| 939 may_prompt: Enable (y/n) questions on warning or error. | 939 may_prompt: Enable (y/n) questions on warning or error. |
| 940 | 940 |
| 941 Warning: | 941 Warning: |
| 942 If may_prompt is true, output_stream SHOULD be sys.stdout and input_stream | 942 If may_prompt is true, output_stream SHOULD be sys.stdout and input_stream |
| 943 SHOULD be sys.stdin. | 943 SHOULD be sys.stdin. |
| 944 | 944 |
| 945 Return: | 945 Return: |
| 946 True if execution can continue, False if not. | 946 True if execution can continue, False if not. |
| 947 """ | 947 """ |
| 948 print "Running presubmit hooks..." |
| 948 start_time = time.time() | 949 start_time = time.time() |
| 949 presubmit_files = ListRelevantPresubmitFiles(change.AbsoluteLocalPaths(True), | 950 presubmit_files = ListRelevantPresubmitFiles(change.AbsoluteLocalPaths(True), |
| 950 change.RepositoryRoot()) | 951 change.RepositoryRoot()) |
| 951 if not presubmit_files and verbose: | 952 if not presubmit_files and verbose: |
| 952 output_stream.write("Warning, no presubmit.py found.\n") | 953 output_stream.write("Warning, no presubmit.py found.\n") |
| 953 results = [] | 954 results = [] |
| 954 executer = PresubmitExecuter(change, committing) | 955 executer = PresubmitExecuter(change, committing) |
| 955 if default_presubmit: | 956 if default_presubmit: |
| 956 if verbose: | 957 if verbose: |
| 957 output_stream.write("Running default presubmit script.\n") | 958 output_stream.write("Running default presubmit script.\n") |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 options.commit, | 1088 options.commit, |
| 1088 options.verbose, | 1089 options.verbose, |
| 1089 sys.stdout, | 1090 sys.stdout, |
| 1090 sys.stdin, | 1091 sys.stdin, |
| 1091 options.default_presubmit, | 1092 options.default_presubmit, |
| 1092 options.may_prompt) | 1093 options.may_prompt) |
| 1093 | 1094 |
| 1094 | 1095 |
| 1095 if __name__ == '__main__': | 1096 if __name__ == '__main__': |
| 1096 sys.exit(Main(sys.argv)) | 1097 sys.exit(Main(sys.argv)) |
| OLD | NEW |