| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. | 5 # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. |
| 6 # Derived from https://gist.github.com/aljungberg/626518 | 6 # Derived from https://gist.github.com/aljungberg/626518 |
| 7 import multiprocessing.pool | 7 import multiprocessing.pool |
| 8 from multiprocessing.pool import IMapIterator | 8 from multiprocessing.pool import IMapIterator |
| 9 def wrapper(func): | 9 def wrapper(func): |
| 10 def wrap(self, timeout=None): | 10 def wrap(self, timeout=None): |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 rebase. | 518 rebase. |
| 519 """ | 519 """ |
| 520 try: | 520 try: |
| 521 args = ['--onto', parent, start, branch] | 521 args = ['--onto', parent, start, branch] |
| 522 if TEST_MODE: | 522 if TEST_MODE: |
| 523 args.insert(0, '--committer-date-is-author-date') | 523 args.insert(0, '--committer-date-is-author-date') |
| 524 run('rebase', *args) | 524 run('rebase', *args) |
| 525 return RebaseRet(True, '', '') | 525 return RebaseRet(True, '', '') |
| 526 except subprocess2.CalledProcessError as cpe: | 526 except subprocess2.CalledProcessError as cpe: |
| 527 if abort: | 527 if abort: |
| 528 run('rebase', '--abort') | 528 run_with_retcode('rebase', '--abort') # ignore failure |
| 529 return RebaseRet(False, cpe.stdout, cpe.stderr) | 529 return RebaseRet(False, cpe.stdout, cpe.stderr) |
| 530 | 530 |
| 531 | 531 |
| 532 def remove_merge_base(branch): | 532 def remove_merge_base(branch): |
| 533 del_branch_config(branch, 'base') | 533 del_branch_config(branch, 'base') |
| 534 del_branch_config(branch, 'base-upstream') | 534 del_branch_config(branch, 'base-upstream') |
| 535 | 535 |
| 536 | 536 |
| 537 def root(): | 537 def root(): |
| 538 return config('depot-tools.upstream', 'origin/master') | 538 return config('depot-tools.upstream', 'origin/master') |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) | 787 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) |
| 788 | 788 |
| 789 # Set None for upstreams which are not branches (e.g empty upstream, remotes | 789 # Set None for upstreams which are not branches (e.g empty upstream, remotes |
| 790 # and deleted upstream branches). | 790 # and deleted upstream branches). |
| 791 missing_upstreams = {} | 791 missing_upstreams = {} |
| 792 for info in info_map.values(): | 792 for info in info_map.values(): |
| 793 if info.upstream not in info_map and info.upstream not in missing_upstreams: | 793 if info.upstream not in info_map and info.upstream not in missing_upstreams: |
| 794 missing_upstreams[info.upstream] = None | 794 missing_upstreams[info.upstream] = None |
| 795 | 795 |
| 796 return dict(info_map.items() + missing_upstreams.items()) | 796 return dict(info_map.items() + missing_upstreams.items()) |
| OLD | NEW |