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 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 # OptParser.description prefer nicely non-formatted strings. | 1508 # OptParser.description prefer nicely non-formatted strings. |
1509 parser.description = re.sub('[\r\n ]{2,}', ' ', obj.__doc__) | 1509 parser.description = re.sub('[\r\n ]{2,}', ' ', obj.__doc__) |
1510 usage = getattr(obj, 'usage', '') | 1510 usage = getattr(obj, 'usage', '') |
1511 parser.set_usage('%%prog %s [options] %s' % (command, usage)) | 1511 parser.set_usage('%%prog %s [options] %s' % (command, usage)) |
1512 parser.epilog = getattr(obj, 'epilog', None) | 1512 parser.epilog = getattr(obj, 'epilog', None) |
1513 | 1513 |
1514 | 1514 |
1515 def Parser(): | 1515 def Parser(): |
1516 """Returns the default parser.""" | 1516 """Returns the default parser.""" |
1517 parser = optparse.OptionParser(version='%prog ' + __version__) | 1517 parser = optparse.OptionParser(version='%prog ' + __version__) |
1518 # cygwin and some arm boards have issues with parallel sync. | 1518 # some arm boards have issues with parallel sync. |
1519 if sys.platform == 'cygwin' or platform.machine().startswith('arm'): | 1519 if platform.machine().startswith('arm'): |
1520 jobs = 1 | 1520 jobs = 1 |
1521 else: | 1521 else: |
1522 jobs = 8 | 1522 jobs = 8 |
1523 parser.add_option('-j', '--jobs', default=jobs, type='int', | 1523 parser.add_option('-j', '--jobs', default=jobs, type='int', |
1524 help='Specify how many SCM commands can run in parallel; ' | 1524 help='Specify how many SCM commands can run in parallel; ' |
1525 'default=%default') | 1525 'default=%default') |
1526 parser.add_option('-v', '--verbose', action='count', default=0, | 1526 parser.add_option('-v', '--verbose', action='count', default=0, |
1527 help='Produces additional output for diagnostics. Can be ' | 1527 help='Produces additional output for diagnostics. Can be ' |
1528 'used up to three times for more logging info.') | 1528 'used up to three times for more logging info.') |
1529 parser.add_option('--gclientfile', dest='config_filename', | 1529 parser.add_option('--gclientfile', dest='config_filename', |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1601 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1602 print >> sys.stderr, 'Error: %s' % str(e) | 1602 print >> sys.stderr, 'Error: %s' % str(e) |
1603 return 1 | 1603 return 1 |
1604 | 1604 |
1605 | 1605 |
1606 if '__main__' == __name__: | 1606 if '__main__' == __name__: |
1607 fix_encoding.fix_encoding() | 1607 fix_encoding.fix_encoding() |
1608 sys.exit(Main(sys.argv[1:])) | 1608 sys.exit(Main(sys.argv[1:])) |
1609 | 1609 |
1610 # vim: ts=2:sw=2:tw=80:et: | 1610 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |