| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 def exists(self): | 108 def exists(self): |
| 109 return os.path.exists(os.path.join(os.getcwd(), self.root)) | 109 return os.path.exists(os.path.join(os.getcwd(), self.root)) |
| 110 | 110 |
| 111 def init(self): | 111 def init(self): |
| 112 # TODO(dpranke): Work around issues w/ delta compression on big repos. | 112 # TODO(dpranke): Work around issues w/ delta compression on big repos. |
| 113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G') | 113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G') |
| 114 | 114 |
| 115 # Configure and do the gclient checkout. | 115 # Configure and do the gclient checkout. |
| 116 self.run_gclient('config', '--spec', self.spec['gclient_spec']) | 116 self.run_gclient('config', '--spec', self.spec['gclient_spec']) |
| 117 self.run_gclient('sync') | 117 self.run_gclient('sync --nohooks') |
| 118 | 118 |
| 119 # Configure git. | 119 # Configure git. |
| 120 wd = os.path.join(self.base, self.root) | 120 wd = os.path.join(self.base, self.root) |
| 121 if self.dryrun: | 121 if self.dryrun: |
| 122 print 'cd %s' % wd | 122 print 'cd %s' % wd |
| 123 self.run_git( | 123 self.run_git( |
| 124 'submodule', 'foreach', | 124 'submodule', 'foreach', |
| 125 'git config -f $toplevel/.git/config submodule.$name.ignore all', | 125 'git config -f $toplevel/.git/config submodule.$name.ignore all', |
| 126 cwd=wd) | 126 cwd=wd) |
| 127 self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd) | 127 self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd) |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 | 270 |
| 271 def main(): | 271 def main(): |
| 272 dryrun, recipe, props = handle_args(sys.argv) | 272 dryrun, recipe, props = handle_args(sys.argv) |
| 273 spec, root = run_recipe_fetch(recipe, props) | 273 spec, root = run_recipe_fetch(recipe, props) |
| 274 return run(dryrun, spec, root) | 274 return run(dryrun, spec, root) |
| 275 | 275 |
| 276 | 276 |
| 277 if __name__ == '__main__': | 277 if __name__ == '__main__': |
| 278 sys.exit(main()) | 278 sys.exit(main()) |
| OLD | NEW |