Chromium Code Reviews| Index: deps2git.py |
| =================================================================== |
| --- deps2git.py (revision 255700) |
| +++ deps2git.py (working copy) |
| @@ -72,7 +72,8 @@ |
| return git_tools.Search(git_repo_path, svn_rev, mirror, refspec, git_url) |
| -def ConvertDepsToGit(deps, options, deps_vars, svn_deps_vars): |
| + |
| +def ConvertDepsToGit(deps, options, deps_vars): |
| """Convert a 'deps' section in a DEPS file from SVN to Git.""" |
| new_deps = {} |
| bad_git_urls = set([]) |
| @@ -84,11 +85,6 @@ |
| sys.path.insert(0, rules_dir) |
| svn_to_git_objs.insert(0, __import__(rules_file_base)) |
| - deps_overrides = {} |
| - # Allow extra_rules file to override rules in public file. |
| - for svn_to_git_obj in reversed(svn_to_git_objs): |
| - deps_overrides.update(getattr(svn_to_git_obj, 'DEPS_OVERRIDES', {})) |
| - |
| # Populate our deps list. |
| deps_to_process = {} |
| for dep, dep_url in deps.iteritems(): |
| @@ -154,7 +150,6 @@ |
| print line |
| pool.join() |
| - |
| for dep, items in deps_to_process.iteritems(): |
| git_url, dep_url, path, git_host, dep_rev, svn_branch = items |
| if options.verify: |
| @@ -178,24 +173,14 @@ |
| # Get the Git hash based off the SVN rev. |
| git_hash = '' |
| if dep_rev != 'HEAD': |
| - if dep in deps_overrides: |
| - # Transfer any required variables over from SVN DEPS. |
| - if not deps_overrides[dep] in svn_deps_vars: |
| - raise Exception('Missing DEPS variable: %s' % deps_overrides[dep]) |
| - deps_vars[deps_overrides[dep]] = ( |
| - '@' + svn_deps_vars[deps_overrides[dep]].lstrip('@')) |
| - # Tag this variable as needing a transform by Varify() later. |
| - git_hash = '%s_%s' % (deps_utils.VARIFY_MARKER_TAG_PREFIX, |
| - deps_overrides[dep]) |
| + # Pass-through the hash for Git repositories. Resolve the hash for |
| + # subversion repositories. |
| + if dep_url.endswith('.git'): |
| + git_hash = '@%s' % dep_rev |
| else: |
| - # Pass-through the hash for Git repositories. Resolve the hash for |
| - # subversion repositories. |
| - if dep_url.endswith('.git'): |
| - git_hash = '@%s' % dep_rev |
| - else: |
| - git_hash = '@%s' % SvnRevToGitHash( |
| - dep_rev, git_url, options.repos, options.workspace, path, |
| - git_host, svn_branch, options.cache_dir) |
| + git_hash = '@%s' % SvnRevToGitHash( |
| + dep_rev, git_url, options.repos, options.workspace, path, |
| + git_host, svn_branch, options.cache_dir) |
| # If this is webkit, we need to add the var for the hash. |
| if dep == 'src/third_party/WebKit' and dep_rev: |
| @@ -233,9 +218,8 @@ |
| options = parser.parse_args()[0] |
| # Get the content of the DEPS file. |
| - deps_content = deps_utils.GetDepsContent(options.deps) |
| - (deps, deps_os, include_rules, skip_child_includes, hooks, |
| - svn_deps_vars) = deps_content |
| + deps, deps_os, include_rules, skip_child_includes, hooks = ( |
| + deps_utils.GetDepsContent(options.deps)) |
| if options.extra_rules and options.type: |
| parser.error('Can\'t specify type and extra-rules at the same time.') |
| @@ -263,10 +247,10 @@ |
| } |
| # Convert the DEPS file to Git. |
| - deps, baddeps = ConvertDepsToGit(deps, options, deps_vars, svn_deps_vars) |
| + deps, baddeps = ConvertDepsToGit(deps, options, deps_vars) |
|
szager1
2014/03/07 22:43:53
There might be other uses of svn_deps_vars besides
DaleCurtis
2014/03/07 22:50:51
None exist at this time AFAICT so it seems better
szager1
2014/03/07 23:04:53
Yes, there are svn_to_git_*.py modules for interna
mmoss
2014/03/07 23:27:18
The only one I'm aware of doesn't have and DEPS_OV
DaleCurtis
2014/03/07 23:30:26
Yeah, I checked that one and didn't see any.
|
| for os_dep in deps_os: |
| deps_os[os_dep], os_bad_deps = ConvertDepsToGit( |
| - deps_os[os_dep], options, deps_vars, svn_deps_vars) |
| + deps_os[os_dep], options, deps_vars) |
| baddeps = baddeps.union(os_bad_deps) |
| if options.json: |