| 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 collections | 8 import collections |
| 9 import json | 9 import json |
| 10 import optparse | 10 import optparse |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if mirror: | 92 if mirror: |
| 93 refspec = 'refs/branch-heads/' + svn_branch_name | 93 refspec = 'refs/branch-heads/' + svn_branch_name |
| 94 else: | 94 else: |
| 95 refspec = 'refs/remotes/branch-heads/' + svn_branch_name | 95 refspec = 'refs/remotes/branch-heads/' + svn_branch_name |
| 96 else: | 96 else: |
| 97 if mirror: | 97 if mirror: |
| 98 refspec = 'refs/heads/master' | 98 refspec = 'refs/heads/master' |
| 99 else: | 99 else: |
| 100 refspec = 'refs/remotes/origin/master' | 100 refspec = 'refs/remotes/origin/master' |
| 101 | 101 |
| 102 # Work-around for: |
| 103 # http://code.google.com/p/chromium/issues/detail?id=362222 |
| 104 if (git_url.startswith('https://chromium.googlesource.com/external/pefile') |
| 105 and int(svn_rev) == 63): |
| 106 return '1ceaa279daa62b71e3431e58f68be6a96dd1519a' |
| 107 |
| 102 try: | 108 try: |
| 103 return git_tools.Search(git_repo_path, svn_rev, mirror, refspec, git_url) | 109 return git_tools.Search(git_repo_path, svn_rev, mirror, refspec, git_url) |
| 104 except Exception: | 110 except Exception: |
| 105 print >> sys.stderr, '%s <-> ERROR' % git_repo_path | 111 print >> sys.stderr, '%s <-> ERROR' % git_repo_path |
| 106 raise | 112 raise |
| 107 | 113 |
| 108 def ConvertDepsToGit(deps, options, deps_vars, svn_deps_vars, svn_to_git_objs, | 114 def ConvertDepsToGit(deps, options, deps_vars, svn_deps_vars, svn_to_git_objs, |
| 109 deps_overrides): | 115 deps_overrides): |
| 110 """Convert a 'deps' section in a DEPS file from SVN to Git.""" | 116 """Convert a 'deps' section in a DEPS file from SVN to Git.""" |
| 111 new_deps = {} | 117 new_deps = {} |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 return 0 | 404 return 0 |
| 399 | 405 |
| 400 # Write the DEPS file to disk. | 406 # Write the DEPS file to disk. |
| 401 deps_utils.WriteDeps(options.out, deps_vars, deps, deps_os, include_rules, | 407 deps_utils.WriteDeps(options.out, deps_vars, deps, deps_os, include_rules, |
| 402 skip_child_includes, hooks) | 408 skip_child_includes, hooks) |
| 403 return 0 | 409 return 0 |
| 404 | 410 |
| 405 | 411 |
| 406 if '__main__' == __name__: | 412 if '__main__' == __name__: |
| 407 sys.exit(main()) | 413 sys.exit(main()) |
| OLD | NEW |