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

Side by Side Diff: gclient.py

Issue 3342024: Add automatic auto-flushing stdout. (Closed)
Patch Set: update unit test 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 | gclient_utils.py » ('j') | 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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 level = None 1190 level = None
1191 if options.verbose == 2: 1191 if options.verbose == 2:
1192 level = logging.INFO 1192 level = logging.INFO
1193 elif options.verbose > 2: 1193 elif options.verbose > 2:
1194 level = logging.DEBUG 1194 level = logging.DEBUG
1195 logging.basicConfig(level=level, 1195 logging.basicConfig(level=level,
1196 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') 1196 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s')
1197 options.entries_filename = options.config_filename + '_entries' 1197 options.entries_filename = options.config_filename + '_entries'
1198 if options.jobs < 1: 1198 if options.jobs < 1:
1199 parser.error('--jobs must be 1 or higher') 1199 parser.error('--jobs must be 1 or higher')
1200 # Useful for --jobs. 1200 # Always autoflush so buildbot doesn't kill us during lengthy operations.
1201 options.stdout = sys.stdout 1201 options.stdout = gclient_utils.StdoutAutoFlush(sys.stdout)
1202 1202
1203 # These hacks need to die. 1203 # These hacks need to die.
1204 if not hasattr(options, 'revisions'): 1204 if not hasattr(options, 'revisions'):
1205 # GClient.RunOnDeps expects it even if not applicable. 1205 # GClient.RunOnDeps expects it even if not applicable.
1206 options.revisions = [] 1206 options.revisions = []
1207 if not hasattr(options, 'head'): 1207 if not hasattr(options, 'head'):
1208 options.head = None 1208 options.head = None
1209 if not hasattr(options, 'nohooks'): 1209 if not hasattr(options, 'nohooks'):
1210 options.nohooks = True 1210 options.nohooks = True
1211 if not hasattr(options, 'deps_os'): 1211 if not hasattr(options, 'deps_os'):
(...skipping 17 matching lines...) Expand all
1229 return CMDhelp(parser, argv) 1229 return CMDhelp(parser, argv)
1230 except gclient_utils.Error, e: 1230 except gclient_utils.Error, e:
1231 print >> sys.stderr, 'Error: %s' % str(e) 1231 print >> sys.stderr, 'Error: %s' % str(e)
1232 return 1 1232 return 1
1233 1233
1234 1234
1235 if '__main__' == __name__: 1235 if '__main__' == __name__:
1236 sys.exit(Main(sys.argv[1:])) 1236 sys.exit(Main(sys.argv[1:]))
1237 1237
1238 # 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 | gclient_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698