9 #include <unordered_map> 10 #include <unordered_set> 13 #include "../helpers/String.h" 32 std::chrono::year_month_day
eol;
70 static std::optional<Branches>
create();
82 auto begin() const noexcept {
return m_map.begin(); }
87 auto end() const noexcept {
return m_map.end(); }
99 return m_map.find(branch)->second;
132 void dfs(std::string_view u,
BranchesSet &visited)
const;
136 static std::chrono::year_month_day parseDate(std::string_view date);
137 static bool isExcluded(std::string_view branch);
Equality test for string and string_view to be used in containers.
Definition: String.h:250
Hash for string and string_view to be used in hashing containers.
Definition: String.h:223
static std::optional< BranchesList > getBuildBranches()
Download branches.conf and convert it to a list of branches which are built.
BranchesList filter(unsigned include=ANY, unsigned exclude=EXCLUDED) const
Obtain BranchesList according to a filter specified by include and exclude.
bool isExcluded
One of master, stable, vanilla, or similar branches.
Definition: Branches.h:29
const BranchProps & props(std::string_view branch) const
Return BranchProps for branch.
Definition: Branches.h:98
BranchesSet mergesClosure(std::string_view branch) const
Closure of branches that the specified branch merges.
Parse branches.conf into a map of branch -> properties (BranchProps)
Definition: Branches.h:41
std::unordered_set< std::string > BranchesSet
A set of branches.
Definition: Branches.h:52
auto begin() const noexcept
Obtain begin iterator of branches.
Definition: Branches.h:82
Filter
Constants used for filter()
Definition: Branches.h:44
Properties of a branch stored in Branches.
Definition: Branches.h:20
std::chrono::year_month_day eol
End of life for the branch.
Definition: Branches.h:32
bool isPublish
Marked as publish in branches.conf.
Definition: Branches.h:27
Definition: Branches.h:15
static std::optional< Branches > create()
Download branches.conf and parse it into Branches.
BranchProps::BranchesList BranchesList
A list of branches.
Definition: Branches.h:54
auto end() const noexcept
Obtain end iterator of branches.
Definition: Branches.h:87
bool isBuild
Marked as build in branches.conf.
Definition: Branches.h:25
std::vector< std::string > BranchesList
List of branches.
Definition: Branches.h:22
std::unordered_map< std::string, BranchProps, SlHelpers::String::Hash, SlHelpers::String::Eq > BranchesMap
Branch -> BranchProps mapping.
Definition: Branches.h:57
BranchesList merges
What immediate branches this branch merges.
Definition: Branches.h:35
const BranchesList & merges(std::string_view branch) const
Immediate branches that the specified branch merges.
Definition: Branches.h:107
const BranchesMap & map() const noexcept
Obtain whole branch map.
Definition: Branches.h:76