| 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 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 help='Produces additional output for diagnostics. Can be ' | 1693 help='Produces additional output for diagnostics. Can be ' |
| 1694 'used up to three times for more logging info.') | 1694 'used up to three times for more logging info.') |
| 1695 parser.add_option('--gclientfile', dest='config_filename', | 1695 parser.add_option('--gclientfile', dest='config_filename', |
| 1696 default=None, | 1696 default=None, |
| 1697 help='Specify an alternate %s file' % gclientfile_default) | 1697 help='Specify an alternate %s file' % gclientfile_default) |
| 1698 parser.add_option('--spec', | 1698 parser.add_option('--spec', |
| 1699 default=None, | 1699 default=None, |
| 1700 help='create a gclient file containing the provided ' | 1700 help='create a gclient file containing the provided ' |
| 1701 'string. Due to Cygwin/Python brokenness, it ' | 1701 'string. Due to Cygwin/Python brokenness, it ' |
| 1702 'probably can\'t contain any newlines.') | 1702 'probably can\'t contain any newlines.') |
| 1703 parser.add_option('--no-nag-max', default=False, action='store_true', |
| 1704 help='If a subprocess runs for too long without generating' |
| 1705 ' terminal output, generate warnings, but do not kill' |
| 1706 ' the process.') |
| 1703 # Integrate standard options processing. | 1707 # Integrate standard options processing. |
| 1704 old_parser = parser.parse_args | 1708 old_parser = parser.parse_args |
| 1705 def Parse(args): | 1709 def Parse(args): |
| 1706 (options, args) = old_parser(args) | 1710 (options, args) = old_parser(args) |
| 1707 level = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ | 1711 level = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ |
| 1708 min(options.verbose, 3)] | 1712 min(options.verbose, 3)] |
| 1709 logging.basicConfig(level=level, | 1713 logging.basicConfig(level=level, |
| 1710 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') | 1714 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') |
| 1711 if options.config_filename and options.spec: | 1715 if options.config_filename and options.spec: |
| 1712 parser.error('Cannot specifiy both --gclientfile and --spec') | 1716 parser.error('Cannot specifiy both --gclientfile and --spec') |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1723 if not hasattr(options, 'head'): | 1727 if not hasattr(options, 'head'): |
| 1724 options.head = None | 1728 options.head = None |
| 1725 if not hasattr(options, 'nohooks'): | 1729 if not hasattr(options, 'nohooks'): |
| 1726 options.nohooks = True | 1730 options.nohooks = True |
| 1727 if not hasattr(options, 'deps_os'): | 1731 if not hasattr(options, 'deps_os'): |
| 1728 options.deps_os = None | 1732 options.deps_os = None |
| 1729 if not hasattr(options, 'manually_grab_svn_rev'): | 1733 if not hasattr(options, 'manually_grab_svn_rev'): |
| 1730 options.manually_grab_svn_rev = None | 1734 options.manually_grab_svn_rev = None |
| 1731 if not hasattr(options, 'force'): | 1735 if not hasattr(options, 'force'): |
| 1732 options.force = None | 1736 options.force = None |
| 1737 if options.no_nag_max: |
| 1738 gclient_scm.SCMWrapper.nag_max = None |
| 1733 return (options, args) | 1739 return (options, args) |
| 1734 parser.parse_args = Parse | 1740 parser.parse_args = Parse |
| 1735 # We don't want wordwrapping in epilog (usually examples) | 1741 # We don't want wordwrapping in epilog (usually examples) |
| 1736 parser.format_epilog = lambda _: parser.epilog or '' | 1742 parser.format_epilog = lambda _: parser.epilog or '' |
| 1737 return parser | 1743 return parser |
| 1738 | 1744 |
| 1739 | 1745 |
| 1740 def Main(argv): | 1746 def Main(argv): |
| 1741 """Doesn't parse the arguments here, just find the right subcommand to | 1747 """Doesn't parse the arguments here, just find the right subcommand to |
| 1742 execute.""" | 1748 execute.""" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1789 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1784 print >> sys.stderr, 'Error: %s' % str(e) | 1790 print >> sys.stderr, 'Error: %s' % str(e) |
| 1785 return 1 | 1791 return 1 |
| 1786 | 1792 |
| 1787 | 1793 |
| 1788 if '__main__' == __name__: | 1794 if '__main__' == __name__: |
| 1789 fix_encoding.fix_encoding() | 1795 fix_encoding.fix_encoding() |
| 1790 sys.exit(Main(sys.argv[1:])) | 1796 sys.exit(Main(sys.argv[1:])) |
| 1791 | 1797 |
| 1792 # vim: ts=2:sw=2:tw=80:et: | 1798 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |