Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: gclient.py

Issue 3310026: Automatically disable progress for non tty output, i.e. when it's redirected. (Closed)
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Meta checkout manager supporting both Subversion and GIT. 6 """Meta checkout manager supporting both Subversion and GIT.
7 7
8 Files 8 Files
9 .gclient : Current client configuration, written by 'config' command. 9 .gclient : Current client configuration, written by 'config' command.
10 Format is a Python script defining 'solutions', a list whose 10 Format is a Python script defining 'solutions', a list whose
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 """Runs a command on each dependency in a client and its dependencies. 708 """Runs a command on each dependency in a client and its dependencies.
709 709
710 Args: 710 Args:
711 command: The command to use (e.g., 'status' or 'diff') 711 command: The command to use (e.g., 'status' or 'diff')
712 args: list of str - extra arguments to add to the command line. 712 args: list of str - extra arguments to add to the command line.
713 """ 713 """
714 if not self.dependencies: 714 if not self.dependencies:
715 raise gclient_utils.Error('No solution specified') 715 raise gclient_utils.Error('No solution specified')
716 revision_overrides = self._EnforceRevisions() 716 revision_overrides = self._EnforceRevisions()
717 pm = None 717 pm = None
718 if command == 'update' and not self._options.verbose: 718 # Disable progress for non-tty stdout.
719 if command in ('update', 'revert') and sys.stdout.isatty():
719 pm = Progress('Syncing projects', 1) 720 pm = Progress('Syncing projects', 1)
720 work_queue = gclient_utils.ExecutionQueue(self._options.jobs, pm) 721 work_queue = gclient_utils.ExecutionQueue(self._options.jobs, pm)
721 for s in self.dependencies: 722 for s in self.dependencies:
722 work_queue.enqueue(s) 723 work_queue.enqueue(s)
723 work_queue.flush(revision_overrides, command, args, options=self._options) 724 work_queue.flush(revision_overrides, command, args, options=self._options)
724 725
725 # Once all the dependencies have been processed, it's now safe to run the 726 # Once all the dependencies have been processed, it's now safe to run the
726 # hooks. 727 # hooks.
727 if not self._options.nohooks: 728 if not self._options.nohooks:
728 self.RunHooksRecursively(self._options) 729 self.RunHooksRecursively(self._options)
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 return CMDhelp(parser, argv) 1229 return CMDhelp(parser, argv)
1229 except gclient_utils.Error, e: 1230 except gclient_utils.Error, e:
1230 print >> sys.stderr, 'Error: %s' % str(e) 1231 print >> sys.stderr, 'Error: %s' % str(e)
1231 return 1 1232 return 1
1232 1233
1233 1234
1234 if '__main__' == __name__: 1235 if '__main__' == __name__:
1235 sys.exit(Main(sys.argv[1:])) 1236 sys.exit(Main(sys.argv[1:]))
1236 1237
1237 # vim: ts=2:sw=2:tw=80:et: 1238 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698