diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-09 14:28:47 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 0e27a4b08ef0d7e23fc4d6b63f73f6ad7cee24cb (patch) | |
tree | 1ed44d99bf0aacaa27a218d070cfc06567c5b62c /src/buildstream/source.py | |
parent | c056a77b6bacad6f2edfbc5b6f0b65412a77f4ff (diff) | |
download | buildstream-0e27a4b08ef0d7e23fc4d6b63f73f6ad7cee24cb.tar.gz |
_yaml: Mark attributes in ProvenanceInformation as Buildstream-private
Users should not need to get access to any of those, and should only
need access to the ProvenanceInformation to print it.
Diffstat (limited to 'src/buildstream/source.py')
-rw-r--r-- | src/buildstream/source.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/buildstream/source.py b/src/buildstream/source.py index 5125169e8..f63142b3c 100644 --- a/src/buildstream/source.py +++ b/src/buildstream/source.py @@ -868,20 +868,20 @@ class Source(Plugin): node = toplevel_refs.lookup_ref(project.name, element_name, element_idx, write=True) if project is toplevel and not node: - node = provenance.node + node = provenance._node # Ensure the node is not from a junction - if not toplevel.ref_storage == ProjectRefStorage.PROJECT_REFS and provenance.project is not toplevel: - if provenance.project is project: + if not toplevel.ref_storage == ProjectRefStorage.PROJECT_REFS and provenance._project is not toplevel: + if provenance._project is project: self.warn("{}: Not persisting new reference in junctioned project".format(self)) - elif provenance.project is None: - assert provenance.filename == "" - assert provenance.shortname == "" + elif provenance._project is None: + assert provenance._filename == "" + assert provenance._shortname == "" raise SourceError("{}: Error saving source reference to synthetic node." .format(self)) else: raise SourceError("{}: Cannot track source in a fragment from a junction" - .format(provenance.shortname), + .format(provenance._shortname), reason="tracking-junction-fragment") # @@ -959,7 +959,7 @@ class Source(Plugin): else: provenance = node.get_node(key).get_provenance() - toplevel_node = provenance.toplevel + toplevel_node = provenance._toplevel # Get the path to whatever changed if action == 'add': @@ -969,10 +969,10 @@ class Source(Plugin): # We want the path to the node containing the key, not to the key path = full_path[:-1] - roundtrip_file = roundtrip_cache.get(provenance.filename) + roundtrip_file = roundtrip_cache.get(provenance._filename) if not roundtrip_file: - roundtrip_file = roundtrip_cache[provenance.filename] = _yaml.roundtrip_load( - provenance.filename, + roundtrip_file = roundtrip_cache[provenance._filename] = _yaml.roundtrip_load( + provenance._filename, allow_missing=True ) |