Package jetbrains.buildServer.vcs.impl
Class DBVcsModification
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.AbstractVcsModification
-
- jetbrains.buildServer.vcs.impl.DBVcsModification
-
- All Implemented Interfaces:
Comparable<VcsModification>,Loggable,ChangeDescriptor,VcsModificationEx,Modification,SVcsModification,VcsModification
public abstract class DBVcsModification extends AbstractVcsModification
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEAMCITY_COMMIT_TIMEstatic StringTEAMCITY_COMMIT_USER
-
Constructor Summary
Constructors Constructor Description DBVcsModification(VcsModificationContext context, String username, String description, String version, Date vcsDate, VcsRootInstance vcsRootInstance, int changesCount, Date registrationDate, String[] parentRevisions)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetChangeCount()Return number of files changed in this modificationDategetCommitDate()Returns date, when this modification was last updated (e.g.StringgetCommiterName()Returns user who last updated this modification (e.g.List<Long>getCommitterIds()Returns ids of TeamCity users mapped to this VCS modification by VCS username.VcsModificationContextgetContext()StringgetDescription()Returns user comment made for the changeabstract StringgetDisplayVersion()Collection<String>getParentRevisions()Returns parent revisions for modifications from dag-based VCSes as they were reported by a VCS plugin.StringgetUserName()Returns name of the user who did this commit (according information from VCS system)DategetVcsDate()Returns when this modification was madeStringgetVersion()booleanisCommitter(User committer)Returns if the specified user is committer for the modification.voidsetDescription(String newDescription)Set and store new description for the modification in the database.-
Methods inherited from class jetbrains.buildServer.vcs.impl.AbstractVcsModification
compareTo, consumeEdgeRelations, consumeRelations, consumeRelations, describe, detachedFromConfigurations, equals, findChangeByPath, getAssociatedData, getAttributes, getBuildTypeRelations, getChanges, getCommitters, getContentAfter, getContentBefore, getDate, getDuplicates, getFilteredChanges, getFilteredChanges, getFilteredChanges, getFilteredChanges, getFirstBuilds, getId, getNumberOfRelatedConfigurations, getParentModifications, getPersonalChangeInfo, getReachableVcsBranches, getRegistrationDate, getRelatedBuildTypeIds, getRelatedConfigurationIds, getRelatedConfigurations, getRelatedIssues, getRelatedProjects, getRelatedVcsChange, getRelation, getRelationTypes, getType, getVcsRoot, getVersionControlName, hashCode, hasRelation, isDuplicateOf, isHasRelatedIssues, isPersonal, isRelatedTo, isRelatedTo, isRelatedTo, isRelatedTo, isRelatedTo, processRelations, relatedConfigurationsLoaded, relatedToBuildConfigurationsAccessibleTo, resetEdgeRelations, resetRelatedConfigurations, setEdgeRelations, setRelations, setRelations, toString
-
-
-
-
Field Detail
-
TEAMCITY_COMMIT_TIME
public static final String TEAMCITY_COMMIT_TIME
- See Also:
- Constant Field Values
-
TEAMCITY_COMMIT_USER
public static final String TEAMCITY_COMMIT_USER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DBVcsModification
public DBVcsModification(@NotNull VcsModificationContext context, @NotNull String username, @NotNull String description, @NotNull String version, @NotNull Date vcsDate, @NotNull VcsRootInstance vcsRootInstance, int changesCount, @NotNull Date registrationDate, @Nullable String[] parentRevisions)
-
-
Method Detail
-
getUserName
@NotNull public String getUserName()
Description copied from interface:ModificationReturns name of the user who did this commit (according information from VCS system)- Specified by:
getUserNamein interfaceModification- Specified by:
getUserNamein classAbstractVcsModification- Returns:
- name of the user who did this commit (according information from VCS system)
-
getDescription
@NotNull public String getDescription()
Description copied from interface:ModificationReturns user comment made for the change- Specified by:
getDescriptionin interfaceChangeDescriptor- Specified by:
getDescriptionin interfaceModification- Specified by:
getDescriptionin classAbstractVcsModification- Returns:
- user comment made for the change
-
getVcsDate
@NotNull public Date getVcsDate()
Description copied from interface:ModificationReturns when this modification was made- Specified by:
getVcsDatein interfaceModification- Specified by:
getVcsDatein classAbstractVcsModification- Returns:
- when this modification was made
-
getCommitDate
@NotNull public Date getCommitDate()
Description copied from interface:SVcsModificationReturns date, when this modification was last updated (e.g. via git rebase) unlikeModification.getVcsDate(), which returns date when the modification was initially authored. Is more or equal toModification.getVcsDate().- Returns:
- date when this modification was last updated
-
getCommiterName
@NotNull public String getCommiterName()
Description copied from interface:VcsModificationExReturns user who last updated this modification (e.g. via git rebase, amend, patch apply) unlikeModification.getUserName(), which returns user who initially authored the modification.- Returns:
- name of the user who last updated this modification (according to information from VCS system)
-
isCommitter
public boolean isCommitter(@NotNull User committer)Description copied from interface:SVcsModificationReturns if the specified user is committer for the modification.- Parameters:
committer- specified user.- Returns:
- if the specified user is committer for the modification.
-
getCommitterIds
@NotNull public List<Long> getCommitterIds()
Description copied from interface:SVcsModificationReturns ids of TeamCity users mapped to this VCS modification by VCS username.- Returns:
- ids of the committers to this change.
-
getVersion
@NotNull public String getVersion()
- Specified by:
getVersionin interfaceVcsModification- Specified by:
getVersionin classAbstractVcsModification
-
getDisplayVersion
public abstract String getDisplayVersion()
- Specified by:
getDisplayVersionin interfaceVcsModification- Specified by:
getDisplayVersionin classAbstractVcsModification
-
getChangeCount
public int getChangeCount()
Description copied from interface:VcsModificationReturn number of files changed in this modification- Specified by:
getChangeCountin interfaceVcsModification- Specified by:
getChangeCountin classAbstractVcsModification- Returns:
- see above
-
getParentRevisions
@NotNull public Collection<String> getParentRevisions()
Description copied from interface:SVcsModificationReturns 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.- Specified by:
getParentRevisionsin interfaceSVcsModification- Specified by:
getParentRevisionsin classAbstractVcsModification- Returns:
- see above
-
getContext
@NotNull public VcsModificationContext getContext()
- Specified by:
getContextin interfaceVcsModificationEx- Specified by:
getContextin classAbstractVcsModification
-
setDescription
public void setDescription(@NotNull String newDescription) throws AccessDeniedExceptionDescription copied from interface:SVcsModificationSet 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, seePermission.EDIT_VCS_MODIFICATION
-
-