From f5fdeeba75bfe0946f8301f33bc8b0450ca75575 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 29 May 2017 16:53:00 +0900 Subject: source.py: Added _force_inconsistent() method For initializing a pipeline in a forcefully inconsistent state, this is required for pipelines which execute TrackQueues. --- buildstream/source.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'buildstream/source.py') diff --git a/buildstream/source.py b/buildstream/source.py index f6d2a6847..9109e79e4 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -204,13 +204,27 @@ class Source(Plugin): return self.__consistency # Bump local cached consistency state, this is done from - # the pipeline after the completion of fetch and track jobs. + # the pipeline after the successful completion of fetch + # and track jobs. # def _bump_consistency(self, consistency): if (self.__consistency is None or consistency > self.__consistency): self.__consistency = consistency + # Force a source to appear to be in an inconsistent state. + # + # This is used across the pipeline in sessions where the + # source in question are going to be tracked. This is important + # as it will prevent depending elements from producing cache + # keys until the source is RESOLVED and also prevent depending + # elements from being assembled until the source is CACHED. + # + def _force_inconsistent(self): + self.__consistency = Consistency.INCONSISTENT + + # Wrapper function around plugin provided fetch method + # def _fetch(self): self.fetch() -- cgit v1.2.1