Chromium Code Reviews| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 parser.error('Please delete the branch %s and move to a different branch' | 117 parser.error('Please delete the branch %s and move to a different branch' |
| 118 % new_branch) | 118 % new_branch) |
| 119 | 119 |
| 120 if not options.dry_run: | 120 if not options.dry_run: |
| 121 prnt_subprocess.check_call(['git', 'fetch', 'origin']) | 121 prnt_subprocess.check_call(['git', 'fetch', 'origin']) |
| 122 prnt_subprocess.call(['git', 'svn', 'fetch']) | 122 prnt_subprocess.call(['git', 'svn', 'fetch']) |
| 123 branch_cmd = ['git', 'checkout', '-b', new_branch, options.upstream] | 123 branch_cmd = ['git', 'checkout', '-b', new_branch, options.upstream] |
| 124 if options.force: | 124 if options.force: |
| 125 branch_cmd.append('-f') | 125 branch_cmd.append('-f') |
| 126 prnt_subprocess.check_output(branch_cmd) | 126 prnt_subprocess.check_output(branch_cmd) |
| 127 prnt_subprocess.check_call(['gclient', 'sync']) | |
|
borenet
2014/05/30 13:19:04
Should I add --nohooks here?
M-A Ruel
2014/05/30 14:01:59
If you are going to sync the whole tree, add this
| |
| 127 | 128 |
| 128 try: | 129 try: |
| 129 old_rev = process_deps(os.path.join(root_dir, 'DEPS'), project, new_rev, | 130 old_rev = process_deps(os.path.join(root_dir, 'DEPS'), project, new_rev, |
| 130 options.dry_run) | 131 options.dry_run) |
| 131 print '%s roll %s:%s' % (project.title(), old_rev, new_rev) | 132 print '%s roll %s:%s' % (project.title(), old_rev, new_rev) |
| 132 | 133 |
| 133 review_field = 'TBR' if options.commit else 'R' | 134 review_field = 'TBR' if options.commit else 'R' |
| 134 commit_msg = options.message or '%s roll %s:%s\n' % (project.title(), | 135 commit_msg = options.message or '%s roll %s:%s\n' % (project.title(), |
| 135 old_rev, new_rev) | 136 old_rev, new_rev) |
| 136 commit_msg += '\n%s=%s\n' % (review_field, options.reviewers) | 137 commit_msg += '\n%s=%s\n' % (review_field, options.reviewers) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 152 prnt_subprocess.check_call(upload_cmd) | 153 prnt_subprocess.check_call(upload_cmd) |
| 153 finally: | 154 finally: |
| 154 if not options.dry_run: | 155 if not options.dry_run: |
| 155 prnt_subprocess.check_output(['git', 'checkout', old_branch]) | 156 prnt_subprocess.check_output(['git', 'checkout', old_branch]) |
| 156 prnt_subprocess.check_output(['git', 'branch', '-D', new_branch]) | 157 prnt_subprocess.check_output(['git', 'branch', '-D', new_branch]) |
| 157 return 0 | 158 return 0 |
| 158 | 159 |
| 159 | 160 |
| 160 if __name__ == '__main__': | 161 if __name__ == '__main__': |
| 161 sys.exit(main()) | 162 sys.exit(main()) |
| OLD | NEW |