Chromium Code Reviews| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 r'TLS packet with unexpected length was received', | 79 r'TLS packet with unexpected length was received', |
| 80 | 80 |
| 81 # crbug.com/187444 | 81 # crbug.com/187444 |
| 82 r'RPC failed; result=\d+, HTTP code = \d+', | 82 r'RPC failed; result=\d+, HTTP code = \d+', |
| 83 | 83 |
| 84 # crbug.com/315421 | 84 # crbug.com/315421 |
| 85 r'The requested URL returned error: 500 while accessing', | 85 r'The requested URL returned error: 500 while accessing', |
| 86 | 86 |
| 87 # crbug.com/388876 | 87 # crbug.com/388876 |
| 88 r'Connection timed out', | 88 r'Connection timed out', |
| 89 | |
| 90 # crbug.com/430343 | |
| 91 r'The requested URL returned error: 502', | |
|
David James
2014/11/05 06:30:15
Can you merge this with the one above, like this?
| |
| 89 ) | 92 ) |
| 90 | 93 |
| 91 GIT_TRANSIENT_ERRORS_RE = re.compile('|'.join(GIT_TRANSIENT_ERRORS), | 94 GIT_TRANSIENT_ERRORS_RE = re.compile('|'.join(GIT_TRANSIENT_ERRORS), |
| 92 re.IGNORECASE) | 95 re.IGNORECASE) |
| 93 | 96 |
| 94 # First version where the for-each-ref command's format string supported the | 97 # First version where the for-each-ref command's format string supported the |
| 95 # upstream:track token. | 98 # upstream:track token. |
| 96 MIN_UPSTREAM_TRACK_GIT_VERSION = (1, 9) | 99 MIN_UPSTREAM_TRACK_GIT_VERSION = (1, 9) |
| 97 | 100 |
| 98 class BadCommitRefException(Exception): | 101 class BadCommitRefException(Exception): |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) | 764 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) |
| 762 | 765 |
| 763 # Set None for upstreams which are not branches (e.g empty upstream, remotes | 766 # Set None for upstreams which are not branches (e.g empty upstream, remotes |
| 764 # and deleted upstream branches). | 767 # and deleted upstream branches). |
| 765 missing_upstreams = {} | 768 missing_upstreams = {} |
| 766 for info in info_map.values(): | 769 for info in info_map.values(): |
| 767 if info.upstream not in info_map and info.upstream not in missing_upstreams: | 770 if info.upstream not in info_map and info.upstream not in missing_upstreams: |
| 768 missing_upstreams[info.upstream] = None | 771 missing_upstreams[info.upstream] = None |
| 769 | 772 |
| 770 return dict(info_map.items() + missing_upstreams.items()) | 773 return dict(info_map.items() + missing_upstreams.items()) |
| OLD | NEW |