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 12 matching lines...) Expand all Loading... |
23 import os | 23 import os |
24 import re | 24 import re |
25 import signal | 25 import signal |
26 import sys | 26 import sys |
27 import tempfile | 27 import tempfile |
28 import textwrap | 28 import textwrap |
29 import threading | 29 import threading |
30 | 30 |
31 import subprocess2 | 31 import subprocess2 |
32 | 32 |
| 33 ROOT = os.path.abspath(os.path.dirname(__file__)) |
33 | 34 |
34 GIT_EXE = 'git.bat' if sys.platform.startswith('win') else 'git' | 35 GIT_EXE = ROOT+'\\git.bat' if sys.platform.startswith('win') else 'git' |
35 TEST_MODE = False | 36 TEST_MODE = False |
36 | 37 |
37 FREEZE = 'FREEZE' | 38 FREEZE = 'FREEZE' |
38 FREEZE_SECTIONS = { | 39 FREEZE_SECTIONS = { |
39 'indexed': 'soft', | 40 'indexed': 'soft', |
40 'unindexed': 'mixed' | 41 'unindexed': 'mixed' |
41 } | 42 } |
42 FREEZE_MATCHER = re.compile(r'%s.(%s)' % (FREEZE, '|'.join(FREEZE_SECTIONS))) | 43 FREEZE_MATCHER = re.compile(r'%s.(%s)' % (FREEZE, '|'.join(FREEZE_SECTIONS))) |
43 | 44 |
44 | 45 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 return None | 709 return None |
709 return ret | 710 return ret |
710 | 711 |
711 | 712 |
712 def upstream(branch): | 713 def upstream(branch): |
713 try: | 714 try: |
714 return run('rev-parse', '--abbrev-ref', '--symbolic-full-name', | 715 return run('rev-parse', '--abbrev-ref', '--symbolic-full-name', |
715 branch+'@{upstream}') | 716 branch+'@{upstream}') |
716 except subprocess2.CalledProcessError: | 717 except subprocess2.CalledProcessError: |
717 return None | 718 return None |
OLD | NEW |