Package jetbrains.buildServer.vcs
Interface BranchSpec
-
- All Known Implementing Classes:
CompositeBranchSpec
,DefaultBranchSpec
,PatternBranchSpec
public interface BranchSpec
- Author:
- dmitry.neverov
-
-
Field Summary
Fields Modifier and Type Field Description static Option<Boolean>
ALLOW_DEFAULT_BRANCH
Deprecated.since 2024.07static Option<Boolean>
FALLBACK_TO_DEFAULT
Whether the default branch revision should be used when no matching vcs branch found
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RepositoryState
apply(RepositoryState state)
Apply this spec to the given repository stateString
asString()
Returns a string representation of this branch spec.String
getLogicalBranchName(String vcsBranchName)
Returns a logical name for given vcs branch name or null if branch spec doesn't match given vcs branchSet<String>
getLogicalBranchNames(RepositoryState state)
Returns set of logical branch names for given state.<T> T
getOption(Option<T> option)
Returns value of the specified option or its default value if such option is not specified in this specString
getVcsBranchName(RepositoryState state, String logicalBranchName)
Maps logical branch name to VCS branch name understandable by VCS plugin.Map<String,String>
getVcsBranchNames(RepositoryState state, Collection<String> logicalBranchNames)
Returns map of logical branch name to corresponding VCS branch name.boolean
isEmpty()
-
-
-
Method Detail
-
apply
@NotNull RepositoryState apply(@NotNull RepositoryState state)
Apply this spec to the given repository state- Parameters:
state
- repository state of interest- Returns:
- repository state containing only branches matched by this spec
-
getVcsBranchName
@Nullable String getVcsBranchName(@NotNull RepositoryState state, @NotNull String logicalBranchName)
Maps logical branch name to VCS branch name understandable by VCS plugin. Returns null if vcs branch name was not found.- Parameters:
state
- repository state of interestlogicalBranchName
- logical branch name- Returns:
- see above
-
getVcsBranchNames
@NotNull Map<String,String> getVcsBranchNames(@NotNull RepositoryState state, @NotNull Collection<String> logicalBranchNames)
Returns map of logical branch name to corresponding VCS branch name.- Parameters:
state
- repository state of interestlogicalBranchNames
- logical branch names- Returns:
- see above
- Since:
- 2020.1
-
getLogicalBranchNames
@NotNull Set<String> getLogicalBranchNames(@NotNull RepositoryState state)
Returns set of logical branch names for given state. This set doesn't include default branch name.- Parameters:
state
- repository state of interest- Returns:
- see above
-
getLogicalBranchName
@Nullable String getLogicalBranchName(@NotNull String vcsBranchName)
Returns a logical name for given vcs branch name or null if branch spec doesn't match given vcs branch- Parameters:
vcsBranchName
- vcs branch name of interest- Returns:
- see above
-
isEmpty
boolean isEmpty()
- Returns:
- true if this branch spec is empty, i.e. does not include any branch
-
asString
@NotNull String asString()
Returns a string representation of this branch spec. Branch spec can be re-created from string representation usingBranchSpecs#parse(String)
- Returns:
- see above
-
getOption
@NotNull <T> T getOption(@NotNull Option<T> option)
Returns value of the specified option or its default value if such option is not specified in this spec- Parameters:
option
- option of interest- Returns:
- see above
- Since:
- 2017.1
-
-