Class 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 via getVisitedModifications(). Visitor notify PreviousPromotionsCallback specified in constructor about previous promotions which limit modifications.
    • Method Detail

      • setDag

        public void setDag​(@NotNull
                           DAG<Long> dag)
      • 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 id
        starts - 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: BFSVisitor
        Called when the node first discovered
        Specified by:
        discover in interface BFSVisitor<Long>
        Overrides:
        discover in class BFSVisitorAdapter<Long>
        Parameters:
        modId - discovered node
        Returns:
        true if node's parents should be visited, false otherwise
      • isAttachedToBuildType

        protected boolean isAttachedToBuildType​(@NotNull
                                                SVcsModification m)
      • containsNode

        public boolean containsNode​(long modId)