| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 """Check the env var whether we want to skip tree check. | 62 """Check the env var whether we want to skip tree check. |
| 63 Only skip if src/version.cc has been updated.""" | 63 Only skip if src/version.cc has been updated.""" |
| 64 src_version = 'src/version.cc' | 64 src_version = 'src/version.cc' |
| 65 FilterFile = lambda file: file.LocalPath() == src_version | 65 FilterFile = lambda file: file.LocalPath() == src_version |
| 66 if not input_api.AffectedSourceFiles( | 66 if not input_api.AffectedSourceFiles( |
| 67 lambda file: file.LocalPath() == src_version): | 67 lambda file: file.LocalPath() == src_version): |
| 68 return False | 68 return False |
| 69 return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' | 69 return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' |
| 70 | 70 |
| 71 | 71 |
| 72 def _CheckChangeLogFlag(input_api, output_api): |
| 73 """Checks usage of LOG= flag in the commit message.""" |
| 74 results = [] |
| 75 if input_api.change.BUG and not 'LOG' in input_api.change.tags: |
| 76 results.append(output_api.PresubmitError( |
| 77 'An issue reference (BUG=) requires a change log flag (LOG=). ' |
| 78 'Use LOG=Y for including this commit message in the change log. ' |
| 79 'Use LOG=N or leave blank otherwise.')) |
| 80 return results |
| 81 |
| 82 |
| 72 def CheckChangeOnUpload(input_api, output_api): | 83 def CheckChangeOnUpload(input_api, output_api): |
| 73 results = [] | 84 results = [] |
| 74 results.extend(_CommonChecks(input_api, output_api)) | 85 results.extend(_CommonChecks(input_api, output_api)) |
| 86 results.extend(_CheckChangeLogFlag(input_api, output_api)) |
| 75 return results | 87 return results |
| 76 | 88 |
| 77 | 89 |
| 78 def CheckChangeOnCommit(input_api, output_api): | 90 def CheckChangeOnCommit(input_api, output_api): |
| 79 results = [] | 91 results = [] |
| 80 results.extend(_CommonChecks(input_api, output_api)) | 92 results.extend(_CommonChecks(input_api, output_api)) |
| 93 results.extend(_CheckChangeLogFlag(input_api, output_api)) |
| 81 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 94 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 82 input_api, output_api)) | 95 input_api, output_api)) |
| 83 if not _SkipTreeCheck(input_api, output_api): | 96 if not _SkipTreeCheck(input_api, output_api): |
| 84 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 97 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
| 85 input_api, output_api, | 98 input_api, output_api, |
| 86 json_url='http://v8-status.appspot.com/current?format=json')) | 99 json_url='http://v8-status.appspot.com/current?format=json')) |
| 87 return results | 100 return results |
| OLD | NEW |