diff options
-rw-r--r-- | buildstream/_context.py | 13 | ||||
-rw-r--r-- | buildstream/source.py | 6 |
2 files changed, 18 insertions, 1 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py index 332b2c020..3f5a4d62f 100644 --- a/buildstream/_context.py +++ b/buildstream/_context.py @@ -343,6 +343,19 @@ class Context(): self._message_handler(message, context=self) return + # _silence() + # + # A context manager to silence messages, this behaves in + # the same way as the `silent_nested` argument of the + # Context._timed_activity() context manager: especially + # important messages will not be silenced. + # + @contextmanager + def _silence(self): + self._push_message_depth(True) + yield + self._pop_message_depth() + # _timed_activity() # # Context manager for performing timed activities and logging those diff --git a/buildstream/source.py b/buildstream/source.py index d8c36ba99..849227967 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -296,7 +296,11 @@ class Source(Plugin): return if self.__consistency < Consistency.CACHED: - self.__consistency = self.get_consistency() + + # Source consistency interrogations are silent. + context = self._get_context() + with context._silence(): + self.__consistency = self.get_consistency() if self._has_workspace() and \ self.__consistency > Consistency.INCONSISTENT: |