diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-12 14:07:37 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-17 10:29:26 +0000 |
commit | ec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch) | |
tree | 25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/v8/PRESUBMIT.py | |
parent | bb09965444b5bb20b096a291445170876225268d (diff) | |
download | qtwebengine-chromium-ec02ee4181c49b61fce1c8fb99292dbb8139cc90.tar.gz |
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/v8/PRESUBMIT.py')
-rw-r--r-- | chromium/v8/PRESUBMIT.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/chromium/v8/PRESUBMIT.py b/chromium/v8/PRESUBMIT.py index 4cacf811336..6aa94a01b37 100644 --- a/chromium/v8/PRESUBMIT.py +++ b/chromium/v8/PRESUBMIT.py @@ -31,6 +31,7 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built into gcl. """ +import re import sys @@ -250,6 +251,7 @@ def _CheckMissingFiles(input_api, output_api): def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] + results.extend(_CheckCommitMessageBugEntry(input_api, output_api)) results.extend(input_api.canned_checks.CheckOwners( input_api, output_api, source_file_filter=None)) results.extend(input_api.canned_checks.CheckPatchFormatted( @@ -276,6 +278,32 @@ def _SkipTreeCheck(input_api, output_api): return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' +def _CheckCommitMessageBugEntry(input_api, output_api): + """Check that bug entries are well-formed in commit message.""" + bogus_bug_msg = ( + 'Bogus BUG entry: %s. Please specify the issue tracker prefix and the ' + 'issue number, separated by a colon, e.g. v8:123 or chromium:12345.') + results = [] + for bug in (input_api.change.BUG or '').split(','): + bug = bug.strip() + if 'none'.startswith(bug.lower()): + continue + if ':' not in bug: + try: + if int(bug) > 100000: + # Rough indicator for current chromium bugs. + prefix_guess = 'chromium' + else: + prefix_guess = 'v8' + results.append('BUG entry requires issue tracker prefix, e.g. %s:%s' % + (prefix_guess, bug)) + except ValueError: + results.append(bogus_bug_msg % bug) + elif not re.match(r'\w+:\d+', bug): + results.append(bogus_bug_msg % bug) + return [output_api.PresubmitError(r) for r in results] + + def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) |