summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorJoanna Wang <jojwang@google.com>2022-11-03 16:51:19 -0400
committerJoanna Wang <jojwang@google.com>2022-11-03 21:07:07 +0000
commita6c52f566acfbff5b0f37158c0d33adf05d250e5 (patch)
treed79d55b872c3be39c54dcb6ef41749c40d39ccf2 /project.py
parent0d130d2da0754c546f654ede99a79aac2b8e6c5f (diff)
downloadgit-repo-a6c52f566acfbff5b0f37158c0d33adf05d250e5.tar.gz
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>
Diffstat (limited to 'project.py')
-rw-r--r--project.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/project.py b/project.py
index 1c85b044..b975b72a 100644
--- a/project.py
+++ b/project.py
@@ -41,7 +41,7 @@ from error import ManifestInvalidRevisionError, ManifestInvalidPathError
41from error import NoManifestException, ManifestParseError 41from error import NoManifestException, ManifestParseError
42import platform_utils 42import platform_utils
43import progress 43import progress
44from repo_trace import IsTrace, Trace 44from repo_trace import Trace
45 45
46from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M, R_WORKTREE_M 46from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M, R_WORKTREE_M
47 47
@@ -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 if IsTrace(): 2419 proc = None
2420 Trace('%s', ' '.join(cmd)) 2420 with Trace('Fetching bundle: %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