| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/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 """Convert SVN based DEPS into .DEPS.git for use with NewGit.""" | 6 """Convert SVN based DEPS into .DEPS.git for use with NewGit.""" |
| 7 | 7 |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return 'xxx-r%s' % svn_rev | 39 return 'xxx-r%s' % svn_rev |
| 40 if repos_path: | 40 if repos_path: |
| 41 git_repo_path = os.path.join(repos_path, git_repo) | 41 git_repo_path = os.path.join(repos_path, git_repo) |
| 42 mirror = True | 42 mirror = True |
| 43 else: | 43 else: |
| 44 git_repo_path = os.path.join(workspace, dep_path) | 44 git_repo_path = os.path.join(workspace, dep_path) |
| 45 mirror = False | 45 mirror = False |
| 46 if not os.path.exists(git_repo_path): | 46 if not os.path.exists(git_repo_path): |
| 47 git_tools.Clone(git_url, git_repo_path, mirror) | 47 git_tools.Clone(git_url, git_repo_path, mirror) |
| 48 else: | 48 else: |
| 49 git_tools.Fetch(git_repo_path, mirror) | 49 git_tools.Fetch(git_repo_path, git_url, mirror) |
| 50 return git_tools.Search(git_repo_path, svn_rev, mirror) | 50 return git_tools.Search(git_repo_path, svn_rev, mirror) |
| 51 | 51 |
| 52 | 52 |
| 53 def ConvertDepsToGit(deps, repos, workspace, deps_type, deps_vars, | 53 def ConvertDepsToGit(deps, repos, workspace, deps_type, deps_vars, |
| 54 svn_deps_vars, verify): | 54 svn_deps_vars, verify): |
| 55 """Convert a 'deps' section in a DEPS file from SVN to Git.""" | 55 """Convert a 'deps' section in a DEPS file from SVN to Git.""" |
| 56 new_deps = {} | 56 new_deps = {} |
| 57 bad_git_urls = set([]) | 57 bad_git_urls = set([]) |
| 58 | 58 |
| 59 try: | 59 try: |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 return 0 | 183 return 0 |
| 184 | 184 |
| 185 # Write the DEPS file to disk. | 185 # Write the DEPS file to disk. |
| 186 deps_utils.WriteDeps(options.out, deps_vars, deps, deps_os, include_rules, | 186 deps_utils.WriteDeps(options.out, deps_vars, deps, deps_os, include_rules, |
| 187 skip_child_includes, hooks) | 187 skip_child_includes, hooks) |
| 188 return 0 | 188 return 0 |
| 189 | 189 |
| 190 | 190 |
| 191 if '__main__' == __name__: | 191 if '__main__' == __name__: |
| 192 sys.exit(main()) | 192 sys.exit(main()) |
| OLD | NEW |