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

Side by Side Diff: recipe_modules/bot_update/resources/bot_update.py

Issue 2331103002: Revert of Skip apply_gerrit rebase when there is a rebase failure (Closed)
Patch Set: Created 4 years, 3 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 # TODO(hinoka): Use logging. 6 # TODO(hinoka): Use logging.
7 7
8 import cStringIO 8 import cStringIO
9 import codecs 9 import codecs
10 import collections 10 import collections
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 git('retry', 'fetch', gerrit_repo, gerrit_ref, cwd=root, tries=1) 597 git('retry', 'fetch', gerrit_repo, gerrit_ref, cwd=root, tries=1)
598 git('checkout', 'FETCH_HEAD', cwd=root) 598 git('checkout', 'FETCH_HEAD', cwd=root)
599 599
600 if gerrit_rebase_patch_ref: 600 if gerrit_rebase_patch_ref:
601 print '===Rebasing===' 601 print '===Rebasing==='
602 # git rebase requires a branch to operate on. 602 # git rebase requires a branch to operate on.
603 temp_branch_name = 'tmp/' + uuid.uuid4().hex 603 temp_branch_name = 'tmp/' + uuid.uuid4().hex
604 try: 604 try:
605 ok = False 605 ok = False
606 git('checkout', '-b', temp_branch_name, cwd=root) 606 git('checkout', '-b', temp_branch_name, cwd=root)
607 try: 607 git('rebase', base_rev, cwd=root)
608 git('rebase', base_rev, cwd=root)
609 finally:
610 # Abort the rebase since there were failures.
611 git('rebase', '--abort', cwd=root)
612 608
613 # Get off of the temporary branch since it can't be deleted otherwise. 609 # Get off of the temporary branch since it can't be deleted otherwise.
614 cur_rev = git('rev-parse', 'HEAD', cwd=root).strip() 610 cur_rev = git('rev-parse', 'HEAD', cwd=root).strip()
615 git('checkout', cur_rev, cwd=root) 611 git('checkout', cur_rev, cwd=root)
616 git('branch', '-D', temp_branch_name, cwd=root) 612 git('branch', '-D', temp_branch_name, cwd=root)
617 ok = True 613 ok = True
618 finally: 614 finally:
619 if not ok: 615 if not ok:
620 # Get off of the temporary branch since it can't be deleted otherwise. 616 # Get off of the temporary branch since it can't be deleted otherwise.
621 git('checkout', base_rev, cwd=root) 617 git('checkout', base_rev, cwd=root)
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 # download patch failure is still an infra problem. 1060 # download patch failure is still an infra problem.
1065 if e.code == 3: 1061 if e.code == 3:
1066 # Patch download problem. 1062 # Patch download problem.
1067 return 87 1063 return 87
1068 # Genuine patch problem. 1064 # Genuine patch problem.
1069 return 88 1065 return 88
1070 1066
1071 1067
1072 if __name__ == '__main__': 1068 if __name__ == '__main__':
1073 sys.exit(main()) 1069 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