Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: tools/autoroller/roll_chromium_revision.py

Issue 1383203002: autoroller: Allow to specify Rietveld e-mail. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Oops forgot to pass the variable Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 _RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) 342 _RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME])
343 343
344 344
345 def _LocalCommit(commit_msg, dry_run): 345 def _LocalCommit(commit_msg, dry_run):
346 logging.info('Committing changes locally.') 346 logging.info('Committing changes locally.')
347 if not dry_run: 347 if not dry_run:
348 _RunCommand(['git', 'add', '--update', '.']) 348 _RunCommand(['git', 'add', '--update', '.'])
349 _RunCommand(['git', 'commit', '-m', commit_msg]) 349 _RunCommand(['git', 'commit', '-m', commit_msg])
350 350
351 351
352 def _UploadCL(dry_run): 352 def _UploadCL(dry_run, rietveld_email=None):
353 logging.info('Uploading CL...') 353 logging.info('Uploading CL...')
354 if not dry_run: 354 if not dry_run:
355 _RunCommand(['git', 'cl', 'upload'], extra_env={'EDITOR': 'true'}) 355 cmd = ['git', 'cl', 'upload', '-f']
356 if rietveld_email:
357 cmd.append('--email=%s' % rietveld_email)
358 _RunCommand(cmd, extra_env={'EDITOR': 'true'})
356 359
357 360
358 def _LaunchTrybots(dry_run, skip_try): 361 def _LaunchTrybots(dry_run, skip_try):
359 logging.info('Sending tryjobs...') 362 logging.info('Sending tryjobs...')
360 if not dry_run and not skip_try: 363 if not dry_run and not skip_try:
361 _RunCommand(['git', 'cl', 'try']) 364 _RunCommand(['git', 'cl', 'try'])
362 365
363 366
364 def _SendToCQ(dry_run, skip_cq): 367 def _SendToCQ(dry_run, skip_cq):
365 logging.info('Sending the CL to the CQ...') 368 logging.info('Sending the CL to the CQ...')
366 if not dry_run and not skip_cq: 369 if not dry_run and not skip_cq:
367 _RunCommand(['git', 'cl', 'set_commit']) 370 _RunCommand(['git', 'cl', 'set_commit'])
368 logging.info('Sent the CL to the CQ.') 371 logging.info('Sent the CL to the CQ.')
369 372
370 373
371 def main(): 374 def main():
372 p = argparse.ArgumentParser() 375 p = argparse.ArgumentParser()
373 p.add_argument('--clean', action='store_true', default=False, 376 p.add_argument('--clean', action='store_true', default=False,
374 help='Removes any previous local roll branch.') 377 help='Removes any previous local roll branch.')
375 p.add_argument('-r', '--revision', 378 p.add_argument('-r', '--revision',
376 help=('Chromium Git revision to roll to. Defaults to the ' 379 help=('Chromium Git revision to roll to. Defaults to the '
377 'Chromium HEAD revision if omitted.')) 380 'Chromium HEAD revision if omitted.'))
381 p.add_argument('-u', '--rietveld-email',
382 help=('E-mail address to use for creating the CL at Rietveld'
383 'If omitted a previously cached one will be used or an '
384 'error will be thrown during upload.'))
378 p.add_argument('--dry-run', action='store_true', default=False, 385 p.add_argument('--dry-run', action='store_true', default=False,
379 help=('Calculate changes and modify DEPS, but don\'t create ' 386 help=('Calculate changes and modify DEPS, but don\'t create '
380 'any local branch, commit, upload CL or send any ' 387 'any local branch, commit, upload CL or send any '
381 'tryjobs.')) 388 'tryjobs.'))
382 p.add_argument('--allow-reverse', action='store_true', default=False, 389 p.add_argument('--allow-reverse', action='store_true', default=False,
383 help=('Allow rolling back in time (disabled by default but ' 390 help=('Allow rolling back in time (disabled by default but '
384 'may be useful to be able do to manually).')) 391 'may be useful to be able do to manually).'))
385 p.add_argument('-s', '--skip-try', action='store_true', default=False, 392 p.add_argument('-s', '--skip-try', action='store_true', default=False,
386 help='Skip sending tryjobs (default: %(default)s)') 393 help='Skip sending tryjobs (default: %(default)s)')
387 p.add_argument('--skip-cq', action='store_true', default=False, 394 p.add_argument('--skip-cq', action='store_true', default=False,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 logging.info('Currently pinned chromium_revision: %s (#%s) is newer than ' 439 logging.info('Currently pinned chromium_revision: %s (#%s) is newer than '
433 '%s (#%s). To roll to older revisions, you must pass the ' 440 '%s (#%s). To roll to older revisions, you must pass the '
434 '--allow-reverse flag.\n' 441 '--allow-reverse flag.\n'
435 'Aborting without action.', current_cr_rev, current_commit_pos, 442 'Aborting without action.', current_cr_rev, current_commit_pos,
436 new_cr_rev, new_commit_pos) 443 new_cr_rev, new_commit_pos)
437 return 0 444 return 0
438 445
439 _CreateRollBranch(opts.dry_run) 446 _CreateRollBranch(opts.dry_run)
440 UpdateDeps(deps_filename, current_cr_rev, new_cr_rev) 447 UpdateDeps(deps_filename, current_cr_rev, new_cr_rev)
441 _LocalCommit(commit_msg, opts.dry_run) 448 _LocalCommit(commit_msg, opts.dry_run)
442 _UploadCL(opts.dry_run) 449 _UploadCL(opts.dry_run, opts.rietveld_email)
443 _LaunchTrybots(opts.dry_run, opts.skip_try) 450 _LaunchTrybots(opts.dry_run, opts.skip_try)
444 _SendToCQ(opts.dry_run, opts.skip_cq) 451 _SendToCQ(opts.dry_run, opts.skip_cq)
445 return 0 452 return 0
446 453
447 454
448 if __name__ == '__main__': 455 if __name__ == '__main__':
449 sys.exit(main()) 456 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698