summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py5
-rwxr-xr-xrepo3
-rw-r--r--subcmds/sync.py5
3 files changed, 9 insertions, 4 deletions
diff --git a/project.py b/project.py
index 6e8bb032..cdb4ecfd 100644
--- a/project.py
+++ b/project.py
@@ -25,7 +25,7 @@ import sys
25import time 25import time
26 26
27from color import Coloring 27from color import Coloring
28from git_command import GitCommand 28from git_command import GitCommand, git_require
29from git_config import GitConfig, IsId, GetSchemeFromUrl, ID_RE 29from git_config import GitConfig, IsId, GetSchemeFromUrl, ID_RE
30from error import GitError, HookError, UploadError 30from error import GitError, HookError, UploadError
31from error import ManifestInvalidRevisionError 31from error import ManifestInvalidRevisionError
@@ -1987,6 +1987,9 @@ class Project(object):
1987 raise TypeError('%s() got an unexpected keyword argument %r' 1987 raise TypeError('%s() got an unexpected keyword argument %r'
1988 % (name, k)) 1988 % (name, k))
1989 if config is not None: 1989 if config is not None:
1990 if not git_require((1, 7, 2)):
1991 raise ValueError('cannot set config on command line for %s()'
1992 % name)
1990 for k, v in config.iteritems(): 1993 for k, v in config.iteritems():
1991 cmdv.append('-c') 1994 cmdv.append('-c')
1992 cmdv.append('%s=%s' % (k, v)) 1995 cmdv.append('%s=%s' % (k, v))
diff --git a/repo b/repo
index 060ea6d1..1b809087 100755
--- a/repo
+++ b/repo
@@ -120,6 +120,7 @@ REPO_MAIN = S_repo + '/main.py' # main script
120import optparse 120import optparse
121import os 121import os
122import re 122import re
123import stat
123import subprocess 124import subprocess
124import sys 125import sys
125try: 126try:
@@ -319,7 +320,7 @@ def SetupGnuPG(quiet):
319 320
320 if not os.path.isdir(gpg_dir): 321 if not os.path.isdir(gpg_dir):
321 try: 322 try:
322 os.mkdir(gpg_dir, 0700) 323 os.mkdir(gpg_dir, stat.S_IRWXU)
323 except OSError as e: 324 except OSError as e:
324 print >>sys.stderr, \ 325 print >>sys.stderr, \
325 'fatal: cannot make %s directory: %s' % ( 326 'fatal: cannot make %s directory: %s' % (
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 8e9477a3..15f69f7b 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -44,7 +44,7 @@ try:
44except ImportError: 44except ImportError:
45 multiprocessing = None 45 multiprocessing = None
46 46
47from git_command import GIT 47from git_command import GIT, git_require
48from git_refs import R_HEADS, HEAD 48from git_refs import R_HEADS, HEAD
49from main import WrapperModule 49from main import WrapperModule
50from project import Project 50from project import Project
@@ -310,7 +310,8 @@ later is required to fix a server side protocol bug.
310 return fetched 310 return fetched
311 311
312 def _GCProjects(self, projects): 312 def _GCProjects(self, projects):
313 if multiprocessing: 313 has_dash_c = git_require((1, 7, 2))
314 if multiprocessing and has_dash_c:
314 cpu_count = multiprocessing.cpu_count() 315 cpu_count = multiprocessing.cpu_count()
315 else: 316 else:
316 cpu_count = 1 317 cpu_count = 1