summaryrefslogtreecommitdiffstats
path: root/progress.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2010-12-07 10:31:19 -0800
committerShawn O. Pearce <sop@google.com>2010-12-07 11:13:29 -0800
commit13f3da50d40b89ee5b05f5f3de9542c20edac6d1 (patch)
treed085b6f6b498bde85a1969fce884dd24e88d03d5 /progress.py
parent3218c13205694434edb2375ab8a8515554eed366 (diff)
parent2b8db3ce3e7344b9f3b5216637c5af0d54be5656 (diff)
downloadgit-repo-13f3da50d40b89ee5b05f5f3de9542c20edac6d1.tar.gz
Merge branch 'stable'
* stable: (33 commits) Added feature to print a <notice> from manifest at the end of a sync. sync: Use --force-broken to continue other projects upload: Remove --replace option sync --quiet: be more quiet sync: Enable use of git clone --reference Only delete corrupt pickle config files if they exist Don't allow git fetch to start ControlMaster Check for existing SSH ControlMaster Fix for handling values of EDITOR which contain a space. upload: Fix --replace flag rebase: Pass through more options upload: Allow review.HOST.username to override email upload -t: Automatically include local branch name Warn users before uploading if there are local changes sync: Try fetching a tag as a last resort before giving up rebase: Automatically rebase branch on upstrea upload: Automatically --cc folks in review.URL.autocopy Fix format string bugs in grep Do not invoke ssh with -p argument when no port has been specified. Allow files to be copied into new folders ... Conflicts: git_config.py manifest_xml.py subcmds/init.py subcmds/sync.py subcmds/upload.py Change-Id: I4756a6908277e91505c35287a122a775b68f4df5
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/progress.py b/progress.py
index b119b374..2ace7010 100644
--- a/progress.py
+++ b/progress.py
@@ -13,10 +13,13 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16import os
16import sys 17import sys
17from time import time 18from time import time
18from trace import IsTrace 19from trace import IsTrace
19 20
21_NOT_TTY = not os.isatty(2)
22
20class Progress(object): 23class Progress(object):
21 def __init__(self, title, total=0): 24 def __init__(self, title, total=0):
22 self._title = title 25 self._title = title
@@ -29,7 +32,7 @@ class Progress(object):
29 def update(self, inc=1): 32 def update(self, inc=1):
30 self._done += inc 33 self._done += inc
31 34
32 if IsTrace(): 35 if _NOT_TTY or IsTrace():
33 return 36 return
34 37
35 if not self._show: 38 if not self._show:
@@ -56,7 +59,7 @@ class Progress(object):
56 sys.stderr.flush() 59 sys.stderr.flush()
57 60
58 def end(self): 61 def end(self):
59 if IsTrace() or not self._show: 62 if _NOT_TTY or IsTrace() or not self._show:
60 return 63 return
61 64
62 if self._total <= 0: 65 if self._total <= 0: