| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 """ | 441 """ |
| 442 try: | 442 try: |
| 443 args = ['--onto', parent, start, branch] | 443 args = ['--onto', parent, start, branch] |
| 444 if TEST_MODE: | 444 if TEST_MODE: |
| 445 args.insert(0, '--committer-date-is-author-date') | 445 args.insert(0, '--committer-date-is-author-date') |
| 446 run('rebase', *args) | 446 run('rebase', *args) |
| 447 return RebaseRet(True, '') | 447 return RebaseRet(True, '') |
| 448 except subprocess2.CalledProcessError as cpe: | 448 except subprocess2.CalledProcessError as cpe: |
| 449 if abort: | 449 if abort: |
| 450 run('rebase', '--abort') | 450 run('rebase', '--abort') |
| 451 return RebaseRet(False, cpe.output) | 451 return RebaseRet(False, cpe.stdout) |
| 452 | 452 |
| 453 | 453 |
| 454 def remove_merge_base(branch): | 454 def remove_merge_base(branch): |
| 455 del_branch_config(branch, 'base') | 455 del_branch_config(branch, 'base') |
| 456 | 456 |
| 457 | 457 |
| 458 def root(): | 458 def root(): |
| 459 return config('depot-tools.upstream', 'origin/master') | 459 return config('depot-tools.upstream', 'origin/master') |
| 460 | 460 |
| 461 | 461 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 return None | 628 return None |
| 629 return ret | 629 return ret |
| 630 | 630 |
| 631 | 631 |
| 632 def upstream(branch): | 632 def upstream(branch): |
| 633 try: | 633 try: |
| 634 return run('rev-parse', '--abbrev-ref', '--symbolic-full-name', | 634 return run('rev-parse', '--abbrev-ref', '--symbolic-full-name', |
| 635 branch+'@{upstream}') | 635 branch+'@{upstream}') |
| 636 except subprocess2.CalledProcessError: | 636 except subprocess2.CalledProcessError: |
| 637 return None | 637 return None |
| OLD | NEW |