Merge "Use python3 urllib when urllib2 not available"
diff --git a/project.py b/project.py
index 6e8bb03..cdb4ecf 100644
--- a/project.py
+++ b/project.py
@@ -25,7 +25,7 @@
 import time
 
 from color import Coloring
-from git_command import GitCommand
+from git_command import GitCommand, git_require
 from git_config import GitConfig, IsId, GetSchemeFromUrl, ID_RE
 from error import GitError, HookError, UploadError
 from error import ManifestInvalidRevisionError
@@ -1987,6 +1987,9 @@
           raise TypeError('%s() got an unexpected keyword argument %r'
                           % (name, k))
         if config is not None:
+          if not git_require((1, 7, 2)):
+            raise ValueError('cannot set config on command line for %s()'
+                             % name)
           for k, v in config.iteritems():
             cmdv.append('-c')
             cmdv.append('%s=%s' % (k, v))
diff --git a/repo b/repo
index 060ea6d..1b80908 100755
--- a/repo
+++ b/repo
@@ -120,6 +120,7 @@
 import optparse
 import os
 import re
+import stat
 import subprocess
 import sys
 try:
@@ -319,7 +320,7 @@
 
   if not os.path.isdir(gpg_dir):
     try:
-      os.mkdir(gpg_dir, 0700)
+      os.mkdir(gpg_dir, stat.S_IRWXU)
     except OSError as e:
       print >>sys.stderr, \
             'fatal: cannot make %s directory: %s' % (
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 8e9477a..15f69f7 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -44,7 +44,7 @@
 except ImportError:
   multiprocessing = None
 
-from git_command import GIT
+from git_command import GIT, git_require
 from git_refs import R_HEADS, HEAD
 from main import WrapperModule
 from project import Project
@@ -310,7 +310,8 @@
     return fetched
 
   def _GCProjects(self, projects):
-    if multiprocessing:
+    has_dash_c = git_require((1, 7, 2))
+    if multiprocessing and has_dash_c:
       cpu_count = multiprocessing.cpu_count()
     else:
       cpu_count = 1