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