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

Side by Side Diff: cros_mark_as_stable.py

Issue 3046051: cros_mark_as_stable: modify push to use tracking branch (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: Created 10 years, 4 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/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 18 matching lines...) Expand all
29 empty commit id's.""", 29 empty commit id's.""",
30 short_name='i') 30 short_name='i')
31 gflags.DEFINE_string('packages', '', 31 gflags.DEFINE_string('packages', '',
32 'Space separated list of packages to mark as stable.', 32 'Space separated list of packages to mark as stable.',
33 short_name='p') 33 short_name='p')
34 gflags.DEFINE_string('push_options', '', 34 gflags.DEFINE_string('push_options', '',
35 'Options to use with git-cl push using push command.') 35 'Options to use with git-cl push using push command.')
36 gflags.DEFINE_string('srcroot', '%s/trunk/src' % os.environ['HOME'], 36 gflags.DEFINE_string('srcroot', '%s/trunk/src' % os.environ['HOME'],
37 'Path to root src directory.', 37 'Path to root src directory.',
38 short_name='r') 38 short_name='r')
39 gflags.DEFINE_string('tracking_branch', 'origin', 39 gflags.DEFINE_string('tracking_branch', 'origin',
Nasser Grainawi 2010/08/05 18:39:48 You should really be explicit here and use 'origin
40 'Used with commit to specify branch to track against.', 40 'Used with commit to specify branch to track against.',
41 short_name='t') 41 short_name='t')
42 gflags.DEFINE_boolean('verbose', False, 42 gflags.DEFINE_boolean('verbose', False,
43 'Prints out verbose information about what is going on.', 43 'Prints out verbose information about what is going on.',
44 short_name='v') 44 short_name='v')
45 45
46 46
47 # Takes two strings, package_name and commit_id. 47 # Takes two strings, package_name and commit_id.
48 _GIT_COMMIT_MESSAGE = \ 48 _GIT_COMMIT_MESSAGE = \
49 'Marking 9999 ebuild for %s with commit %s as stable.' 49 'Marking 9999 ebuild for %s with commit %s as stable.'
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 # TODO(sosa) - Add logic for buildbot to check whether other slaves have 124 # TODO(sosa) - Add logic for buildbot to check whether other slaves have
125 # completed and push this change only if they have. 125 # completed and push this change only if they have.
126 126
127 # Sanity check to make sure we're on a stabilizing branch before pushing. 127 # Sanity check to make sure we're on a stabilizing branch before pushing.
128 if not _CheckOnStabilizingBranch(): 128 if not _CheckOnStabilizingBranch():
129 generate_test_report.Die('Expected %s to be on branch "%s"' % 129 generate_test_report.Die('Expected %s to be on branch "%s"' %
130 (os.getcwd(), _STABLE_BRANCH_NAME)) 130 (os.getcwd(), _STABLE_BRANCH_NAME))
131 _RunCommand('git cl upload --desc_from_logs -m "%s"' % 131 _RunCommand('git cl upload --desc_from_logs -m "%s"' %
132 'Marking set of ebuilds as stable') 132 'Marking set of ebuilds as stable')
133 _RunCommand('git remote update') 133 _RunCommand('git remote update')
134 _RunCommand('git rebase origin/master') 134 _RunCommand('git rebase %s' % gflags.FLAGS.tracking_branch)
135 _RunCommand('git cl push %s' % gflags.FLAGS.push_options) 135 _RunCommand('git cl push %s' % gflags.FLAGS.push_options)
136 136
137 137
138 def _RunCommand(command): 138 def _RunCommand(command):
139 """Runs a shell command and returns stdout back to caller.""" 139 """Runs a shell command and returns stdout back to caller."""
140 _Print(' + %s' % command) 140 _Print(' + %s' % command)
141 proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) 141 proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
142 return proc_handle.communicate()[0] 142 return proc_handle.communicate()[0]
143 143
144 144
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 'and reset the git repo yourself.' % 359 'and reset the git repo yourself.' %
360 (package_list[:index], overlay_directory)) 360 (package_list[:index], overlay_directory))
361 raise e 361 raise e
362 elif command == 'push': 362 elif command == 'push':
363 _PushChange() 363 _PushChange()
364 364
365 365
366 if __name__ == '__main__': 366 if __name__ == '__main__':
367 main(sys.argv) 367 main(sys.argv)
368 368
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