OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """ | 6 """ |
7 Tool to perform checkouts in one easy command line! | 7 Tool to perform checkouts in one easy command line! |
8 | 8 |
9 Usage: | 9 Usage: |
10 fetch <recipe> [--property=value [--property2=value2 ...]] | 10 fetch <recipe> [--property=value [--property2=value2 ...]] |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 root: The directory into which the repo expects to be checkout out. | 240 root: The directory into which the repo expects to be checkout out. |
241 """ | 241 """ |
242 assert 'type' in spec | 242 assert 'type' in spec |
243 checkout_type = spec['type'] | 243 checkout_type = spec['type'] |
244 checkout_spec = spec['%s_spec' % checkout_type] | 244 checkout_spec = spec['%s_spec' % checkout_type] |
245 try: | 245 try: |
246 checkout = CheckoutFactory(checkout_type, dryrun, checkout_spec, root) | 246 checkout = CheckoutFactory(checkout_type, dryrun, checkout_spec, root) |
247 except KeyError: | 247 except KeyError: |
248 return 1 | 248 return 1 |
249 if checkout.exists(): | 249 if checkout.exists(): |
250 print 'You appear to already have this checkout.' | 250 print 'You appear to already have a checkout. "fetch" is used only' |
251 print 'Aborting to avoid clobbering your work.' | 251 print 'to get new checkouts. Use "gclient sync" to update the checkout.' |
| 252 print |
| 253 print 'Fetch also does not yet deal with partial checkouts, so if fetch' |
| 254 print 'failed, delete the checkout and start over (crbug.com/230691).' |
252 return 1 | 255 return 1 |
253 return checkout.init() | 256 return checkout.init() |
254 | 257 |
255 | 258 |
256 def main(): | 259 def main(): |
257 dryrun, recipe, props = handle_args(sys.argv) | 260 dryrun, recipe, props = handle_args(sys.argv) |
258 spec, root = run_recipe_fetch(recipe, props) | 261 spec, root = run_recipe_fetch(recipe, props) |
259 return run(dryrun, spec, root) | 262 return run(dryrun, spec, root) |
260 | 263 |
261 | 264 |
262 if __name__ == '__main__': | 265 if __name__ == '__main__': |
263 sys.exit(main()) | 266 sys.exit(main()) |
OLD | NEW |