summaryrefslogtreecommitdiff
path: root/buildstream/_includes.py
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-08-08 16:49:19 +0200
committerQinusty <jrsmith9822@gmail.com>2018-08-21 08:44:34 +0000
commit18acd3ea4594e34b681f08db82e95b1078fb5d00 (patch)
treed172ce7ad8c7c08bf2165c08001fac9687b6b783 /buildstream/_includes.py
parentba74a128d5bd7f18574d0f61039a55f1f63d28b7 (diff)
downloadbuildstream-18acd3ea4594e34b681f08db82e95b1078fb5d00.tar.gz
Fix broken indentation after tracking.
Issue was introduced by 171e803f (include directive) and the fix was found courtesy of @Qinusty. This fixes also the include feature. Because elements are to be serialized, the included fragments need to use copy_tree when loaded. Related to #470.
Diffstat (limited to 'buildstream/_includes.py')
-rw-r--r--buildstream/_includes.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/buildstream/_includes.py b/buildstream/_includes.py
index e4afeaf82..acecd5e47 100644
--- a/buildstream/_includes.py
+++ b/buildstream/_includes.py
@@ -10,11 +10,15 @@ from ._exceptions import LoadError, LoadErrorReason
#
# Args:
# loader (Loader): The Loader object
+# copy_tree (bool): Whether to make a copy, of tree in
+# provenance. Should be true if intended to be
+# serialized.
class Includes:
- def __init__(self, loader):
+ def __init__(self, loader, *, copy_tree=False):
self._loader = loader
self._loaded = {}
+ self._copy_tree = copy_tree
# process()
#
@@ -99,7 +103,8 @@ class Includes:
if file_path not in self._loaded:
self._loaded[key] = _yaml.load(os.path.join(directory, include),
shortname=shortname,
- project=project)
+ project=project,
+ copy_tree=self._copy_tree)
return self._loaded[key], file_path, current_loader
# _process_value()