| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if self.options.dry_run: | 121 if self.options.dry_run: |
| 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( | 127 self.run_git( |
| 128 'config', '--add', 'remote.origin.fetch', | 128 'config', '--add', 'remote.origin.fetch', |
| 129 '+refs/tags/*:refs/tags/*', cwd=wd) | 129 '+refs/tags/*:refs/tags/*', cwd=wd) |
| 130 self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd) | 130 self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd) |
| 131 if 'initial_branch' in self.spec: |
| 132 self.run_git('checkout', self.spec['initial_branch'], cwd=wd) |
| 131 | 133 |
| 132 | 134 |
| 133 class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout): | 135 class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout): |
| 134 | 136 |
| 135 def __init__(self, options, spec, root): | 137 def __init__(self, options, spec, root): |
| 136 super(GclientGitSvnCheckout, self).__init__(options, spec, root) | 138 super(GclientGitSvnCheckout, self).__init__(options, spec, root) |
| 137 assert 'svn_url' in self.spec | 139 assert 'svn_url' in self.spec |
| 138 assert 'svn_branch' in self.spec | 140 assert 'svn_branch' in self.spec |
| 139 assert 'svn_ref' in self.spec | 141 assert 'svn_ref' in self.spec |
| 140 | 142 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 292 |
| 291 | 293 |
| 292 def main(): | 294 def main(): |
| 293 options, recipe, props = handle_args(sys.argv) | 295 options, recipe, props = handle_args(sys.argv) |
| 294 spec, root = run_recipe_fetch(recipe, props) | 296 spec, root = run_recipe_fetch(recipe, props) |
| 295 return run(options, spec, root) | 297 return run(options, spec, root) |
| 296 | 298 |
| 297 | 299 |
| 298 if __name__ == '__main__': | 300 if __name__ == '__main__': |
| 299 sys.exit(main()) | 301 sys.exit(main()) |
| OLD | NEW |