| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 a DEPS entry to the specified revision number and post | 6 """Generate a CL to roll a DEPS entry 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 old_rev, new_rev) | 135 old_rev, new_rev) |
| 136 commit_msg += '\n%s=%s\n' % (review_field, options.reviewers) | 136 commit_msg += '\n%s=%s\n' % (review_field, options.reviewers) |
| 137 | 137 |
| 138 if options.dry_run: | 138 if options.dry_run: |
| 139 print 'Commit message: ' + commit_msg | 139 print 'Commit message: ' + commit_msg |
| 140 return 0 | 140 return 0 |
| 141 | 141 |
| 142 prnt_subprocess.check_output(['git', 'commit', '-m', commit_msg, 'DEPS']) | 142 prnt_subprocess.check_output(['git', 'commit', '-m', commit_msg, 'DEPS']) |
| 143 prnt_subprocess.check_call(['git', 'diff', '--no-ext-diff', | 143 prnt_subprocess.check_call(['git', 'diff', '--no-ext-diff', |
| 144 options.upstream]) | 144 options.upstream]) |
| 145 upload_cmd = ['git', 'cl', 'upload'] | 145 upload_cmd = ['git', 'cl', 'upload', '--bypass-hooks'] |
| 146 if options.commit: | 146 if options.commit: |
| 147 upload_cmd.append('--use-commit-queue') | 147 upload_cmd.append('--use-commit-queue') |
| 148 if options.reviewers: | 148 if options.reviewers: |
| 149 upload_cmd.append('--send-mail') | 149 upload_cmd.append('--send-mail') |
| 150 if options.cc: | 150 if options.cc: |
| 151 upload_cmd.extend(['--cc', options.cc]) | 151 upload_cmd.extend(['--cc', options.cc]) |
| 152 prnt_subprocess.check_call(upload_cmd) | 152 prnt_subprocess.check_call(upload_cmd) |
| 153 finally: | 153 finally: |
| 154 if not options.dry_run: | 154 if not options.dry_run: |
| 155 prnt_subprocess.check_output(['git', 'checkout', old_branch]) | 155 prnt_subprocess.check_output(['git', 'checkout', old_branch]) |
| 156 prnt_subprocess.check_output(['git', 'branch', '-D', new_branch]) | 156 prnt_subprocess.check_output(['git', 'branch', '-D', new_branch]) |
| 157 return 0 | 157 return 0 |
| 158 | 158 |
| 159 | 159 |
| 160 if __name__ == '__main__': | 160 if __name__ == '__main__': |
| 161 sys.exit(main()) | 161 sys.exit(main()) |
| OLD | NEW |