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 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 help='GIT ONLY - Reduces the size/time of the checkout at ' | 2042 help='GIT ONLY - Reduces the size/time of the checkout at ' |
2043 'the cost of no history. Requires Git 1.9+') | 2043 'the cost of no history. Requires Git 1.9+') |
2044 parser.add_option('--shallow', action='store_true', | 2044 parser.add_option('--shallow', action='store_true', |
2045 help='GIT ONLY - Do a shallow clone into the cache dir. ' | 2045 help='GIT ONLY - Do a shallow clone into the cache dir. ' |
2046 'Requires Git 1.9+') | 2046 'Requires Git 1.9+') |
2047 parser.add_option('--no_bootstrap', '--no-bootstrap', | 2047 parser.add_option('--no_bootstrap', '--no-bootstrap', |
2048 action='store_true', | 2048 action='store_true', |
2049 help='Don\'t bootstrap from Google Storage.') | 2049 help='Don\'t bootstrap from Google Storage.') |
2050 parser.add_option('--ignore_locks', action='store_true', | 2050 parser.add_option('--ignore_locks', action='store_true', |
2051 help='GIT ONLY - Ignore cache locks.') | 2051 help='GIT ONLY - Ignore cache locks.') |
| 2052 parser.add_option('--lock_timeout', type='int', default=0, |
| 2053 help='GIT ONLY - Deadline (in seconds) to wait for git ' |
| 2054 'cache lock to become available.') |
2052 (options, args) = parser.parse_args(args) | 2055 (options, args) = parser.parse_args(args) |
2053 client = GClient.LoadCurrentConfig(options) | 2056 client = GClient.LoadCurrentConfig(options) |
2054 | 2057 |
2055 if not client: | 2058 if not client: |
2056 raise gclient_utils.Error('client not configured; see \'gclient config\'') | 2059 raise gclient_utils.Error('client not configured; see \'gclient config\'') |
2057 | 2060 |
2058 if options.revisions and options.head: | 2061 if options.revisions and options.head: |
2059 # TODO(maruel): Make it a parser.error if it doesn't break any builder. | 2062 # TODO(maruel): Make it a parser.error if it doesn't break any builder. |
2060 print('Warning: you cannot use both --head and --revision') | 2063 print('Warning: you cannot use both --head and --revision') |
2061 | 2064 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2321 | 2324 |
2322 | 2325 |
2323 if '__main__' == __name__: | 2326 if '__main__' == __name__: |
2324 try: | 2327 try: |
2325 sys.exit(main(sys.argv[1:])) | 2328 sys.exit(main(sys.argv[1:])) |
2326 except KeyboardInterrupt: | 2329 except KeyboardInterrupt: |
2327 sys.stderr.write('interrupted\n') | 2330 sys.stderr.write('interrupted\n') |
2328 sys.exit(1) | 2331 sys.exit(1) |
2329 | 2332 |
2330 # vim: ts=2:sw=2:tw=80:et: | 2333 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |