summaryrefslogtreecommitdiff
path: root/src/buildstream/_frontend
diff options
context:
space:
mode:
authorBenjamin Schubert <bschubert15@bloomberg.net>2019-11-26 18:40:23 +0000
committerBenjamin Schubert <contact@benschubert.me>2020-01-16 14:36:35 +0000
commit93ebe4992c32b2588ae213a98c3e05d60c974a00 (patch)
tree0805dadc7f75ee208c46b08bada7b4ba13752acb /src/buildstream/_frontend
parentc48e89d5da3a7b2b2e72d536aaea9ec182d1e1fd (diff)
downloadbuildstream-93ebe4992c32b2588ae213a98c3e05d60c974a00.tar.gz
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.
Diffstat (limited to 'src/buildstream/_frontend')
-rw-r--r--src/buildstream/_frontend/widget.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/buildstream/_frontend/widget.py b/src/buildstream/_frontend/widget.py
index 44922cac8..fcc951d00 100644
--- a/src/buildstream/_frontend/widget.py
+++ b/src/buildstream/_frontend/widget.py
@@ -27,7 +27,7 @@ from ruamel import yaml
import click
from .profile import Profile
-from .. import Consistency, Scope
+from .. import Scope
from .. import __version__ as bst_version
from .._exceptions import ImplError
from .._message import MessageType
@@ -346,8 +346,7 @@ class LogLine(Widget):
line = p.fmt_subst(line, "key", cache_key, fg="yellow", dim=dim_keys)
line = p.fmt_subst(line, "full-key", full_key, fg="yellow", dim=dim_keys)
- consistency = element._get_consistency()
- if consistency == Consistency.INCONSISTENT:
+ if not element._has_all_sources_resolved():
line = p.fmt_subst(line, "state", "no reference", fg="red")
else:
if element.get_kind() == "junction":
@@ -356,7 +355,7 @@ class LogLine(Widget):
line = p.fmt_subst(line, "state", "failed", fg="red")
elif element._cached_success():
line = p.fmt_subst(line, "state", "cached", fg="magenta")
- elif consistency == Consistency.RESOLVED and not element._has_all_sources_in_source_cache():
+ elif not element._has_all_sources_in_source_cache() and not element._has_all_sources_cached():
line = p.fmt_subst(line, "state", "fetch needed", fg="red")
elif element._buildable():
line = p.fmt_subst(line, "state", "buildable", fg="green")