OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Generate a CL to roll webkit to the specified revision number and post | 6 """Generate a CL to roll Blink to the specified revision number and post |
7 it to Rietveld so that the CL will land automatically if it passes the | 7 it to Rietveld so that the CL will land automatically if it passes the |
8 commit-queue's checks. | 8 commit-queue's checks. |
9 """ | 9 """ |
10 | 10 |
11 import logging | 11 import logging |
12 import optparse | 12 import optparse |
13 import os | 13 import os |
14 import re | 14 import re |
15 import sys | 15 import sys |
16 | 16 |
(...skipping 20 matching lines...) Expand all Loading... |
37 if not old_rev or new_content == content: | 37 if not old_rev or new_content == content: |
38 die_with_error('Failed to update the DEPS file') | 38 die_with_error('Failed to update the DEPS file') |
39 | 39 |
40 if not is_dry_run: | 40 if not is_dry_run: |
41 open(path, 'w').write(new_content) | 41 open(path, 'w').write(new_content) |
42 return old_rev | 42 return old_rev |
43 | 43 |
44 | 44 |
45 def main(): | 45 def main(): |
46 tool_dir = os.path.dirname(os.path.abspath(__file__)) | 46 tool_dir = os.path.dirname(os.path.abspath(__file__)) |
47 parser = optparse.OptionParser(usage='%prog [options] <new webkit rev>') | 47 parser = optparse.OptionParser(usage='%prog [options] <new blink rev>') |
48 parser.add_option('-v', '--verbose', action='count', default=0) | 48 parser.add_option('-v', '--verbose', action='count', default=0) |
49 parser.add_option('--dry-run', action='store_true') | 49 parser.add_option('--dry-run', action='store_true') |
50 parser.add_option('--commit', action='store_true', default=True, | 50 parser.add_option('--commit', action='store_true', default=True, |
51 help='(default) Put change in commit queue on upload.') | 51 help='(default) Put change in commit queue on upload.') |
52 parser.add_option('--no-commit', action='store_false', dest='commit', | 52 parser.add_option('--no-commit', action='store_false', dest='commit', |
53 help='Don\'t put change in commit queue on upload.') | 53 help='Don\'t put change in commit queue on upload.') |
54 parser.add_option('-r', '--reviewers', default='', | 54 parser.add_option('-r', '--reviewers', default='', |
55 help='Add given users as either reviewers or TBR as' | 55 help='Add given users as either reviewers or TBR as' |
56 ' appropriate.') | 56 ' appropriate.') |
57 parser.add_option('--upstream', default='origin/master', | 57 parser.add_option('--upstream', default='origin/master', |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 subprocess2.check_call(upload_cmd) | 118 subprocess2.check_call(upload_cmd) |
119 finally: | 119 finally: |
120 if not options.dry_run: | 120 if not options.dry_run: |
121 subprocess2.check_output(['git', 'checkout', old_branch]) | 121 subprocess2.check_output(['git', 'checkout', old_branch]) |
122 subprocess2.check_output(['git', 'branch', '-D', 'blink_roll']) | 122 subprocess2.check_output(['git', 'branch', '-D', 'blink_roll']) |
123 return 0 | 123 return 0 |
124 | 124 |
125 | 125 |
126 if __name__ == '__main__': | 126 if __name__ == '__main__': |
127 sys.exit(main()) | 127 sys.exit(main()) |
OLD | NEW |