diff options
-rw-r--r-- | project.py | 5 | ||||
-rwxr-xr-x | repo | 3 | ||||
-rw-r--r-- | subcmds/sync.py | 5 |
3 files changed, 9 insertions, 4 deletions
@@ -25,7 +25,7 @@ import sys | |||
25 | import time | 25 | import time |
26 | 26 | ||
27 | from color import Coloring | 27 | from color import Coloring |
28 | from git_command import GitCommand | 28 | from git_command import GitCommand, git_require |
29 | from git_config import GitConfig, IsId, GetSchemeFromUrl, ID_RE | 29 | from git_config import GitConfig, IsId, GetSchemeFromUrl, ID_RE |
30 | from error import GitError, HookError, UploadError | 30 | from error import GitError, HookError, UploadError |
31 | from error import ManifestInvalidRevisionError | 31 | from 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)) |
@@ -120,6 +120,7 @@ REPO_MAIN = S_repo + '/main.py' # main script | |||
120 | import optparse | 120 | import optparse |
121 | import os | 121 | import os |
122 | import re | 122 | import re |
123 | import stat | ||
123 | import subprocess | 124 | import subprocess |
124 | import sys | 125 | import sys |
125 | try: | 126 | try: |
@@ -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: | |||
44 | except ImportError: | 44 | except ImportError: |
45 | multiprocessing = None | 45 | multiprocessing = None |
46 | 46 | ||
47 | from git_command import GIT | 47 | from git_command import GIT, git_require |
48 | from git_refs import R_HEADS, HEAD | 48 | from git_refs import R_HEADS, HEAD |
49 | from main import WrapperModule | 49 | from main import WrapperModule |
50 | from project import Project | 50 | from 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 |