Class ChangesCalculatorDagVisitor
- java.lang.Object
-
- jetbrains.buildServer.util.graph.BFSVisitorAdapter<Long>
-
- jetbrains.buildServer.serverSide.impl.ChangesCalculatorDagVisitor
-
- All Implemented Interfaces:
BFSVisitor<Long>
public class ChangesCalculatorDagVisitor extends BFSVisitorAdapter<Long>
Iterates through DAG until reaches modifications for which there is a promotion, i.e.FindPromotionStrategy.forModification(modification)returns not null. When iteration is over, all visited modifications can be retrieved viagetVisitedModifications(). Visitor notifyPreviousPromotionsCallbackspecified in constructor about previous promotions which limit modifications.
-
-
Constructor Summary
Constructors Constructor Description ChangesCalculatorDagVisitor(VcsModificationHistoryEx vcsHistory, VcsRootInstance root, SBuildType buildType, FindPromotionStrategy findPromotion, PreviousPromotionsCallback prevPromotionsCallback, EndpointsCallback endpointsCallback, VcsModificationProcessor modificationDiscoveredCallback, Set<RelationType> relations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsNode(long modId)booleandiscover(Long modId)Called when the node first discoveredvoidexclude(DefaultBranchChangesMode mode, long modId, Set<Long> starts)Excludes all commits reachable from the modification with specified modId according to the specified mode.protected SVcsModificationfindChangeById(Long modId)List<SVcsModification>getVisitedModifications()protected booleanisAttachedToBuildType(SVcsModification m)voidreturnModificationsNotAttachedToBuildType()Makes visitor return all visited modifications, even those which are not attached to the buildType specified in the constructor.voidsearchFinished()Called when search is finishedvoidsetDag(DAG<Long> dag)
-
-
-
Constructor Detail
-
ChangesCalculatorDagVisitor
public ChangesCalculatorDagVisitor(@NotNull VcsModificationHistoryEx vcsHistory, @NotNull VcsRootInstance root, @NotNull SBuildType buildType, @NotNull FindPromotionStrategy findPromotion, @NotNull PreviousPromotionsCallback prevPromotionsCallback, @NotNull EndpointsCallback endpointsCallback, @NotNull VcsModificationProcessor modificationDiscoveredCallback, @NotNull Set<RelationType> relations)
-
-
Method Detail
-
getVisitedModifications
@NotNull public List<SVcsModification> getVisitedModifications()
-
exclude
public void exclude(@NotNull DefaultBranchChangesMode mode, long modId, @NotNull Set<Long> starts)Excludes all commits reachable from the modification with specified modId according to the specified mode. Should be called after dag is set.- Parameters:
modId- modification idstarts- nodes from which traversal will start
-
returnModificationsNotAttachedToBuildType
public void returnModificationsNotAttachedToBuildType()
Makes visitor return all visited modifications, even those which are not attached to the buildType specified in the constructor. By default visitor returns only modifications attached to buildType specified in the constructor. Include all modifications is useful when calculate changes from overriden roots, since the are not attached to buildType.
-
discover
public boolean discover(@NotNull Long modId)Description copied from interface:BFSVisitorCalled when the node first discovered- Specified by:
discoverin interfaceBFSVisitor<Long>- Overrides:
discoverin classBFSVisitorAdapter<Long>- Parameters:
modId- discovered node- Returns:
- true if node's parents should be visited, false otherwise
-
findChangeById
protected SVcsModification findChangeById(@NotNull Long modId)
-
searchFinished
public void searchFinished()
Description copied from interface:BFSVisitorCalled when search is finished- Specified by:
searchFinishedin interfaceBFSVisitor<Long>- Overrides:
searchFinishedin classBFSVisitorAdapter<Long>
-
isAttachedToBuildType
protected boolean isAttachedToBuildType(@NotNull SVcsModification m)
-
containsNode
public boolean containsNode(long modId)
-
-