From 93ebe4992c32b2588ae213a98c3e05d60c974a00 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Tue, 26 Nov 2019 18:40:23 +0000 Subject: element.py: Remove _get_consistency and introduce explicit methods This replaces the _get_consistency method by two methods: `_has_all_sources_resolved` and `_has_all_sources_cached` which allows a more fine grained control on what information is needed. --- src/buildstream/_pipeline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildstream/_pipeline.py') diff --git a/src/buildstream/_pipeline.py b/src/buildstream/_pipeline.py index 8d0a3b411..1a98fccf5 100644 --- a/src/buildstream/_pipeline.py +++ b/src/buildstream/_pipeline.py @@ -29,7 +29,7 @@ from pyroaring import BitMap # pylint: disable=no-name-in-module from ._exceptions import PipelineError from ._message import Message, MessageType from ._profile import Topics, PROFILER -from . import Scope, Consistency +from . import Scope from ._project import ProjectRefStorage from .types import _PipelineSelection @@ -340,7 +340,7 @@ class Pipeline: inconsistent_workspaced = [] with self._context.messenger.timed_activity("Checking sources"): for element in elements: - if element._get_consistency() == Consistency.INCONSISTENT: + if not element._has_all_sources_resolved(): if element._get_workspace(): inconsistent_workspaced.append(element) else: @@ -375,7 +375,7 @@ class Pipeline: uncached = [] with self._context.messenger.timed_activity("Checking sources"): for element in elements: - if element._get_consistency() < Consistency.CACHED and not element._has_all_sources_in_source_cache(): + if not element._has_all_sources_in_source_cache() and not element._has_all_sources_cached(): uncached.append(element) if uncached: -- cgit v1.2.1