From f60d39620b29aeaf1addeb244bdd6e15ddf4894c Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 10 Sep 2024 18:51:20 +0200 Subject: Rename Compatibility class to ProtocolTraits ...and move it to the common stage. --- src/buildtool/serve_api/serve_service/source_tree.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/buildtool/serve_api/serve_service/source_tree.cpp') diff --git a/src/buildtool/serve_api/serve_service/source_tree.cpp b/src/buildtool/serve_api/serve_service/source_tree.cpp index acc29ba9..ed6fcae0 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.cpp +++ b/src/buildtool/serve_api/serve_service/source_tree.cpp @@ -24,7 +24,7 @@ #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/artifact_digest_factory.hpp" -#include "src/buildtool/compatibility/compatibility.hpp" +#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/git/git_api.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" @@ -287,7 +287,7 @@ auto SourceTreeService::SyncGitEntryToCas( std::string const& object_hash, std::filesystem::path const& repo_path) const noexcept -> std::remove_cvref_t { - if (IsTreeObject(kType) and Compatibility::IsCompatible()) { + if (IsTreeObject(kType) and ProtocolTraits::Instance().IsCompatible()) { logger_->Emit(LogLevel::Error, "Cannot sync tree {} from repository {} with " "the remote in compatible mode", @@ -984,7 +984,7 @@ auto SourceTreeService::ServeDistdirTree( 0, /*is_tree=*/false); - if (not Compatibility::IsCompatible()) { + if (not ProtocolTraits::Instance().IsCompatible()) { blob_found = digest and cas.BlobPath(*digest, kv.executable()); } if (blob_found) { @@ -1054,8 +1054,8 @@ auto SourceTreeService::ServeDistdirTree( } if (not blob_found) { // check remote CAS - if (not Compatibility::IsCompatible() and digest and - apis_.remote->IsAvailable(*digest)) { + if (not ProtocolTraits::Instance().IsCompatible() and + digest and apis_.remote->IsAvailable(*digest)) { // retrieve content to local CAS if (not apis_.remote->RetrieveToCas( {Artifact::ObjectInfo{ @@ -1320,7 +1320,7 @@ auto SourceTreeService::ServeTree( storage_config_.hash_function.GetType(), tree_id, 0, /*is_tree=*/true); if (digest and apis_.local->IsAvailable(*digest)) { // upload tree to remote CAS; only possible in native mode - if (Compatibility::IsCompatible()) { + if (ProtocolTraits::Instance().IsCompatible()) { logger_->Emit(LogLevel::Error, "Cannot sync tree {} from local CAS with the remote " "in compatible mode", -- cgit v1.2.3