OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 # OptParser.description prefer nicely non-formatted strings. | 1274 # OptParser.description prefer nicely non-formatted strings. |
1275 parser.description = re.sub('[\r\n ]{2,}', ' ', obj.__doc__) | 1275 parser.description = re.sub('[\r\n ]{2,}', ' ', obj.__doc__) |
1276 usage = getattr(obj, 'usage', '') | 1276 usage = getattr(obj, 'usage', '') |
1277 parser.set_usage('%%prog %s [options] %s' % (command, usage)) | 1277 parser.set_usage('%%prog %s [options] %s' % (command, usage)) |
1278 parser.epilog = getattr(obj, 'epilog', None) | 1278 parser.epilog = getattr(obj, 'epilog', None) |
1279 | 1279 |
1280 | 1280 |
1281 def Parser(): | 1281 def Parser(): |
1282 """Returns the default parser.""" | 1282 """Returns the default parser.""" |
1283 parser = optparse.OptionParser(version='%prog ' + __version__) | 1283 parser = optparse.OptionParser(version='%prog ' + __version__) |
1284 parser.add_option('-j', '--jobs', default=1, type='int', | 1284 parser.add_option('-j', '--jobs', default=4, type='int', |
1285 help='Specify how many SCM commands can run in parallel; ' | 1285 help='Specify how many SCM commands can run in parallel; ' |
1286 'default=%default') | 1286 'default=%default') |
1287 parser.add_option('-v', '--verbose', action='count', default=0, | 1287 parser.add_option('-v', '--verbose', action='count', default=0, |
1288 help='Produces additional output for diagnostics. Can be ' | 1288 help='Produces additional output for diagnostics. Can be ' |
1289 'used up to three times for more logging info.') | 1289 'used up to three times for more logging info.') |
1290 parser.add_option('--gclientfile', dest='config_filename', | 1290 parser.add_option('--gclientfile', dest='config_filename', |
1291 default=os.environ.get('GCLIENT_FILE', '.gclient'), | 1291 default=os.environ.get('GCLIENT_FILE', '.gclient'), |
1292 help='Specify an alternate %default file') | 1292 help='Specify an alternate %default file') |
1293 # Integrate standard options processing. | 1293 # Integrate standard options processing. |
1294 old_parser = parser.parse_args | 1294 old_parser = parser.parse_args |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1357 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1358 print >> sys.stderr, 'Error: %s' % str(e) | 1358 print >> sys.stderr, 'Error: %s' % str(e) |
1359 return 1 | 1359 return 1 |
1360 | 1360 |
1361 | 1361 |
1362 if '__main__' == __name__: | 1362 if '__main__' == __name__: |
1363 fix_encoding.fix_encoding() | 1363 fix_encoding.fix_encoding() |
1364 sys.exit(Main(sys.argv[1:])) | 1364 sys.exit(Main(sys.argv[1:])) |
1365 | 1365 |
1366 # vim: ts=2:sw=2:tw=80:et: | 1366 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |