diff options
author | Valentin David <valentin.david@codethink.co.uk> | 2018-07-06 14:57:07 +0200 |
---|---|---|
committer | Valentin David <valentin.david@codethink.co.uk> | 2018-07-06 15:40:51 +0200 |
commit | e3756d428adcc31b7554539f795b86cc6ab1fe1f (patch) | |
tree | db9bbc72de4bde0f26d09f8c2d135a0b235a9431 | |
parent | 52b6b40838ba590de53d181b449fd337730baae0 (diff) | |
download | buildstream-e3756d428adcc31b7554539f795b86cc6ab1fe1f.tar.gz |
Inverse priority of in include composition
-rw-r--r-- | buildstream/_includes.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/buildstream/_includes.py b/buildstream/_includes.py index 3640f7ae5..277977355 100644 --- a/buildstream/_includes.py +++ b/buildstream/_includes.py @@ -1,4 +1,5 @@ import os +import copy from collections import Mapping from . import _yaml from ._exceptions import LoadError, LoadErrorReason @@ -39,8 +40,16 @@ class Includes: only_local=only_local) finally: included.remove(file_path) - _yaml.composite(node, include_node) + old_node = copy.copy(node) + while True: + try: + node.popitem() + except KeyError: + break + _yaml.composite(node, include_node) + _yaml.composite(node, old_node) + for _, value in _yaml.node_items(node): self._process_value(value, current_loader=current_loader, only_local=only_local) |