Chromium Code Reviews| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 help=('Chromium Git revision to roll to. Defaults to the ' | 442 help=('Chromium Git revision to roll to. Defaults to the ' |
| 443 'Chromium HEAD revision if omitted.')) | 443 'Chromium HEAD revision if omitted.')) |
| 444 p.add_argument('-u', '--rietveld-email', | 444 p.add_argument('-u', '--rietveld-email', |
| 445 help=('E-mail address to use for creating the CL at Rietveld' | 445 help=('E-mail address to use for creating the CL at Rietveld' |
| 446 'If omitted a previously cached one will be used or an ' | 446 'If omitted a previously cached one will be used or an ' |
| 447 'error will be thrown during upload.')) | 447 'error will be thrown during upload.')) |
| 448 p.add_argument('--dry-run', action='store_true', default=False, | 448 p.add_argument('--dry-run', action='store_true', default=False, |
| 449 help=('Calculate changes and modify DEPS, but don\'t create ' | 449 help=('Calculate changes and modify DEPS, but don\'t create ' |
| 450 'any local branch, commit, upload CL or send any ' | 450 'any local branch, commit, upload CL or send any ' |
| 451 'tryjobs.')) | 451 'tryjobs.')) |
| 452 p.add_argument('-i', '--ignore-changes', action='store_true', default=False, | |
|
phoglund
2016/12/14 10:24:50
ignore-unclean-workdir?
kjellander_webrtc
2016/12/14 11:54:06
That's better; I changed it.
| |
| 453 help='Ignore if the current branch is not master or if there ' | |
| 454 'are uncommitted changes (default: %(default)s).') | |
| 452 p.add_argument('--skip-cq', action='store_true', default=False, | 455 p.add_argument('--skip-cq', action='store_true', default=False, |
| 453 help='Skip sending the CL to the CQ (default: %(default)s)') | 456 help='Skip sending the CL to the CQ (default: %(default)s)') |
| 454 p.add_argument('-v', '--verbose', action='store_true', default=False, | 457 p.add_argument('-v', '--verbose', action='store_true', default=False, |
| 455 help='Be extra verbose in printing of log messages.') | 458 help='Be extra verbose in printing of log messages.') |
| 456 opts = p.parse_args() | 459 opts = p.parse_args() |
| 457 | 460 |
| 458 if opts.verbose: | 461 if opts.verbose: |
| 459 logging.basicConfig(level=logging.DEBUG) | 462 logging.basicConfig(level=logging.DEBUG) |
| 460 else: | 463 else: |
| 461 logging.basicConfig(level=logging.INFO) | 464 logging.basicConfig(level=logging.INFO) |
| 462 | 465 |
| 463 if not _IsTreeClean(): | 466 if not opts.ignore_changes and not _IsTreeClean(): |
| 464 logging.error('Please clean your local checkout first.') | 467 logging.error('Please clean your local checkout first.') |
| 465 return 1 | 468 return 1 |
| 466 | 469 |
| 467 if opts.clean: | 470 if opts.clean: |
| 468 _RemovePreviousRollBranch(opts.dry_run) | 471 _RemovePreviousRollBranch(opts.dry_run) |
| 469 | 472 |
| 470 _EnsureUpdatedMasterBranch(opts.dry_run) | 473 if not opts.ignore_changes: |
| 474 _EnsureUpdatedMasterBranch(opts.dry_run) | |
| 471 | 475 |
| 472 new_cr_rev = opts.revision | 476 new_cr_rev = opts.revision |
| 473 if not new_cr_rev: | 477 if not new_cr_rev: |
| 474 stdout, _ = _RunCommand(['git', 'ls-remote', CHROMIUM_SRC_URL, 'HEAD']) | 478 stdout, _ = _RunCommand(['git', 'ls-remote', CHROMIUM_SRC_URL, 'HEAD']) |
| 475 head_rev = stdout.strip().split('\t')[0] | 479 head_rev = stdout.strip().split('\t')[0] |
| 476 logging.info('No revision specified. Using HEAD: %s', head_rev) | 480 logging.info('No revision specified. Using HEAD: %s', head_rev) |
| 477 new_cr_rev = head_rev | 481 new_cr_rev = head_rev |
| 478 | 482 |
| 479 deps_filename = os.path.join(CHECKOUT_SRC_DIR, 'DEPS') | 483 deps_filename = os.path.join(CHECKOUT_SRC_DIR, 'DEPS') |
| 480 webrtc_deps = ParseLocalDepsFile(deps_filename) | 484 webrtc_deps = ParseLocalDepsFile(deps_filename) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 496 _CreateRollBranch(opts.dry_run) | 500 _CreateRollBranch(opts.dry_run) |
| 497 UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps) | 501 UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps) |
| 498 _LocalCommit(commit_msg, opts.dry_run) | 502 _LocalCommit(commit_msg, opts.dry_run) |
| 499 _UploadCL(opts.dry_run, opts.rietveld_email) | 503 _UploadCL(opts.dry_run, opts.rietveld_email) |
| 500 _SendToCQ(opts.dry_run, opts.skip_cq) | 504 _SendToCQ(opts.dry_run, opts.skip_cq) |
| 501 return 0 | 505 return 0 |
| 502 | 506 |
| 503 | 507 |
| 504 if __name__ == '__main__': | 508 if __name__ == '__main__': |
| 505 sys.exit(main()) | 509 sys.exit(main()) |
| OLD | NEW |