This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch tpollard/artifacttemp in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit b8f79fea99142c5025588ae7f1266e64884d0d3a Author: Tom Pollard <[email protected]> AuthorDate: Thu Apr 25 11:01:06 2019 +0100 _cas/cascache.py: Remove contains_subdir_artifact() This method is no longer used and as such can be removed. --- buildstream/_artifactcache.py | 17 ----------------- buildstream/_cas/cascache.py | 22 ---------------------- 2 files changed, 39 deletions(-) diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py index e40ba54..99ee9c0 100644 --- a/buildstream/_artifactcache.py +++ b/buildstream/_artifactcache.py @@ -181,23 +181,6 @@ class ArtifactCache(BaseCache): return os.path.exists(os.path.join(self.artifactdir, ref)) - # contains_subdir_artifact(): - # - # Check whether an artifact element contains a digest for a subdir - # which is populated in the cache, i.e non dangling. - # - # Args: - # element (Element): The Element to check - # key (str): The cache key to use - # subdir (str): The subdir to check - # with_files (bool): Whether to check files as well - # - # Returns: True if the subdir exists & is populated in the cache, False otherwise - # - def contains_subdir_artifact(self, element, key, subdir, *, with_files=True): - ref = element.get_artifact_name(key) - return self.cas.contains_subdir_artifact(ref, subdir, with_files=with_files) - # list_artifacts(): # # List artifacts in this cache in LRU order. diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py index 6d76de1..ad8013d 100644 --- a/buildstream/_cas/cascache.py +++ b/buildstream/_cas/cascache.py @@ -116,28 +116,6 @@ class CASCache(): # This assumes that the repository doesn't have any dangling pointers return os.path.exists(refpath) - # contains_subdir_artifact(): - # - # Check whether the specified artifact element tree has a digest for a subdir - # which is populated in the cache, i.e non dangling. - # - # Args: - # ref (str): The ref to check - # subdir (str): The subdir to check - # with_files (bool): Whether to check files as well - # - # Returns: True if the subdir exists & is populated in the cache, False otherwise - # - def contains_subdir_artifact(self, ref, subdir, *, with_files=True): - tree = self.resolve_ref(ref) - - try: - subdirdigest = self._get_subdir(tree, subdir) - - return self.contains_directory(subdirdigest, with_files=with_files) - except (CASCacheError, FileNotFoundError): - return False - # contains_directory(): # # Check whether the specified directory and subdirecotires are in the cache,
