diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -41,7 +41,7 @@ from error import ManifestInvalidRevisionError, ManifestInvalidPathError | |||
41 | from error import NoManifestException, ManifestParseError | 41 | from error import NoManifestException, ManifestParseError |
42 | import platform_utils | 42 | import platform_utils |
43 | import progress | 43 | import progress |
44 | from repo_trace import Trace | 44 | from repo_trace import IsTrace, Trace |
45 | 45 | ||
46 | from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M, R_WORKTREE_M | 46 | from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M, R_WORKTREE_M |
47 | 47 | ||
@@ -59,7 +59,7 @@ MAXIMUM_RETRY_SLEEP_SEC = 3600.0 | |||
59 | # +-10% random jitter is added to each Fetches retry sleep duration. | 59 | # +-10% random jitter is added to each Fetches retry sleep duration. |
60 | RETRY_JITTER_PERCENT = 0.1 | 60 | RETRY_JITTER_PERCENT = 0.1 |
61 | 61 | ||
62 | # Whether to use alternates. Switching back and forth is *NOT* supported. | 62 | # Whether to use alternates. |
63 | # TODO(vapier): Remove knob once behavior is verified. | 63 | # TODO(vapier): Remove knob once behavior is verified. |
64 | _ALTERNATES = os.environ.get('REPO_USE_ALTERNATES') == '1' | 64 | _ALTERNATES = os.environ.get('REPO_USE_ALTERNATES') == '1' |
65 | 65 | ||
@@ -2416,16 +2416,16 @@ class Project(object): | |||
2416 | srcUrl = 'http' + srcUrl[len('persistent-http'):] | 2416 | srcUrl = 'http' + srcUrl[len('persistent-http'):] |
2417 | cmd += [srcUrl] | 2417 | cmd += [srcUrl] |
2418 | 2418 | ||
2419 | proc = None | 2419 | if IsTrace(): |
2420 | with Trace('Fetching bundle: %s', ' '.join(cmd)): | 2420 | Trace('%s', ' '.join(cmd)) |
2421 | if verbose: | 2421 | if verbose: |
2422 | print('%s: Downloading bundle: %s' % (self.name, srcUrl)) | 2422 | print('%s: Downloading bundle: %s' % (self.name, srcUrl)) |
2423 | stdout = None if verbose else subprocess.PIPE | 2423 | stdout = None if verbose else subprocess.PIPE |
2424 | stderr = None if verbose else subprocess.STDOUT | 2424 | stderr = None if verbose else subprocess.STDOUT |
2425 | try: | 2425 | try: |
2426 | proc = subprocess.Popen(cmd, stdout=stdout, stderr=stderr) | 2426 | proc = subprocess.Popen(cmd, stdout=stdout, stderr=stderr) |
2427 | except OSError: | 2427 | except OSError: |
2428 | return False | 2428 | return False |
2429 | 2429 | ||
2430 | (output, _) = proc.communicate() | 2430 | (output, _) = proc.communicate() |
2431 | curlret = proc.returncode | 2431 | curlret = proc.returncode |