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

Side by Side Diff: cros_mark_as_stable.py

Issue 5846005: Simplify and clearify push logic. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Created 10 years 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 | Annotate | Revision Log
« 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/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """This module uprevs a given package's ebuild to the next revision.""" 7 """This module uprevs a given package's ebuild to the next revision."""
8 8
9 9
10 import fileinput 10 import fileinput
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 Info('Not on branch %s so no work found to push. Exiting' % stable_branch) 245 Info('Not on branch %s so no work found to push. Exiting' % stable_branch)
246 return 246 return
247 247
248 description = _SimpleRunCommand('git log --format=format:%s%n%n%b ' + 248 description = _SimpleRunCommand('git log --format=format:%s%n%n%b ' +
249 tracking_branch + '..') 249 tracking_branch + '..')
250 description = 'Marking set of ebuilds as stable\n\n%s' % description 250 description = 'Marking set of ebuilds as stable\n\n%s' % description
251 Info('Using description %s' % description) 251 Info('Using description %s' % description)
252 merge_branch_name = 'merge_branch' 252 merge_branch_name = 'merge_branch'
253 for push_try in range(num_retries + 1): 253 for push_try in range(num_retries + 1):
254 try: 254 try:
255 _SimpleRunCommand('git remote update') 255 _SimpleRunCommand('repo sync .')
256 merge_branch = GitBranch(merge_branch_name, tracking_branch) 256 merge_branch = GitBranch(merge_branch_name, tracking_branch)
257 merge_branch.CreateBranch() 257 merge_branch.CreateBranch()
258 if not merge_branch.Exists(): 258 if not merge_branch.Exists():
259 Die('Unable to create merge branch.') 259 Die('Unable to create merge branch.')
260 _SimpleRunCommand('git merge --squash %s' % stable_branch) 260 _SimpleRunCommand('git merge --squash %s' % stable_branch)
261 _SimpleRunCommand('git commit -m "%s"' % description) 261 _SimpleRunCommand('git commit -m "%s"' % description)
262 _SimpleRunCommand('git config push.default tracking') 262 _SimpleRunCommand('git config push.default tracking')
263 if gflags.FLAGS.dryrun: 263 if gflags.FLAGS.dryrun:
264 _SimpleRunCommand('git push --dry-run') 264 _SimpleRunCommand('git push --dry-run')
265 else: 265 else:
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if gflags.FLAGS.drop_file: 577 if gflags.FLAGS.drop_file:
578 fh = open(gflags.FLAGS.drop_file, 'w') 578 fh = open(gflags.FLAGS.drop_file, 'w')
579 fh.write(' '.join(revved_packages)) 579 fh.write(' '.join(revved_packages))
580 fh.close() 580 fh.close()
581 else: 581 else:
582 work_branch.Delete() 582 work_branch.Delete()
583 583
584 584
585 if __name__ == '__main__': 585 if __name__ == '__main__':
586 main(sys.argv) 586 main(sys.argv)
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