| OLD | NEW |
| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 Info('Not on branch %s so no work found to push. Exiting' % stable_branch) | 243 Info('Not on branch %s so no work found to push. Exiting' % stable_branch) |
| 244 return | 244 return |
| 245 | 245 |
| 246 description = _SimpleRunCommand('git log --format=format:%s%n%n%b ' + | 246 description = _SimpleRunCommand('git log --format=format:%s%n%n%b ' + |
| 247 tracking_branch) | 247 tracking_branch) |
| 248 description = 'Marking set of ebuilds as stable\n\n%s' % description | 248 description = 'Marking set of ebuilds as stable\n\n%s' % description |
| 249 merge_branch_name = 'merge_branch' | 249 merge_branch_name = 'merge_branch' |
| 250 for push_try in range(num_retries + 1): | 250 for push_try in range(num_retries + 1): |
| 251 try: | 251 try: |
| 252 _SimpleRunCommand('git remote update') | 252 _SimpleRunCommand('git remote update') |
| 253 merge_branch = _GitBranch(merge_branch_name) | 253 merge_branch = GitBranch(merge_branch_name) |
| 254 merge_branch.CreateBranch() | 254 merge_branch.CreateBranch() |
| 255 if not merge_branch.Exists(): | 255 if not merge_branch.Exists(): |
| 256 Die('Unable to create merge branch.') | 256 Die('Unable to create merge branch.') |
| 257 _SimpleRunCommand('git merge --squash %s' % _STABLE_BRANCH_NAME) | 257 _SimpleRunCommand('git merge --squash %s' % _STABLE_BRANCH_NAME) |
| 258 _SimpleRunCommand('git commit -m "%s"' % description) | 258 _SimpleRunCommand('git commit -m "%s"' % description) |
| 259 # Ugh. There has got to be an easier way to push to a tracking branch | 259 # Ugh. There has got to be an easier way to push to a tracking branch |
| 260 _SimpleRunCommand('git config push.default tracking') | 260 _SimpleRunCommand('git config push.default tracking') |
| 261 _SimpleRunCommand('git push') | 261 _SimpleRunCommand('git push') |
| 262 break | 262 break |
| 263 except: | 263 except: |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 raise | 562 raise |
| 563 | 563 |
| 564 if revved_packages: | 564 if revved_packages: |
| 565 _CleanStalePackages(gflags.FLAGS.board, revved_packages) | 565 _CleanStalePackages(gflags.FLAGS.board, revved_packages) |
| 566 else: | 566 else: |
| 567 work_branch.Delete() | 567 work_branch.Delete() |
| 568 | 568 |
| 569 | 569 |
| 570 if __name__ == '__main__': | 570 if __name__ == '__main__': |
| 571 main(sys.argv) | 571 main(sys.argv) |
| OLD | NEW |