| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 # Retry a git operation if git returns a error response with any of these | 46 # Retry a git operation if git returns a error response with any of these |
| 47 # messages. It's all observed 'bad' GoB responses so far. | 47 # messages. It's all observed 'bad' GoB responses so far. |
| 48 # | 48 # |
| 49 # This list is inspired/derived from the one in ChromiumOS's Chromite: | 49 # This list is inspired/derived from the one in ChromiumOS's Chromite: |
| 50 # <CHROMITE>/lib/git.py::GIT_TRANSIENT_ERRORS | 50 # <CHROMITE>/lib/git.py::GIT_TRANSIENT_ERRORS |
| 51 # | 51 # |
| 52 # It was last imported from '7add3ac29564d98ac35ce426bc295e743e7c0c02'. | 52 # It was last imported from '7add3ac29564d98ac35ce426bc295e743e7c0c02'. |
| 53 GIT_TRANSIENT_ERRORS = ( | 53 GIT_TRANSIENT_ERRORS = ( |
| 54 # crbug.com/285832 | 54 # crbug.com/285832 |
| 55 r'! \[remote rejected\].*\(error in hook\)', | 55 r'!.*\[remote rejected\].*\(error in hook\)', |
| 56 | 56 |
| 57 # crbug.com/289932 | 57 # crbug.com/289932 |
| 58 r'! \[remote rejected\].*\(failed to lock\)', | 58 r'!.*\[remote rejected\].*\(failed to lock\)', |
| 59 | 59 |
| 60 # crbug.com/307156 | 60 # crbug.com/307156 |
| 61 r'! \[remote rejected\].*\(error in Gerrit backend\)', | 61 r'!.*\[remote rejected\].*\(error in Gerrit backend\)', |
| 62 | 62 |
| 63 # crbug.com/285832 | 63 # crbug.com/285832 |
| 64 r'remote error: Internal Server Error', | 64 r'remote error: Internal Server Error', |
| 65 | 65 |
| 66 # crbug.com/294449 | 66 # crbug.com/294449 |
| 67 r'fatal: Couldn\'t find remote ref ', | 67 r'fatal: Couldn\'t find remote ref ', |
| 68 | 68 |
| 69 # crbug.com/220543 | 69 # crbug.com/220543 |
| 70 r'git fetch_pack: expected ACK/NAK, got', | 70 r'git fetch_pack: expected ACK/NAK, got', |
| 71 | 71 |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 return None | 709 return None |
| 710 return ret | 710 return ret |
| 711 | 711 |
| 712 | 712 |
| 713 def upstream(branch): | 713 def upstream(branch): |
| 714 try: | 714 try: |
| 715 return run('rev-parse', '--abbrev-ref', '--symbolic-full-name', | 715 return run('rev-parse', '--abbrev-ref', '--symbolic-full-name', |
| 716 branch+'@{upstream}') | 716 branch+'@{upstream}') |
| 717 except subprocess2.CalledProcessError: | 717 except subprocess2.CalledProcessError: |
| 718 return None | 718 return None |
| OLD | NEW |