OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """Script to roll chromium_revision in the WebRTC DEPS file.""" | 10 """Script to roll chromium_revision in the WebRTC DEPS file.""" |
11 | 11 |
12 import argparse | 12 import argparse |
13 import base64 | 13 import base64 |
14 import collections | 14 import collections |
15 import logging | 15 import logging |
16 import os | 16 import os |
17 import re | 17 import re |
18 import subprocess | 18 import subprocess |
19 import sys | 19 import sys |
20 import urllib | 20 import urllib |
21 | 21 |
22 | 22 |
23 CHROMIUM_SRC_URL = 'https://chromium.googlesource.com/chromium/src' | 23 CHROMIUM_SRC_URL = 'https://chromium.googlesource.com/chromium/src' |
24 CHROMIUM_COMMIT_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s' | 24 CHROMIUM_COMMIT_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s' |
25 CHROMIUM_LOG_TEMPLATE = CHROMIUM_SRC_URL + '/+log/%s' | 25 CHROMIUM_LOG_TEMPLATE = CHROMIUM_SRC_URL + '/+log/%s' |
26 CHROMIUM_FILE_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s/%s' | 26 CHROMIUM_FILE_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s/%s' |
27 | 27 |
28 # Run these CQ trybots in addition to the default ones in infra/config/cq.cfg. | |
29 EXTRA_TRYBOTS = 'tryserver.webrtc:win_baremetal,mac_baremetal,linux_baremetal' | |
30 | |
31 COMMIT_POSITION_RE = re.compile('^Cr-Commit-Position: .*#([0-9]+).*$') | 28 COMMIT_POSITION_RE = re.compile('^Cr-Commit-Position: .*#([0-9]+).*$') |
32 CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION=(\d+)$') | 29 CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION=(\d+)$') |
33 ROLL_BRANCH_NAME = 'roll_chromium_revision' | 30 ROLL_BRANCH_NAME = 'roll_chromium_revision' |
34 | 31 |
35 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 32 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
36 CHECKOUT_ROOT_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, os.pardir, | 33 CHECKOUT_ROOT_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, os.pardir, |
37 os.pardir)) | 34 os.pardir)) |
38 sys.path.append(CHECKOUT_ROOT_DIR) | 35 sys.path.append(CHECKOUT_ROOT_DIR) |
39 import setup_links | 36 import setup_links |
40 | 37 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 commit_msg.append('Clang version changed %s:%s' % | 282 commit_msg.append('Clang version changed %s:%s' % |
286 (clang_change.current_rev, clang_change.new_rev)) | 283 (clang_change.current_rev, clang_change.new_rev)) |
287 change_url = CHROMIUM_FILE_TEMPLATE % (rev_interval, | 284 change_url = CHROMIUM_FILE_TEMPLATE % (rev_interval, |
288 CLANG_UPDATE_SCRIPT_URL_PATH) | 285 CLANG_UPDATE_SCRIPT_URL_PATH) |
289 commit_msg.append('Details: %s\n' % change_url) | 286 commit_msg.append('Details: %s\n' % change_url) |
290 tbr_authors += 'pbos@webrtc.org' | 287 tbr_authors += 'pbos@webrtc.org' |
291 else: | 288 else: |
292 commit_msg.append('No update to Clang.\n') | 289 commit_msg.append('No update to Clang.\n') |
293 | 290 |
294 commit_msg.append('TBR=%s' % tbr_authors) | 291 commit_msg.append('TBR=%s' % tbr_authors) |
295 commit_msg.append('CQ_EXTRA_TRYBOTS=%s' % EXTRA_TRYBOTS) | |
296 return '\n'.join(commit_msg) | 292 return '\n'.join(commit_msg) |
297 | 293 |
298 | 294 |
299 def UpdateDeps(deps_filename, old_cr_revision, new_cr_revision): | 295 def UpdateDeps(deps_filename, old_cr_revision, new_cr_revision): |
300 """Update the DEPS file with the new revision.""" | 296 """Update the DEPS file with the new revision.""" |
301 with open(deps_filename, 'rb') as deps_file: | 297 with open(deps_filename, 'rb') as deps_file: |
302 deps_content = deps_file.read() | 298 deps_content = deps_file.read() |
303 deps_content = deps_content.replace(old_cr_revision, new_cr_revision) | 299 deps_content = deps_content.replace(old_cr_revision, new_cr_revision) |
304 with open(deps_filename, 'wb') as deps_file: | 300 with open(deps_filename, 'wb') as deps_file: |
305 deps_file.write(deps_content) | 301 deps_file.write(deps_content) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 UpdateDeps(deps_filename, current_cr_rev, new_cr_rev) | 443 UpdateDeps(deps_filename, current_cr_rev, new_cr_rev) |
448 _LocalCommit(commit_msg, opts.dry_run) | 444 _LocalCommit(commit_msg, opts.dry_run) |
449 _UploadCL(opts.dry_run, opts.rietveld_email) | 445 _UploadCL(opts.dry_run, opts.rietveld_email) |
450 _LaunchTrybots(opts.dry_run, opts.skip_try) | 446 _LaunchTrybots(opts.dry_run, opts.skip_try) |
451 _SendToCQ(opts.dry_run, opts.skip_cq) | 447 _SendToCQ(opts.dry_run, opts.skip_cq) |
452 return 0 | 448 return 0 |
453 | 449 |
454 | 450 |
455 if __name__ == '__main__': | 451 if __name__ == '__main__': |
456 sys.exit(main()) | 452 sys.exit(main()) |
OLD | NEW |