From 669d1d8714b258ffd19f1610028374233a143f4b Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 8 Sep 2023 18:15:01 +0200 Subject: just-mr: Implement 'absent' roots ...via an 'absent' pragma in repository descriptions. For 'git'-type repositories, first interrogates a 'just serve' remote, if given, before reverting to fetching from the network. --- src/other_tools/root_maps/commit_git_map.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/other_tools/root_maps/commit_git_map.hpp') diff --git a/src/other_tools/root_maps/commit_git_map.hpp b/src/other_tools/root_maps/commit_git_map.hpp index 1e702e3a..00a607cb 100644 --- a/src/other_tools/root_maps/commit_git_map.hpp +++ b/src/other_tools/root_maps/commit_git_map.hpp @@ -19,6 +19,7 @@ #include #include "nlohmann/json.hpp" +#include "src/buildtool/serve_api/remote/serve_api.hpp" #include "src/other_tools/just_mr/utils.hpp" #include "src/other_tools/ops_maps/critical_git_op_map.hpp" #include "src/utils/cpp/hash_combine.hpp" @@ -33,10 +34,13 @@ struct GitRepoInfo { std::string origin{}; // create root that ignores symlinks bool ignore_special{}; /* key */ + // create an absent root + bool absent{}; /* key */ [[nodiscard]] auto operator==(const GitRepoInfo& other) const -> bool { return hash == other.hash and subdir == other.subdir and - ignore_special == other.ignore_special; + ignore_special == other.ignore_special and + absent == other.absent; } }; @@ -49,6 +53,7 @@ struct hash { hash_combine(&seed, ct.hash); hash_combine(&seed, ct.subdir); hash_combine(&seed, ct.ignore_special); + hash_combine(&seed, ct.absent); return seed; } }; @@ -64,6 +69,7 @@ using CommitGitMap = JustMR::PathsPtr const& just_mr_paths, std::string const& git_bin, std::vector const& launcher, + ServeApi* serve_api, std::size_t jobs) -> CommitGitMap; #endif // INCLUDED_SRC_OTHER_TOOLS_ROOT_MAPS_COMMIT_GIT_MAP_HPP -- cgit v1.2.3