| 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 # Files | 7 # Files |
| 8 # .gclient : Current client configuration, written by 'config' command. | 8 # .gclient : Current client configuration, written by 'config' command. |
| 9 # Format is a Python script defining 'solutions', a list whose | 9 # Format is a Python script defining 'solutions', a list whose |
| 10 # entries each are maps binding the strings "name" and "url" | 10 # entries each are maps binding the strings "name" and "url" |
| (...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 'three times for more logging info.') | 1761 'three times for more logging info.') |
| 1762 self.add_option( | 1762 self.add_option( |
| 1763 '--gclientfile', dest='config_filename', | 1763 '--gclientfile', dest='config_filename', |
| 1764 help='Specify an alternate %s file' % self.gclientfile_default) | 1764 help='Specify an alternate %s file' % self.gclientfile_default) |
| 1765 self.add_option( | 1765 self.add_option( |
| 1766 '--spec', | 1766 '--spec', |
| 1767 help='create a gclient file containing the provided string. Due to ' | 1767 help='create a gclient file containing the provided string. Due to ' |
| 1768 'Cygwin/Python brokenness, it can\'t contain any newlines.') | 1768 'Cygwin/Python brokenness, it can\'t contain any newlines.') |
| 1769 self.add_option( | 1769 self.add_option( |
| 1770 '--no-nag-max', default=False, action='store_true', | 1770 '--no-nag-max', default=False, action='store_true', |
| 1771 help='If a subprocess runs for too long without generating terminal ' | 1771 help='Ignored for backwards compatibility.') |
| 1772 'output, generate warnings, but do not kill the process.') | |
| 1773 | 1772 |
| 1774 def parse_args(self, args=None, values=None): | 1773 def parse_args(self, args=None, values=None): |
| 1775 """Integrates standard options processing.""" | 1774 """Integrates standard options processing.""" |
| 1776 options, args = optparse.OptionParser.parse_args(self, args, values) | 1775 options, args = optparse.OptionParser.parse_args(self, args, values) |
| 1777 levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG] | 1776 levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG] |
| 1778 logging.basicConfig( | 1777 logging.basicConfig( |
| 1779 level=levels[min(options.verbose, len(levels) - 1)], | 1778 level=levels[min(options.verbose, len(levels) - 1)], |
| 1780 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') | 1779 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') |
| 1781 if options.config_filename and options.spec: | 1780 if options.config_filename and options.spec: |
| 1782 self.error('Cannot specifiy both --gclientfile and --spec') | 1781 self.error('Cannot specifiy both --gclientfile and --spec') |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1793 if not hasattr(options, 'head'): | 1792 if not hasattr(options, 'head'): |
| 1794 options.head = None | 1793 options.head = None |
| 1795 if not hasattr(options, 'nohooks'): | 1794 if not hasattr(options, 'nohooks'): |
| 1796 options.nohooks = True | 1795 options.nohooks = True |
| 1797 if not hasattr(options, 'deps_os'): | 1796 if not hasattr(options, 'deps_os'): |
| 1798 options.deps_os = None | 1797 options.deps_os = None |
| 1799 if not hasattr(options, 'manually_grab_svn_rev'): | 1798 if not hasattr(options, 'manually_grab_svn_rev'): |
| 1800 options.manually_grab_svn_rev = None | 1799 options.manually_grab_svn_rev = None |
| 1801 if not hasattr(options, 'force'): | 1800 if not hasattr(options, 'force'): |
| 1802 options.force = None | 1801 options.force = None |
| 1803 if options.no_nag_max: | |
| 1804 gclient_scm.SCMWrapper.nag_max = None | |
| 1805 return (options, args) | 1802 return (options, args) |
| 1806 | 1803 |
| 1807 | 1804 |
| 1808 def disable_buffering(): | 1805 def disable_buffering(): |
| 1809 # Make stdout auto-flush so buildbot doesn't kill us during lengthy | 1806 # Make stdout auto-flush so buildbot doesn't kill us during lengthy |
| 1810 # operations. Python as a strong tendency to buffer sys.stdout. | 1807 # operations. Python as a strong tendency to buffer sys.stdout. |
| 1811 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) | 1808 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
| 1812 # Make stdout annotated with the thread ids. | 1809 # Make stdout annotated with the thread ids. |
| 1813 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout) | 1810 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout) |
| 1814 | 1811 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1836 raise | 1833 raise |
| 1837 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1834 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1838 print >> sys.stderr, 'Error: %s' % str(e) | 1835 print >> sys.stderr, 'Error: %s' % str(e) |
| 1839 return 1 | 1836 return 1 |
| 1840 | 1837 |
| 1841 | 1838 |
| 1842 if '__main__' == __name__: | 1839 if '__main__' == __name__: |
| 1843 sys.exit(Main(sys.argv[1:])) | 1840 sys.exit(Main(sys.argv[1:])) |
| 1844 | 1841 |
| 1845 # vim: ts=2:sw=2:tw=80:et: | 1842 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |