Commit 5b3f8851 authored by maruel@chromium.org's avatar maruel@chromium.org

Automatically disable progress for non tty output, i.e. when it's redirected.

Otherwise, a VT100 terminal will soon be assumed.

TEST=touch foo.txt; gclient sync >> foo.txt &; tail -F foo.txt doesn't show progress.
BUG=none

Review URL: http://codereview.chromium.org/3310026

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59101 0039d316-1c4b-4281-b951-d872f2087c98
parent acc45671
......@@ -715,7 +715,8 @@ solutions = [
raise gclient_utils.Error('No solution specified')
revision_overrides = self._EnforceRevisions()
pm = None
if command == 'update' and not self._options.verbose:
# Disable progress for non-tty stdout.
if command in ('update', 'revert') and sys.stdout.isatty():
pm = Progress('Syncing projects', 1)
work_queue = gclient_utils.ExecutionQueue(self._options.jobs, pm)
for s in self.dependencies:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment