Interface SVcsModification

    • Method Detail

      • getVcsRoot

        @NotNull
        VcsRootInstance getVcsRoot()
                            throws VcsRootNotFoundException
        For non-personal modifications returns VCS root where this modification occurred. For personal modifications throws UnsupportedOperationException because personal modification can be from several VCS roots simultaneously.
        Returns:
        vcs root instance.
        Throws:
        VcsRootNotFoundException
      • isCommitter

        boolean isCommitter​(@NotNull
                            User user)
        Returns if the specified user is committer for the modification.
        Parameters:
        user - specified user.
        Returns:
        if the specified user is committer for the modification.
      • getCommitterIds

        @NotNull
        java.util.List<java.lang.Long> getCommitterIds()
        Returns ids of TeamCity users mapped to this VCS modification by VCS username.
        Returns:
        ids of the committers to this change.
      • getCommitters

        @NotNull
        java.util.Collection<SUser> getCommitters()
        Returns:
        collection of TeamCity users mapped to this VCS modification by VCS username.
        Since:
        6.5
      • getRelatedConfigurations

        @NotNull
        java.util.Collection<SBuildType> getRelatedConfigurations()
        Returns collection of build configurations where this modification appeared.
        Returns:
        collection of build configurations
      • getBuildTypeRelations

        @NotNull
        java.util.Map<SBuildType,​RelationType> getBuildTypeRelations()
        Returns:
        relations this modification has to build configurations
        Since:
        9.0
      • hasRelation

        boolean hasRelation​(@NotNull
                            SBuildType buildType,
                            @NotNull
                            RelationType relation)
        Returns true if the given buildType has relation of the specified type
        Parameters:
        buildType - buildType of interest
        relation - relation of interest
        Returns:
        see above
        Since:
        9.0
      • getRelatedProjects

        @NotNull
        java.util.Collection<SProject> getRelatedProjects()
        Returns:
        returns collection of projects where this modification appeared.
        Since:
        6.5.5
      • getNumberOfRelatedConfigurations

        int getNumberOfRelatedConfigurations()
        Returns number of build configurations where this modification appeared.
        Returns:
        number of build configurations where this modification appeared.
      • getFilteredChanges

        @NotNull
        java.util.List<FilteredVcsChange> getFilteredChanges​(@NotNull
                                                             SBuildType buildType)
        Returns list of changed files filtered according to checkout rules of the specified build configuration
        Parameters:
        buildType - build configuration
        Returns:
        list of filtered changed files
      • getFilteredChanges

        @NotNull
        java.util.List<FilteredVcsChange> getFilteredChanges​(@NotNull
                                                             SBuild build)
        Returns list of changed files filtered according to checkout rules of the specified build
        Parameters:
        build - build
        Returns:
        list of filtered changed files
      • getFilteredChanges

        @NotNull
        java.util.List<FilteredVcsChange> getFilteredChanges​(@NotNull
                                                             BuildPromotion buildPromotion)
        Returns list of changed files filtered according to checkout rules of the specified build promotion
        Parameters:
        buildPromotion - build promotion
        Returns:
        list of filtered changed files
      • getFirstBuilds

        @NotNull
        java.util.Map<SBuildType,​SBuild> getFirstBuilds()
        For non-personal builds, returns map of build configuration -> build where this modification was included for the first time. Cancelled and personal builds are ignored. For personal builds, returns a map from a buildType to the corresponding build which contains this personal change
        Returns:
        see above
      • getRelatedIssues

        @NotNull
        java.util.Collection<Issue> getRelatedIssues()
        Returns the collection of issues related to this modification (fixed bugs, introduced features, etc).
        Returns:
        related issues
        Since:
        5.0
        See Also:
        isHasRelatedIssues()
      • isHasRelatedIssues

        boolean isHasRelatedIssues()
        Returns whether the modification has related issues (fixed bugs, introduced features, etc).
        Returns:
        true if the modification has related issues
        Since:
        7.0
        See Also:
        getRelatedIssues()
      • getPersonalChangeInfo

        @NotNull
        PersonalChangeDescriptor getPersonalChangeInfo()
        For personal changes, returns personal change information details. For non-personal builds, throws exception
        Returns:
        see above
        Throws:
        java.lang.UnsupportedOperationException - when modification is not personal
        Since:
        5.1
        See Also:
        VcsModification.isPersonal()
      • getRegistrationDate

        @NotNull
        java.util.Date getRegistrationDate()
        Returns date of this VCS modification registration in the TeamCity server database.
        Returns:
        date of VCS modification registration
      • getDuplicates

        @NotNull
        java.util.Collection<SVcsModification> getDuplicates()
        Returns duplicates of this VCS modification, (the given modification is not included)
        Returns:
        duplicates of this VCS modification
      • getParentModifications

        @NotNull
        java.util.Collection<SVcsModification> getParentModifications()
        Returns parent modifications of this VCS modification. Returns an empty list if VCS does not provide an information about parents or parents could not be found.
        Returns:
        see above
        Since:
        7.0
      • getParentRevisions

        @NotNull
        java.util.Collection<java.lang.String> getParentRevisions()
        Returns parent revisions for modifications from dag-based VCSes as they were reported by a VCS plugin. For modifications from non-dag-based VCSes returns an empty collection.
        Returns:
        see above
        Since:
        7.1.2
      • getAttributes

        @NotNull
        java.util.Map<java.lang.String,​java.lang.String> getAttributes()
        Returns modification's attributes or empty map if modification doesn't have any.
        Returns:
        see above
        Since:
        8.0
      • setDescription

        void setDescription​(@NotNull
                            java.lang.String newDescription)
                     throws AccessDeniedException
        Set and store new description for the modification in the database. This action is logged to audit, if current user is set in the authentication context. Empty descriptions are not allowed and ignored.
        Parameters:
        newDescription - new description for the modification
        Throws:
        AccessDeniedException - when the current authority holder is not committer of the change and has no explicit permission to set the change description, see Permission.EDIT_VCS_MODIFICATION
        Since:
        10.0
      • relatedToBuildConfigurationsAccessibleTo

        boolean relatedToBuildConfigurationsAccessibleTo​(@NotNull
                                                         AuthorityHolder authorityHolder)
        Returns true if the specified authority holder has read access to at least one build configuration where this VCS modification was detected. Method can return false if all build configurations are not accessible to the current authority holder or this VCS modification is not related to any existing build configurations.
        Since:
        2020.1.3
      • getCommitDate

        @NotNull
        java.util.Date getCommitDate()
        Returns date, when this modification was last updated (e.g. via git rebase) unlike Modification.getVcsDate(), which returns date when the modification was initially authored. Is more or equal to Modification.getVcsDate().
        Returns:
        date when this modification was last updated
        Since:
        2020.2.2