summaryrefslogtreecommitdiff
path: root/buildstream/source.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-05-29 16:53:00 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-05-29 17:17:37 +0900
commitf5fdeeba75bfe0946f8301f33bc8b0450ca75575 (patch)
tree3c302cb8be5522d4c922d3bb0a82af21a764274c /buildstream/source.py
parente60fbe44b1d3b2fdcd71d8d64b30ae08337bac6b (diff)
downloadbuildstream-f5fdeeba75bfe0946f8301f33bc8b0450ca75575.tar.gz
source.py: Added _force_inconsistent() method
For initializing a pipeline in a forcefully inconsistent state, this is required for pipelines which execute TrackQueues.
Diffstat (limited to 'buildstream/source.py')
-rw-r--r--buildstream/source.py16
1 files changed, 15 insertions, 1 deletions
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()