summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-02 11:35:51 +0100
committerAlberto Sartori <alberto.sartori@huawei.com>2023-11-15 20:19:18 +0100
commit40ed3ee050e0fc3d0f41fc46f7360d28b9a1f7cc (patch)
treee1096799ec23b3ae5009cbbead98ee5db559e54a /src/other_tools/root_maps
parente2e0e3b4e92885dd74127aacaabb0c5f3ba86ce7 (diff)
downloadjustbuild-40ed3ee050e0fc3d0f41fc46f7360d28b9a1f7cc.tar.gz
just-mr: Update to using the static methods of ServeApi
Diffstat (limited to 'src/other_tools/root_maps')
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp16
-rw-r--r--src/other_tools/root_maps/commit_git_map.hpp2
-rw-r--r--src/other_tools/root_maps/content_git_map.cpp10
-rw-r--r--src/other_tools/root_maps/content_git_map.hpp2
4 files changed, 15 insertions, 15 deletions
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp
index ad269b5e..35d162f9 100644
--- a/src/other_tools/root_maps/commit_git_map.cpp
+++ b/src/other_tools/root_maps/commit_git_map.cpp
@@ -94,7 +94,7 @@ void EnsureCommit(GitRepoInfo const& repo_info,
gsl::not_null<ImportToGitMap*> const& import_to_git_map,
std::string const& git_bin,
std::vector<std::string> const& launcher,
- ServeApi* serve_api,
+ bool serve_api_exists,
IExecutionApi* local_api,
IExecutionApi* remote_api,
bool fetch_absent,
@@ -176,11 +176,11 @@ void EnsureCommit(GitRepoInfo const& repo_info,
JustMRProgress::Instance().TaskTracker().Start(repo_info.origin);
// check if commit is known to remote serve service, if asked for an
// absent root
- if (serve_api != nullptr) {
+ if (serve_api_exists) {
// if fetching absent, request (and sync) the whole commit tree,
// to ensure we maintain the id file association
if (fetch_absent) {
- if (auto root_tree_id = serve_api->RetrieveTreeFromCommit(
+ if (auto root_tree_id = ServeApi::RetrieveTreeFromCommit(
repo_info.hash,
/*subdir = */ ".",
/*sync_tree = */ true)) {
@@ -315,7 +315,7 @@ void EnsureCommit(GitRepoInfo const& repo_info,
}
// if not fetching absent, request the subdir tree directly
else {
- if (auto tree_id = serve_api->RetrieveTreeFromCommit(
+ if (auto tree_id = ServeApi::RetrieveTreeFromCommit(
repo_info.hash,
repo_info.subdir,
/*sync_tree = */ false)) {
@@ -624,7 +624,7 @@ auto CreateCommitGitMap(
MirrorsPtr const& additional_mirrors,
std::string const& git_bin,
std::vector<std::string> const& launcher,
- ServeApi* serve_api,
+ bool serve_api_exists,
IExecutionApi* local_api,
IExecutionApi* remote_api,
bool fetch_absent,
@@ -635,7 +635,7 @@ auto CreateCommitGitMap(
additional_mirrors,
git_bin,
launcher,
- serve_api,
+ serve_api_exists,
local_api,
remote_api,
fetch_absent](auto ts,
@@ -675,7 +675,7 @@ auto CreateCommitGitMap(
import_to_git_map,
git_bin,
launcher,
- serve_api,
+ serve_api_exists,
local_api,
remote_api,
fetch_absent,
@@ -708,7 +708,7 @@ auto CreateCommitGitMap(
import_to_git_map,
git_bin,
launcher,
- serve_api,
+ serve_api_exists,
local_api,
remote_api,
fetch_absent,
diff --git a/src/other_tools/root_maps/commit_git_map.hpp b/src/other_tools/root_maps/commit_git_map.hpp
index 70623598..4bf4100b 100644
--- a/src/other_tools/root_maps/commit_git_map.hpp
+++ b/src/other_tools/root_maps/commit_git_map.hpp
@@ -76,7 +76,7 @@ using CommitGitMap =
MirrorsPtr const& additional_mirrors,
std::string const& git_bin,
std::vector<std::string> const& launcher,
- ServeApi* serve_api,
+ bool serve_api_exists,
IExecutionApi* local_api,
IExecutionApi* remote_api,
bool fetch_absent,
diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp
index 79500f5d..344fec0b 100644
--- a/src/other_tools/root_maps/content_git_map.cpp
+++ b/src/other_tools/root_maps/content_git_map.cpp
@@ -306,7 +306,7 @@ auto CreateContentGitMap(
CAInfoPtr const& ca_info,
gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
- ServeApi* serve_api,
+ bool serve_api_exists,
IExecutionApi* local_api,
IExecutionApi* remote_api,
bool fetch_absent,
@@ -318,7 +318,7 @@ auto CreateContentGitMap(
just_mr_paths,
additional_mirrors,
ca_info,
- serve_api,
+ serve_api_exists,
local_api,
remote_api,
fetch_absent](auto ts,
@@ -469,13 +469,13 @@ auto CreateContentGitMap(
return;
}
// check if content is known to remote serve service
- if (serve_api != nullptr) {
+ if (serve_api_exists) {
// if fetching absent, request (and sync) the whole archive
// tree, UNRESOLVED, to ensure we maintain the id file
// association
if (fetch_absent) {
if (auto root_tree_id =
- serve_api->RetrieveTreeFromArchive(
+ ServeApi::RetrieveTreeFromArchive(
key.archive.content,
key.repo_type,
/*subdir = */ ".",
@@ -810,7 +810,7 @@ auto CreateContentGitMap(
// if not fetching absent, request the resolved subdir
// tree directly
else {
- if (auto tree_id = serve_api->RetrieveTreeFromArchive(
+ if (auto tree_id = ServeApi::RetrieveTreeFromArchive(
key.archive.content,
key.repo_type,
key.subdir,
diff --git a/src/other_tools/root_maps/content_git_map.hpp b/src/other_tools/root_maps/content_git_map.hpp
index 986a0531..4dc3180e 100644
--- a/src/other_tools/root_maps/content_git_map.hpp
+++ b/src/other_tools/root_maps/content_git_map.hpp
@@ -38,7 +38,7 @@ using ContentGitMap =
CAInfoPtr const& ca_info,
gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
- ServeApi* serve_api,
+ bool serve_api_exists,
IExecutionApi* local_api,
IExecutionApi* remote_api,
bool fetch_absent,