Interface VcsModificationHistoryEx

    • Method Detail

      • persistModification

        @Nullable
        SVcsModification persistModification​(@NotNull
                                             ModificationData modificationData,
                                             @NotNull
                                             Collection<SBuildType> relatedConfigurations)
        Persists modification if there is no modification in the same root with the same version.
        Parameters:
        modificationData - modification to persist
        relatedConfigurations - related configuration
        Returns:
        persisted modification or null if modification with specified version in specified root was already persisted.
      • getLastUserModifications

        List<SVcsModification> getLastUserModifications​(User user,
                                                        int numberOfActiveDays)
        Returns last stored modification detected for the specified user. Ordering: last modifications go first in the list
      • getLastModifications

        @NotNull
        List<SVcsModification> getLastModifications​(int numberOfActiveDays)
        Returns latest VCS modifications detected within the specified number of active days. Ordering: most recent modifications go first in the list
        Returns:
        see above
        Since:
        9.0.3
      • getModificationRelations

        @NotNull
        RelatedConfigurations getModificationRelations​(@NotNull
                                                       SVcsModification modification)
        Returns relations the given modification has to build configurations.
        Parameters:
        modification - modification of interest
        Returns:
        see above
        Since:
        9.0
      • getEdgeRelations

        @NotNull
        List<Map<String,​RelationType>> getEdgeRelations​(@NotNull
                                                              VcsModification childCommit)
        Returns list of relations for edges from parent commits to the given child commit. Index in the list is the number of the parent commit.
      • scheduleDetachPendingChangesFromBuildType

        void scheduleDetachPendingChangesFromBuildType​(@NotNull
                                                       SBuildType buildType,
                                                       @NotNull
                                                       SVcsRoot parentRoot)
      • detachPendingChangesFromBuildType

        void detachPendingChangesFromBuildType​(@NotNull
                                               SBuildType buildType,
                                               @NotNull
                                               SVcsRoot parentRoot)
      • getChangesCommitters

        @NotNull
        Set<SUser> getChangesCommitters​(@NotNull
                                        Collection<SVcsModification> changes,
                                        boolean ignoreNonPersonalCommitters)
        Returns committers from the specified collection of changes.
        Parameters:
        changes - changes collection
        ignoreNonPersonalCommitters - if true non personal changes committers will not be returned
        Returns:
        committers
      • getChangeDescriptorCommitters

        @NotNull
        Set<SUser> getChangeDescriptorCommitters​(@NotNull
                                                 Collection<ChangeDescriptor> changes,
                                                 boolean ignoreNonPersonalCommitters)
        Returns committers from the specified collection of change descriptors. Change descriptors for non-vcs changes are ignored.
        Parameters:
        changes - change descriptors collection
        ignoreNonPersonalCommitters - if true non personal changes committers will not be returned
        Returns:
        see above
      • getUserChangesCounter

        int getUserChangesCounter()
        Returns total number of times user accounts were changed/created or removed. This counter is used by VcsModification to check whether its committers cache is actual.
        Returns:
        see above
      • getDuplicates

        @NotNull
        Collection<SVcsModification> getDuplicates​(@NotNull
                                                   SVcsModification modification,
                                                   boolean byDisplayVersion)
        Get duplicate modifications for given one, (the given modification is not included)
        Parameters:
        modification - modification of interest
        byDisplayVersion - if true, modifications will be compared not by version but by displayVersion, which would join more modifications but modifications from different branches could be present (in a case of Perforce, at least)
        Returns:
        collection of duplicate modifications
        Since:
        6.0
      • getParentModifications

        @NotNull
        Collection<SVcsModification> getParentModifications​(@NotNull
                                                            SVcsModification modification)
        Get parent modifications of the given one. Returns an empty collection if VCS does not provide an information about parents or parents could not be found.
        Parameters:
        modification - modification of interest
        Returns:
        see above
        Since:
        7.0
      • getParentRevisions

        @NotNull
        List<String> getParentRevisions​(@NotNull
                                        SVcsModification modification)
        Get parent revisions of given modification. Returns an empty collection if VCS does not provide an information about parents or parents could not be found.
        Parameters:
        modification - modification of interest
        Returns:
        see above
        Since:
        7.1
      • getAttributes

        @NotNull
        Map<String,​String> getAttributes​(@NotNull
                                               SVcsModification modification)
        Load attributes of the given modification from DB.
        Parameters:
        modification - modification of interest
        Returns:
        see above
        Since:
        8.0
      • getAllUserModifications

        @NotNull
        List<SVcsModification> getAllUserModifications​(User user)
        Returns all VCS modifications of specified user
        Parameters:
        user - user of interest
        Returns:
        see above
        Since:
        6.0
      • processModifications

        void processModifications​(@NotNull
                                  ItemProcessor<SVcsModification> modificationsProcessor)
        This method traverses all VCS modifications and passed them to the modificationsProcessor. Once modificationsProcessor returns false, the traversing stops.
        Parameters:
        modificationsProcessor - SVcsModification items processor
        Since:
        2018.1
      • getUniqueModificationsIterator

        @NotNull
        Iterator<SVcsModification> getUniqueModificationsIterator​(List<SVcsModification> modifications)
        Returns iterator over list of VCS modifications. This iterator returns only unique (non-duplicate) modifications from specified collection.
        Parameters:
        modifications - list of VCS modifications
        Returns:
        see above
      • findModificationByVersion

        @Nullable
        SVcsModification findModificationByVersion​(@NotNull
                                                   VcsRootInstance root,
                                                   @NotNull
                                                   String version)
        Returns last modification with specified version in specified VCS root
        Parameters:
        root - VCS root of interest
        version - version of interest
        Returns:
        see above
      • findModificationIdByVersion

        @Nullable
        Long findModificationIdByVersion​(@NotNull
                                         VcsRootInstance root,
                                         @Nullable
                                         String version)
      • findModificationsByVersion

        @NotNull
        List<SVcsModification> findModificationsByVersion​(@NotNull
                                                          String version)
        Searches for all VCS modifications with given version VcsModification.getVersion() Ordering: most recent modifications go first in the list
        Parameters:
        version - VCS modification version
        Returns:
        collection of found modifications
        Since:
        2019.1.3
      • findModificationsByDisplayVersion

        @NotNull
        List<SVcsModification> findModificationsByDisplayVersion​(@NotNull
                                                                 String version)
        Searches for all VCS modifications with given display version VcsModification.getDisplayVersion() Ordering: most recent modifications go first in the list
        Parameters:
        version - VCS modification display version
        Returns:
        collection of found modifications
        Since:
        2019.1.3
      • getModificationIdDag

        @NotNull
        DAG<Long> getModificationIdDag​(@NotNull
                                       VcsRootInstance root)
        Returns a DAG of modification ids of specified VCS root instance
        Parameters:
        root - VCS root instance of interest
        Returns:
        see above
      • getModificationIdDag

        @NotNull
        DAG<Long> getModificationIdDag​(@NotNull
                                       VcsRootInstance root,
                                       @Nullable
                                       Long upperBoundModificationId,
                                       @Nullable
                                       Long lowerBoundModificationId)
        Returns a DAG of modification ids of specified VCS root instance in specified bounds. Both bounds can be null, which means open ended range
        Parameters:
        root - VCS root instance of interest
        upperBoundModificationId - upper bound
        lowerBoundModificationId - lower bound
        Returns:
        see above
      • getModificationsInVersionsRange

        @NotNull
        List<SVcsModification> getModificationsInVersionsRange​(@NotNull
                                                               VcsRootInstance root,
                                                               @Nullable
                                                               String lowerBoundVersion,
                                                               @Nullable
                                                               String upperBoundVersion)
        Returns the list of modifications for the specified root, between specified versions (lower bound is excluded, upper bound is included). Versions can be null, in this case open ended-intervals are used.
        Parameters:
        root - the VCS root which modifications will be returned
        fromVersion - result contains modifications which happened after modification with version fromVersion if it specified
        toVersion - result contains modifications which happened before modification with version toVersion or are the same modifications
        Returns:
        the list of detected modifications in the specified range
        See Also:
        VcsModificationHistory.getModificationsOrder(VcsRootInstance, String, String), VcsModificationOrder
      • getStateWithActiveBranches

        @NotNull
        RepositoryState getStateWithActiveBranches​(@NotNull
                                                   VcsRootInstance root,
                                                   @NotNull
                                                   RepositoryState state,
                                                   long maxBranchAgeMillis)
        Returns repository state which contains only active branches, i.e. branches with an age of the last modification smaller than the maxBranchAgeMillis.
        Parameters:
        root - VCS root of interest
        state - repository state to filter
        maxBranchAgeMillis - max age of branch in milliseconds
        Returns:
        see above
      • setModificationDescription

        void setModificationDescription​(long modificationId,
                                        @NotNull
                                        String newDescription)
        Set and save modification description for modification with given ID
        Parameters:
        modificationId -
        newDescription - non-empty new modification description
      • processBuildTypeModifications

        void processBuildTypeModifications​(@NotNull
                                           SBuildType buildType,
                                           @NotNull
                                           Predicate<VcsRootInstance> vcsRootInstancesFilter,
                                           @NotNull
                                           ItemProcessor<SVcsModification> processor,
                                           @NotNull
                                           Interval interval,
                                           @Nullable
                                           Date minRegistrationDate,
                                           int expiredCommitsMaxNum,
                                           RelationType... relationTypes)
        Processes VCS modifications related to specified build type within the specified interval. Most recent changes come first. Note: this processor traverses not only cached modifications but also expired once, which are already unloaded from the cache
        Parameters:
        buildType -
        vcsRootInstancesFilter - additional filter for VCS root instances, only SVcsModification objects from VCS roots accepted by this filter will be passed to the processor
        processor -
        startModId -
        minRegistrationDate -
        expiredCommitsMaxNum - max number of the expired commits to process (expired commit is one which exists in our DB but is unloaded from our in-memory cache), set to 0 to disable expired commits lookup
      • findExpiredModificationsRelatedToVcsRoot

        @NotNull
        List<SVcsModification> findExpiredModificationsRelatedToVcsRoot​(@NotNull
                                                                        VcsRootInstance vcsRootInstance,
                                                                        long startModId,
                                                                        int maxChangesToReturn)
        This method is similar to VcsModificationHistory.findChangeById(long) but it will search not only among cached changes, but also among changes that are already unloaded from the cache.
        Parameters:
        vcsRootInstance -
        startModId -
        Returns:
        VCS modification with specified id belonging to the specified VCS root instance
      • loadMissingVcsRootModifications

        void loadMissingVcsRootModifications​(@NotNull
                                             VcsRootInstance rootInstance)
        Loads VCS changes which could be persisted by some other node into the internal cache
        Parameters:
        rootInstance - root instance whose changes will be loaded
        Since:
        2020.2.1
      • isVcsCacheInitialized

        boolean isVcsCacheInitialized()
        Returns:
        true if VCS history cache is loaded from the database. Note: if the cache is not initialized, then many methods looking for SVcsModification instances will be hanging.
        Since:
        2023.11