Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Side by Side Diff: git_common.py

Issue 471413003: Discover git.bat even if git_cl.py is executed using relative path (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698