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.""" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 _RunCommand(['git', 'add', '--update', '.']) | 330 _RunCommand(['git', 'add', '--update', '.']) |
331 _RunCommand(['git', 'commit', '-m', commit_msg]) | 331 _RunCommand(['git', 'commit', '-m', commit_msg]) |
332 | 332 |
333 | 333 |
334 def _UploadCL(dry_run): | 334 def _UploadCL(dry_run): |
335 logging.info('Uploading CL...') | 335 logging.info('Uploading CL...') |
336 if not dry_run: | 336 if not dry_run: |
337 _RunCommand(['git', 'cl', 'upload'], extra_env={'EDITOR': 'true'}) | 337 _RunCommand(['git', 'cl', 'upload'], extra_env={'EDITOR': 'true'}) |
338 | 338 |
339 | 339 |
340 def _LaunchTrybots(dry_run): | 340 def _LaunchTrybots(dry_run, skip_try): |
341 logging.info('Sending tryjobs...') | 341 logging.info('Sending tryjobs...') |
342 if not dry_run: | 342 if not dry_run and not skip_try: |
343 _RunCommand(['git', 'cl', 'try']) | 343 _RunCommand(['git', 'cl', 'try']) |
344 | 344 |
345 | 345 |
346 def main(): | 346 def main(): |
347 p = argparse.ArgumentParser() | 347 p = argparse.ArgumentParser() |
348 p.add_argument('--clean', action='store_true', default=False, | 348 p.add_argument('--clean', action='store_true', default=False, |
349 help='Removes any previous local roll branch.') | 349 help='Removes any previous local roll branch.') |
350 p.add_argument('-r', '--revision', | 350 p.add_argument('-r', '--revision', |
351 help=('Chromium Git revision to roll to. Defaults to the ' | 351 help=('Chromium Git revision to roll to. Defaults to the ' |
352 'Chromium LKGR revision if omitted.')) | 352 'Chromium LKGR revision if omitted.')) |
353 p.add_argument('--dry-run', action='store_true', default=False, | 353 p.add_argument('--dry-run', action='store_true', default=False, |
354 help=('Calculate changes and modify DEPS, but don\'t create ' | 354 help=('Calculate changes and modify DEPS, but don\'t create ' |
355 'any local branch, commit, upload CL or send any ' | 355 'any local branch, commit, upload CL or send any ' |
356 'tryjobs.')) | 356 'tryjobs.')) |
| 357 p.add_argument('-s', '--skip-try', action='store_true', default=False, |
| 358 help='Do everything except sending tryjobs.') |
357 p.add_argument('-v', '--verbose', action='store_true', default=False, | 359 p.add_argument('-v', '--verbose', action='store_true', default=False, |
358 help='Be extra verbose in printing of log messages.') | 360 help='Be extra verbose in printing of log messages.') |
359 opts = p.parse_args() | 361 opts = p.parse_args() |
360 | 362 |
361 if opts.verbose: | 363 if opts.verbose: |
362 logging.basicConfig(level=logging.DEBUG) | 364 logging.basicConfig(level=logging.DEBUG) |
363 else: | 365 else: |
364 logging.basicConfig(level=logging.INFO) | 366 logging.basicConfig(level=logging.INFO) |
365 | 367 |
366 if not _IsTreeClean(): | 368 if not _IsTreeClean(): |
(...skipping 23 matching lines...) Expand all Loading... |
390 logging.debug('Commit message:\n%s', commit_msg) | 392 logging.debug('Commit message:\n%s', commit_msg) |
391 else: | 393 else: |
392 logging.info('No deps changes detected when rolling from %s to %s. ' | 394 logging.info('No deps changes detected when rolling from %s to %s. ' |
393 'Aborting without action.', current_cr_rev, opts.revision) | 395 'Aborting without action.', current_cr_rev, opts.revision) |
394 return 0 | 396 return 0 |
395 | 397 |
396 _CreateRollBranch(opts.dry_run) | 398 _CreateRollBranch(opts.dry_run) |
397 UpdateDeps(deps_filename, current_cr_rev, opts.revision) | 399 UpdateDeps(deps_filename, current_cr_rev, opts.revision) |
398 _LocalCommit(commit_msg, opts.dry_run) | 400 _LocalCommit(commit_msg, opts.dry_run) |
399 _UploadCL(opts.dry_run) | 401 _UploadCL(opts.dry_run) |
400 _LaunchTrybots(opts.dry_run) | 402 _LaunchTrybots(opts.dry_run, opts.skip_try) |
401 return 0 | 403 return 0 |
402 | 404 |
403 | 405 |
404 if __name__ == '__main__': | 406 if __name__ == '__main__': |
405 sys.exit(main()) | 407 sys.exit(main()) |
OLD | NEW |