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

Side by Side Diff: tools/safely-roll-deps.py

Issue 231623003: AutoRoll bot: check_call -> call (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 os.chdir(root_dir) 81 os.chdir(root_dir)
82 82
83 project = args[0] 83 project = args[0]
84 new_rev = int(args[1]) 84 new_rev = int(args[1])
85 85
86 # Silence the editor. 86 # Silence the editor.
87 os.environ['EDITOR'] = 'true' 87 os.environ['EDITOR'] = 'true'
88 88
89 if options.force and not options.dry_run: 89 if options.force and not options.dry_run:
90 subprocess2.check_call(['git', 'clean', '-d', '-f']) 90 subprocess2.check_call(['git', 'clean', '-d', '-f'])
91 subprocess2.check_call(['git', 'rebase', '--abort']) 91 subprocess2.call(['git', 'rebase', '--abort'])
92 92
93 old_branch = scm.GIT.GetBranch(root_dir) 93 old_branch = scm.GIT.GetBranch(root_dir)
94 new_branch = '%s_roll' % project 94 new_branch = '%s_roll' % project
95 95
96 if options.upstream == new_branch: 96 if options.upstream == new_branch:
97 parser.error('Cannot set %s as its own upstream.' % new_branch) 97 parser.error('Cannot set %s as its own upstream.' % new_branch)
98 98
99 if old_branch == new_branch: 99 if old_branch == new_branch:
100 if options.force: 100 if options.force:
101 if not options.dry_run: 101 if not options.dry_run:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 subprocess2.check_call(upload_cmd) 139 subprocess2.check_call(upload_cmd)
140 finally: 140 finally:
141 if not options.dry_run: 141 if not options.dry_run:
142 subprocess2.check_output(['git', 'checkout', old_branch]) 142 subprocess2.check_output(['git', 'checkout', old_branch])
143 subprocess2.check_output(['git', 'branch', '-D', new_branch]) 143 subprocess2.check_output(['git', 'branch', '-D', new_branch])
144 return 0 144 return 0
145 145
146 146
147 if __name__ == '__main__': 147 if __name__ == '__main__':
148 sys.exit(main()) 148 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