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 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 # OptParser.description prefer nicely non-formatted strings. | 1264 # OptParser.description prefer nicely non-formatted strings. |
1265 parser.description = re.sub('[\r\n ]{2,}', ' ', obj.__doc__) | 1265 parser.description = re.sub('[\r\n ]{2,}', ' ', obj.__doc__) |
1266 usage = getattr(obj, 'usage', '') | 1266 usage = getattr(obj, 'usage', '') |
1267 parser.set_usage('%%prog %s [options] %s' % (command, usage)) | 1267 parser.set_usage('%%prog %s [options] %s' % (command, usage)) |
1268 parser.epilog = getattr(obj, 'epilog', None) | 1268 parser.epilog = getattr(obj, 'epilog', None) |
1269 | 1269 |
1270 | 1270 |
1271 def Parser(): | 1271 def Parser(): |
1272 """Returns the default parser.""" | 1272 """Returns the default parser.""" |
1273 parser = optparse.OptionParser(version='%prog ' + __version__) | 1273 parser = optparse.OptionParser(version='%prog ' + __version__) |
1274 parser.add_option('-j', '--jobs', default=4, type='int', | 1274 parser.add_option('-j', '--jobs', default=1, type='int', |
1275 help='Specify how many SCM commands can run in parallel; ' | 1275 help='Specify how many SCM commands can run in parallel; ' |
1276 'default=%default') | 1276 'default=%default') |
1277 parser.add_option('-v', '--verbose', action='count', default=0, | 1277 parser.add_option('-v', '--verbose', action='count', default=0, |
1278 help='Produces additional output for diagnostics. Can be ' | 1278 help='Produces additional output for diagnostics. Can be ' |
1279 'used up to three times for more logging info.') | 1279 'used up to three times for more logging info.') |
1280 parser.add_option('--gclientfile', dest='config_filename', | 1280 parser.add_option('--gclientfile', dest='config_filename', |
1281 default=os.environ.get('GCLIENT_FILE', '.gclient'), | 1281 default=os.environ.get('GCLIENT_FILE', '.gclient'), |
1282 help='Specify an alternate %default file') | 1282 help='Specify an alternate %default file') |
1283 # Integrate standard options processing. | 1283 # Integrate standard options processing. |
1284 old_parser = parser.parse_args | 1284 old_parser = parser.parse_args |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1347 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1348 print >> sys.stderr, 'Error: %s' % str(e) | 1348 print >> sys.stderr, 'Error: %s' % str(e) |
1349 return 1 | 1349 return 1 |
1350 | 1350 |
1351 | 1351 |
1352 if '__main__' == __name__: | 1352 if '__main__' == __name__: |
1353 fix_encoding.fix_encoding() | 1353 fix_encoding.fix_encoding() |
1354 sys.exit(Main(sys.argv[1:])) | 1354 sys.exit(Main(sys.argv[1:])) |
1355 | 1355 |
1356 # vim: ts=2:sw=2:tw=80:et: | 1356 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |