OLD | NEW |
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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 parser.epilog = getattr(obj, 'epilog', None) | 1166 parser.epilog = getattr(obj, 'epilog', None) |
1167 | 1167 |
1168 | 1168 |
1169 def Main(argv): | 1169 def Main(argv): |
1170 """Doesn't parse the arguments here, just find the right subcommand to | 1170 """Doesn't parse the arguments here, just find the right subcommand to |
1171 execute.""" | 1171 execute.""" |
1172 try: | 1172 try: |
1173 # Make stdout auto-flush so buildbot doesn't kill us during lengthy | 1173 # Make stdout auto-flush so buildbot doesn't kill us during lengthy |
1174 # operations. Python as a strong tendency to buffer sys.stdout. | 1174 # operations. Python as a strong tendency to buffer sys.stdout. |
1175 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) | 1175 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
1176 | 1176 # Make stdout annotated with the thread ids. |
| 1177 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout) |
1177 # Do it late so all commands are listed. | 1178 # Do it late so all commands are listed. |
1178 CMDhelp.usage = ('\n\nCommands are:\n' + '\n'.join([ | 1179 CMDhelp.usage = ('\n\nCommands are:\n' + '\n'.join([ |
1179 ' %-10s %s' % (fn[3:], Command(fn[3:]).__doc__.split('\n')[0].strip()) | 1180 ' %-10s %s' % (fn[3:], Command(fn[3:]).__doc__.split('\n')[0].strip()) |
1180 for fn in dir(sys.modules[__name__]) if fn.startswith('CMD')])) | 1181 for fn in dir(sys.modules[__name__]) if fn.startswith('CMD')])) |
1181 parser = optparse.OptionParser(version='%prog ' + __version__) | 1182 parser = optparse.OptionParser(version='%prog ' + __version__) |
1182 parser.add_option('-j', '--jobs', default=1, type='int', | 1183 parser.add_option('-j', '--jobs', default=1, type='int', |
1183 help='Specify how many SCM commands can run in parallel; ' | 1184 help='Specify how many SCM commands can run in parallel; ' |
1184 'default=%default') | 1185 'default=%default') |
1185 parser.add_option('-v', '--verbose', action='count', default=0, | 1186 parser.add_option('-v', '--verbose', action='count', default=0, |
1186 help='Produces additional output for diagnostics. Can be ' | 1187 help='Produces additional output for diagnostics. Can be ' |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 return CMDhelp(parser, argv) | 1235 return CMDhelp(parser, argv) |
1235 except gclient_utils.Error, e: | 1236 except gclient_utils.Error, e: |
1236 print >> sys.stderr, 'Error: %s' % str(e) | 1237 print >> sys.stderr, 'Error: %s' % str(e) |
1237 return 1 | 1238 return 1 |
1238 | 1239 |
1239 | 1240 |
1240 if '__main__' == __name__: | 1241 if '__main__' == __name__: |
1241 sys.exit(Main(sys.argv[1:])) | 1242 sys.exit(Main(sys.argv[1:])) |
1242 | 1243 |
1243 # vim: ts=2:sw=2:tw=80:et: | 1244 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |