summaryrefslogtreecommitdiffstats
path: root/progress.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-11-10 00:11:51 +0000
committerLaMont Jones <lamontjones@google.com>2022-11-10 00:44:33 +0000
commit47020ba249c39783a66c0031fd9200caecfbbdc8 (patch)
tree164f70aa5a05e306538dcb42d52e38416bd8ef29 /progress.py
parent5ed8c639421c1669b5a945114bc169722b242697 (diff)
downloadgit-repo-47020ba249c39783a66c0031fd9200caecfbbdc8.tar.gz
trace: restore Progress indicator.v2.29.9
If we are not tracing to stderr, then we should still have progress indication. Change-Id: Ifc9678e1fccbd92251e972fcf25aad6369d60e15 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/351195 Reviewed-by: Sam Saccone <samccone@google.com> Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Xin Li <delphij@google.com>
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/progress.py b/progress.py
index f9ac53a1..526ce6c1 100644
--- a/progress.py
+++ b/progress.py
@@ -15,7 +15,7 @@
15import os 15import os
16import sys 16import sys
17from time import time 17from time import time
18from repo_trace import IsTrace 18from repo_trace import IsTraceToStderr
19 19
20_NOT_TTY = not os.isatty(2) 20_NOT_TTY = not os.isatty(2)
21 21
@@ -80,7 +80,7 @@ class Progress(object):
80 def update(self, inc=1, msg=''): 80 def update(self, inc=1, msg=''):
81 self._done += inc 81 self._done += inc
82 82
83 if _NOT_TTY or IsTrace(): 83 if _NOT_TTY or IsTraceToStderr():
84 return 84 return
85 85
86 if not self._show: 86 if not self._show:
@@ -113,7 +113,7 @@ class Progress(object):
113 sys.stderr.flush() 113 sys.stderr.flush()
114 114
115 def end(self): 115 def end(self):
116 if _NOT_TTY or IsTrace() or not self._show: 116 if _NOT_TTY or IsTraceToStderr() or not self._show:
117 return 117 return
118 118
119 duration = duration_str(time() - self._start) 119 duration = duration_str(time() - self._start)