mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-07-02 20:17:19 +00:00
Set tracing to always on and save to .repo/TRACE_FILE.
- add `--trace_to_stderr` option so stderr will include trace outputs and any other errors that get sent to stderr - while TRACE_FILE will only include trace outputs piggy-backing on: https://gerrit-review.googlesource.com/c/git-repo/+/349154 Change-Id: I3895a84de4b2784f17fac4325521cd5e72e645e2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/350114 Reviewed-by: LaMont Jones <lamontjones@google.com> Tested-by: Joanna Wang <jojwang@google.com>
This commit is contained in:
22
project.py
22
project.py
@ -41,7 +41,7 @@ from error import ManifestInvalidRevisionError, ManifestInvalidPathError
|
||||
from error import NoManifestException, ManifestParseError
|
||||
import platform_utils
|
||||
import progress
|
||||
from repo_trace import IsTrace, Trace
|
||||
from repo_trace import Trace
|
||||
|
||||
from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M, R_WORKTREE_M
|
||||
|
||||
@ -2416,16 +2416,16 @@ class Project(object):
|
||||
srcUrl = 'http' + srcUrl[len('persistent-http'):]
|
||||
cmd += [srcUrl]
|
||||
|
||||
if IsTrace():
|
||||
Trace('%s', ' '.join(cmd))
|
||||
if verbose:
|
||||
print('%s: Downloading bundle: %s' % (self.name, srcUrl))
|
||||
stdout = None if verbose else subprocess.PIPE
|
||||
stderr = None if verbose else subprocess.STDOUT
|
||||
try:
|
||||
proc = subprocess.Popen(cmd, stdout=stdout, stderr=stderr)
|
||||
except OSError:
|
||||
return False
|
||||
proc = None
|
||||
with Trace('Fetching bundle: %s', ' '.join(cmd)):
|
||||
if verbose:
|
||||
print('%s: Downloading bundle: %s' % (self.name, srcUrl))
|
||||
stdout = None if verbose else subprocess.PIPE
|
||||
stderr = None if verbose else subprocess.STDOUT
|
||||
try:
|
||||
proc = subprocess.Popen(cmd, stdout=stdout, stderr=stderr)
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
(output, _) = proc.communicate()
|
||||
curlret = proc.returncode
|
||||
|
Reference in New Issue
Block a user