You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 07:27:30 UTC

[buildstream] 02/07: element.py: _fetch_done only updates source state

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch shared/split_out_update_state
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit e41d330a9e632b2fb00e4b668cc88efcff7185e4
Author: Jonathan Maw <jo...@codethink.co.uk>
AuthorDate: Wed Apr 17 17:12:50 2019 +0100

    element.py: _fetch_done only updates source state
---
 buildstream/element.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/buildstream/element.py b/buildstream/element.py
index 5f4215e..bdedc50 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1835,7 +1835,12 @@ class Element(Plugin):
     def _fetch_done(self):
         # We are not updating the state recursively here since fetching can
         # never end up in updating them.
-        self._update_state()
+
+        # Fetching changes the source state from RESOLVED to CACHED
+        # Fetching cannot change the source state from INCONSISTENT to CACHED because
+        # we prevent fetching when it's INCONSISTENT.
+        # Therefore, only the source state will change.
+        self._update_source_state()
 
     # _pull_pending()
     #