OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |