| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 parser.epilog = getattr(obj, 'epilog', None) | 1534 parser.epilog = getattr(obj, 'epilog', None) |
| 1535 | 1535 |
| 1536 | 1536 |
| 1537 def Parser(): | 1537 def Parser(): |
| 1538 """Returns the default parser.""" | 1538 """Returns the default parser.""" |
| 1539 parser = optparse.OptionParser(version='%prog ' + __version__) | 1539 parser = optparse.OptionParser(version='%prog ' + __version__) |
| 1540 # some arm boards have issues with parallel sync. | 1540 # some arm boards have issues with parallel sync. |
| 1541 if platform.machine().startswith('arm'): | 1541 if platform.machine().startswith('arm'): |
| 1542 jobs = 1 | 1542 jobs = 1 |
| 1543 else: | 1543 else: |
| 1544 jobs = 8 | 1544 jobs = max(8, gclient_utils.NumLocalCpus()) |
| 1545 gclientfile_default = os.environ.get('GCLIENT_FILE', '.gclient') | 1545 gclientfile_default = os.environ.get('GCLIENT_FILE', '.gclient') |
| 1546 parser.add_option('-j', '--jobs', default=jobs, type='int', | 1546 parser.add_option('-j', '--jobs', default=jobs, type='int', |
| 1547 help='Specify how many SCM commands can run in parallel; ' | 1547 help='Specify how many SCM commands can run in parallel; ' |
| 1548 'default=%default') | 1548 'defaults to number of cpu cores (%default)') |
| 1549 parser.add_option('-v', '--verbose', action='count', default=0, | 1549 parser.add_option('-v', '--verbose', action='count', default=0, |
| 1550 help='Produces additional output for diagnostics. Can be ' | 1550 help='Produces additional output for diagnostics. Can be ' |
| 1551 'used up to three times for more logging info.') | 1551 'used up to three times for more logging info.') |
| 1552 parser.add_option('--gclientfile', dest='config_filename', | 1552 parser.add_option('--gclientfile', dest='config_filename', |
| 1553 default=None, | 1553 default=None, |
| 1554 help='Specify an alternate %s file' % gclientfile_default) | 1554 help='Specify an alternate %s file' % gclientfile_default) |
| 1555 parser.add_option('--spec', | 1555 parser.add_option('--spec', |
| 1556 default=None, | 1556 default=None, |
| 1557 help='create a gclient file containing the provided ' | 1557 help='create a gclient file containing the provided ' |
| 1558 'string. Due to Cygwin/Python brokenness, it ' | 1558 'string. Due to Cygwin/Python brokenness, it ' |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1633 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1634 print >> sys.stderr, 'Error: %s' % str(e) | 1634 print >> sys.stderr, 'Error: %s' % str(e) |
| 1635 return 1 | 1635 return 1 |
| 1636 | 1636 |
| 1637 | 1637 |
| 1638 if '__main__' == __name__: | 1638 if '__main__' == __name__: |
| 1639 fix_encoding.fix_encoding() | 1639 fix_encoding.fix_encoding() |
| 1640 sys.exit(Main(sys.argv[1:])) | 1640 sys.exit(Main(sys.argv[1:])) |
| 1641 | 1641 |
| 1642 # vim: ts=2:sw=2:tw=80:et: | 1642 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |