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 String
TEAMCITY_COMMIT_TIME
static String
TEAMCITY_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 int
getChangeCount()
Return number of files changed in this modificationDate
getCommitDate()
Returns date, when this modification was last updated (e.g.String
getCommiterName()
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.VcsModificationContext
getContext()
String
getDescription()
Returns user comment made for the changeabstract String
getDisplayVersion()
Collection<String>
getParentRevisions()
Returns parent revisions for modifications from dag-based VCSes as they were reported by a VCS plugin.String
getUserName()
Returns name of the user who did this commit (according information from VCS system)Date
getVcsDate()
Returns when this modification was madeString
getVersion()
boolean
isCommitter(User committer)
Returns if the specified user is committer for the modification.void
setDescription(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:Modification
Returns name of the user who did this commit (according information from VCS system)- Specified by:
getUserName
in interfaceModification
- Specified by:
getUserName
in classAbstractVcsModification
- Returns:
- name of the user who did this commit (according information from VCS system)
-
getDescription
@NotNull public String getDescription()
Description copied from interface:Modification
Returns user comment made for the change- Specified by:
getDescription
in interfaceChangeDescriptor
- Specified by:
getDescription
in interfaceModification
- Specified by:
getDescription
in classAbstractVcsModification
- Returns:
- user comment made for the change
-
getVcsDate
@NotNull public Date getVcsDate()
Description copied from interface:Modification
Returns when this modification was made- Specified by:
getVcsDate
in interfaceModification
- Specified by:
getVcsDate
in classAbstractVcsModification
- Returns:
- when this modification was made
-
getCommitDate
@NotNull public Date getCommitDate()
Description copied from interface:SVcsModification
Returns 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:VcsModificationEx
Returns 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:SVcsModification
Returns 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:SVcsModification
Returns 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:
getVersion
in interfaceVcsModification
- Specified by:
getVersion
in classAbstractVcsModification
-
getDisplayVersion
public abstract String getDisplayVersion()
- Specified by:
getDisplayVersion
in interfaceVcsModification
- Specified by:
getDisplayVersion
in classAbstractVcsModification
-
getChangeCount
public int getChangeCount()
Description copied from interface:VcsModification
Return number of files changed in this modification- Specified by:
getChangeCount
in interfaceVcsModification
- Specified by:
getChangeCount
in classAbstractVcsModification
- Returns:
- see above
-
getParentRevisions
@NotNull public Collection<String> getParentRevisions()
Description copied from interface:SVcsModification
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.- Specified by:
getParentRevisions
in interfaceSVcsModification
- Specified by:
getParentRevisions
in classAbstractVcsModification
- Returns:
- see above
-
getContext
@NotNull public VcsModificationContext getContext()
- Specified by:
getContext
in interfaceVcsModificationEx
- Specified by:
getContext
in classAbstractVcsModification
-
setDescription
public void setDescription(@NotNull String newDescription) throws AccessDeniedException
Description copied from interface:SVcsModification
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, seePermission.EDIT_VCS_MODIFICATION
-
-