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

Side by Side Diff: ensure_dependencies.py

Issue 5153846628188160: Noissue - Added missing return in ensure_dependencies.py when exceeding max depth (Closed)
Patch Set: Created May 4, 2015, 12:44 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 repo_types[type].update(target, resolved_revision) 240 repo_types[type].update(target, resolved_revision)
241 241
242 def resolve_deps(repodir, level=0, self_update=True, overrideroots=None, skipdep endencies=set()): 242 def resolve_deps(repodir, level=0, self_update=True, overrideroots=None, skipdep endencies=set()):
243 config = read_deps(repodir) 243 config = read_deps(repodir)
244 if config is None: 244 if config is None:
245 if level == 0: 245 if level == 0:
246 logging.warning("No dependencies file in directory %s, nothing to do...\n% s" % (repodir, USAGE)) 246 logging.warning("No dependencies file in directory %s, nothing to do...\n% s" % (repodir, USAGE))
247 return 247 return
248 if level >= 10: 248 if level >= 10:
249 logging.warning("Too much subrepository nesting, ignoring %s" % repo) 249 logging.warning("Too much subrepository nesting, ignoring %s" % repo)
250 return
250 251
251 if overrideroots is not None: 252 if overrideroots is not None:
252 config["_root"] = overrideroots 253 config["_root"] = overrideroots
253 254
254 for dir, revisions in config.iteritems(): 255 for dir, revisions in config.iteritems():
255 if dir.startswith("_") or revisions["_source"] in skipdependencies: 256 if dir.startswith("_") or revisions["_source"] in skipdependencies:
256 continue 257 continue
257 target = safe_join(repodir, dir) 258 target = safe_join(repodir, dir)
258 ensure_repo(repodir, target, config.get("_root", {}), revisions["_source"]) 259 ensure_repo(repodir, target, config.get("_root", {}), revisions["_source"])
259 update_repo(target, revisions) 260 update_repo(target, revisions)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 args = parser.parse_args() 304 args = parser.parse_args()
304 305
305 if args.quiet: 306 if args.quiet:
306 logging.disable(logging.INFO) 307 logging.disable(logging.INFO)
307 308
308 repos = args.repos 309 repos = args.repos
309 if not len(repos): 310 if not len(repos):
310 repos = [os.path.dirname(__file__)] 311 repos = [os.path.dirname(__file__)]
311 for repo in repos: 312 for repo in repos:
312 resolve_deps(repo) 313 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