This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch traveltissues/mr4 in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 7acfddd3e27eda65696dcc81d81a578948ddb2fa Author: Darius Makovsky <[email protected]> AuthorDate: Tue Dec 10 14:11:22 2019 +0000 Support properties in import_files() --- src/buildstream/storage/_casbaseddirectory.py | 2 +- src/buildstream/storage/_filebaseddirectory.py | 9 ++++++++- src/buildstream/storage/directory.py | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py index 4698404..bfa3f82 100644 --- a/src/buildstream/storage/_casbaseddirectory.py +++ b/src/buildstream/storage/_casbaseddirectory.py @@ -356,7 +356,7 @@ class CasBasedDirectory(Directory): # content into this CasBasedDirectory using CAS-to-CAS import # to write the report, handle possible conflicts (if the target # directory is not empty) and apply the optional filter. - digest = self.cas_cache.import_directory(external_pathspec) + digest = self.cas_cache.import_directory(external_pathspec, properties=properties) external_pathspec = CasBasedDirectory(self.cas_cache, digest=digest) assert isinstance(external_pathspec, CasBasedDirectory) diff --git a/src/buildstream/storage/_filebaseddirectory.py b/src/buildstream/storage/_filebaseddirectory.py index 222b479..95d113e 100644 --- a/src/buildstream/storage/_filebaseddirectory.py +++ b/src/buildstream/storage/_filebaseddirectory.py @@ -79,7 +79,14 @@ class FileBasedDirectory(Directory): return current_dir def import_files( - self, external_pathspec, *, filter_callback=None, report_written=True, update_mtime=False, can_link=False + self, + external_pathspec, + *, + filter_callback=None, + report_written=True, + update_mtime=False, + can_link=False, + properties=None ): """ See superclass Directory for arguments """ diff --git a/src/buildstream/storage/directory.py b/src/buildstream/storage/directory.py index 89d20c4..4cec772 100644 --- a/src/buildstream/storage/directory.py +++ b/src/buildstream/storage/directory.py @@ -32,7 +32,7 @@ See also: :ref:`sandboxing`. """ -from typing import Callable, Optional, Union +from typing import Callable, Optional, Union, List from .._exceptions import BstError, ErrorDomain from ..types import FastEnum @@ -82,7 +82,8 @@ class Directory: filter_callback: Optional[Callable[[str], bool]] = None, report_written: bool = True, update_mtime: bool = False, - can_link: bool = False + can_link: bool = False, + properties: Optional[List[str]] = None ) -> FileListResult: """Imports some or all files from external_path into this directory. @@ -103,6 +104,8 @@ class Directory: original files change. Setting this doesn't guarantee hard links will be made. can_link will never be used if update_mtime is set. + properties: Optional list of strings representing file properties + to capture when importing. Yields: A report of files imported and overwritten.
