Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: ensure_dependencies.py

Issue 5135047623442432: Issue 1808 - ensure_dependencies.py generates wrong repository path for local roots (Closed)
Patch Set: Created Jan. 14, 2015, 9:23 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # coding: utf-8 2 # coding: utf-8
3 3
4 # This Source Code Form is subject to the terms of the Mozilla Public 4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 7
8 import sys 8 import sys
9 import os 9 import os
10 import posixpath 10 import posixpath
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return 180 return
181 181
182 parenttype = get_repo_type(parentrepo) 182 parenttype = get_repo_type(parentrepo)
183 type = None 183 type = None
184 for key in roots: 184 for key in roots:
185 if key == parenttype or (key in repo_types and type is None): 185 if key == parenttype or (key in repo_types and type is None):
186 type = key 186 type = key
187 if type is None: 187 if type is None:
188 raise Exception("No valid source found to create %s" % target) 188 raise Exception("No valid source found to create %s" % target)
189 189
190 url = urlparse.urljoin(roots[type], sourcename) 190 if os.path.exists(roots[type]):
191 url = os.path.join(roots[type], sourcename)
192 else:
193 url = urlparse.urljoin(roots[type], sourcename)
194
191 logging.info("Cloning repository %s into %s" % (url, target)) 195 logging.info("Cloning repository %s into %s" % (url, target))
192 repo_types[type].clone(url, target) 196 repo_types[type].clone(url, target)
193 197
194 for repo in repo_types.itervalues(): 198 for repo in repo_types.itervalues():
195 if repo.istype(parentrepo): 199 if repo.istype(parentrepo):
196 repo.ignore(target, parentrepo) 200 repo.ignore(target, parentrepo)
197 201
198 def update_repo(target, revisions): 202 def update_repo(target, revisions):
199 type = get_repo_type(target) 203 type = get_repo_type(target)
200 if type is None: 204 if type is None:
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 args = parser.parse_args() 290 args = parser.parse_args()
287 291
288 if args.quiet: 292 if args.quiet:
289 logging.disable(logging.INFO) 293 logging.disable(logging.INFO)
290 294
291 repos = args.repos 295 repos = args.repos
292 if not len(repos): 296 if not len(repos):
293 repos = [os.path.dirname(__file__)] 297 repos = [os.path.dirname(__file__)]
294 for repo in repos: 298 for repo in repos:
295 resolve_deps(repo) 299 resolve_deps(repo)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld