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 webkit 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 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 # Silence the editor. | 75 # Silence the editor. |
76 os.environ['EDITOR'] = 'true' | 76 os.environ['EDITOR'] = 'true' |
77 | 77 |
78 old_branch = scm.GIT.GetBranch(root_dir) | 78 old_branch = scm.GIT.GetBranch(root_dir) |
79 if old_branch == 'webkit_roll': | 79 if old_branch == 'webkit_roll': |
80 parser.error( | 80 parser.error( |
81 'Please delete the branch webkit_roll and move to a different branch') | 81 'Please delete the branch webkit_roll and move to a different branch') |
82 subprocess2.check_output( | 82 subprocess2.check_output( |
83 ['git', 'checkout', '-b', 'webkit_roll', options.upstream]) | 83 ['git', 'checkout', '-b', 'webkit_roll', options.upstream]) |
84 try: | 84 try: |
85 old_rev = process_deps(os.path.join(root_dir, 'DEPS'), new_rev) | 85 old_rev = int(process_deps(os.path.join(root_dir, 'DEPS'), new_rev)) |
86 review_field = 'TBR' if options.commit else 'R' | 86 review_field = 'TBR' if options.commit else 'R' |
87 commit_msg = 'Webkit roll %s:%s\n\n%s=%s\n' % (old_rev, new_rev, | 87 commit_msg = ('Webkit roll %s:%s\n' |
88 review_field, | 88 '\n' |
89 options.reviewers) | 89 'http://trac.webkit.org/log/?' |
| 90 'rev=%s&stop_rev=%s&verbose=on\n' |
| 91 '\n' |
| 92 '%s=%s\n' % (old_rev, new_rev, |
| 93 new_rev, old_rev+1, |
| 94 review_field, |
| 95 options.reviewers)) |
90 subprocess2.check_output(['git', 'commit', '-m', commit_msg, 'DEPS']) | 96 subprocess2.check_output(['git', 'commit', '-m', commit_msg, 'DEPS']) |
91 subprocess2.check_call(['git', 'diff', options.upstream]) | 97 subprocess2.check_call(['git', 'diff', options.upstream]) |
92 upload_cmd = ['git', 'cl', 'upload'] | 98 upload_cmd = ['git', 'cl', 'upload'] |
93 if options.commit: | 99 if options.commit: |
94 upload_cmd.append('--use-commit-queue') | 100 upload_cmd.append('--use-commit-queue') |
95 if options.reviewers: | 101 if options.reviewers: |
96 upload_cmd.append('--send-mail') | 102 upload_cmd.append('--send-mail') |
97 if options.cc: | 103 if options.cc: |
98 upload_cmd.extend(['--cc', options.cc]) | 104 upload_cmd.extend(['--cc', options.cc]) |
99 subprocess2.check_call(upload_cmd) | 105 subprocess2.check_call(upload_cmd) |
100 finally: | 106 finally: |
101 subprocess2.check_output(['git', 'checkout', old_branch]) | 107 subprocess2.check_output(['git', 'checkout', old_branch]) |
102 subprocess2.check_output(['git', 'branch', '-D', 'webkit_roll']) | 108 subprocess2.check_output(['git', 'branch', '-D', 'webkit_roll']) |
103 return 0 | 109 return 0 |
104 | 110 |
105 | 111 |
106 if __name__ == '__main__': | 112 if __name__ == '__main__': |
107 sys.exit(main()) | 113 sys.exit(main()) |
OLD | NEW |