Benjamin Schubert pushed to branch bschubert/rework-circular-check at BuildStream / buildstream
Commits:
-
3b9c2b4a
by Benjamin Schubert at 2019-02-12T17:07:14Z
-
d0d5d5cc
by Benjamin Schubert at 2019-02-12T17:07:49Z
2 changed files:
Changes:
... | ... | @@ -110,7 +110,7 @@ class LoadElement(): |
110 | 110 |
# LoadError: if adding the current dependency would create a circular
|
111 | 111 |
# dependency
|
112 | 112 |
#
|
113 |
- def _add_dependency(self, dependency, dep_type):
|
|
113 |
+ def add_dependency(self, dependency, dep_type):
|
|
114 | 114 |
self.dependencies.append(LoadElement.Dependency(dependency, dep_type))
|
115 | 115 |
self._dep_cache.update(dependency._dep_cache)
|
116 | 116 |
self._dep_cache.add(dependency._node_id)
|
... | ... | @@ -136,7 +136,7 @@ class LoadElement(): |
136 | 136 |
# Raises:
|
137 | 137 |
# (LoadError): In case there was a circular dependency
|
138 | 138 |
#
|
139 |
- def _ensure_no_circular_deps(self):
|
|
139 |
+ def ensure_no_circular_deps(self):
|
|
140 | 140 |
if self._node_id in self._dep_cache:
|
141 | 141 |
self._find_circular_deps(set(), set(), [])
|
142 | 142 |
|
... | ... | @@ -256,12 +256,12 @@ class Loader(): |
256 | 256 |
"{}: Cannot depend on junction"
|
257 | 257 |
.format(dep.provenance))
|
258 | 258 |
|
259 |
- element._add_dependency(dep_element, dep.dep_type)
|
|
259 |
+ element.add_dependency(dep_element, dep.dep_type)
|
|
260 | 260 |
|
261 | 261 |
deps_names = [dep.name for dep in dependencies]
|
262 | 262 |
self._warn_invalid_elements(deps_names)
|
263 | 263 |
|
264 |
- element._ensure_no_circular_deps()
|
|
264 |
+ element.ensure_no_circular_deps()
|
|
265 | 265 |
|
266 | 266 |
return element
|
267 | 267 |
|