Package jetbrains.buildServer.vcs.impl
Class PersonalVcsModificationImpl
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.AbstractVcsModification
-
- jetbrains.buildServer.vcs.impl.PersonalVcsModificationImpl
-
- All Implemented Interfaces:
Comparable<VcsModification>
,Loggable
,ChangeDescriptor
,VcsModificationEx
,Modification
,SVcsModification
,VcsModification
public class PersonalVcsModificationImpl extends AbstractVcsModification
Created 01.05.13 17:49- Author:
- Eugene Petrenko (eugene.petrenko@jetbrains.com)
-
-
Constructor Summary
Constructors Constructor Description PersonalVcsModificationImpl(VcsModificationContext context, PersonalChangeInfo data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getAssociatedData()
Map<SBuildType,RelationType>
getBuildTypeRelations()
int
getChangeCount()
Return number of files changed in this modificationList<VcsFileModification>
getChanges()
Returns list of file modifications related to the changeDate
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.Collection<SUser>
getCommitters()
byte[]
getContentAfter(VcsChangeInfo change)
byte[]
getContentBefore(VcsChangeInfo change)
VcsModificationContext
getContext()
Date
getDate()
String
getDescription()
Returns user comment made for the changeString
getDisplayVersion()
List<FilteredVcsChange>
getFilteredChanges(BuildPromotion buildPromotion)
Returns list of changed files filtered according to checkout rules of the specified build promotionList<FilteredVcsChange>
getFilteredChanges(SBuild build)
Returns list of changed files filtered according to checkout rules of the specified buildList<FilteredVcsChange>
getFilteredChanges(SBuildType buildType)
Returns list of changed files filtered according to checkout rules of the specified build configurationList<FilteredVcsChange>
getFilteredChanges(CheckoutRules rules)
Returns list of changed files filtered according to given checkout rules.long
getId()
Unique identifier for the modificationCollection<String>
getParentRevisions()
Returns parent revisions for modifications from dag-based VCSes as they were reported by a VCS plugin.PersonalChangeInfo
getPersonalChangeInfo()
For personal changes, returns personal change information details.Set<String>
getReachableVcsBranches()
Date
getRegistrationDate()
Returns date of this VCS modification registration in the TeamCity server database.Collection<SBuildType>
getRelatedConfigurations()
Returns collection of build configurations where this modification appeared.SVcsModification
getRelatedVcsChange()
String
getType()
String
getUserName()
Returns name of the user who did this commit (according information from VCS system)Date
getVcsDate()
Returns when this modification was madeVcsRootInstance
getVcsRoot()
For non-personal modifications returns VCS root where this modification occurred.String
getVersion()
String
getVersionControlName()
Return version control name as returned byVcsSupportConfig.getDisplayName()
; for personal builds "Remote Run" string is returned.boolean
isCommitter(User committer)
Returns if the specified user is committer for the modification.boolean
isPersonal()
Return true if this modification corresponds to personal change of personal build or pre-tested commitvoid
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, getAttributes, getDuplicates, getFirstBuilds, getNumberOfRelatedConfigurations, getParentModifications, getRelatedBuildTypeIds, getRelatedConfigurationIds, getRelatedIssues, getRelatedProjects, getRelation, getRelationTypes, hashCode, hasRelation, isDuplicateOf, isHasRelatedIssues, isRelatedTo, isRelatedTo, isRelatedTo, isRelatedTo, isRelatedTo, processRelations, relatedConfigurationsLoaded, relatedToBuildConfigurationsAccessibleTo, resetEdgeRelations, resetRelatedConfigurations, setEdgeRelations, setRelations, setRelations, toString
-
-
-
-
Constructor Detail
-
PersonalVcsModificationImpl
public PersonalVcsModificationImpl(@NotNull VcsModificationContext context, @NotNull PersonalChangeInfo data)
-
-
Method Detail
-
isPersonal
public boolean isPersonal()
Description copied from interface:VcsModification
Return true if this modification corresponds to personal change of personal build or pre-tested commit- Specified by:
isPersonal
in interfaceVcsModification
- Overrides:
isPersonal
in classAbstractVcsModification
- Returns:
- true if this modification corresponds to personal change of personal build or pre-tested commit
-
getCommitters
@NotNull public Collection<SUser> getCommitters()
- Specified by:
getCommitters
in interfaceSVcsModification
- Overrides:
getCommitters
in classAbstractVcsModification
- Returns:
- collection of TeamCity users mapped to this VCS modification by VCS username.
-
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.
-
getChanges
@NotNull public List<VcsFileModification> getChanges()
Description copied from interface:VcsModification
Returns list of file modifications related to the change- Specified by:
getChanges
in interfaceVcsModification
- Overrides:
getChanges
in classAbstractVcsModification
- Returns:
- list of file modifications related to the change
-
getContentBefore
@NotNull public byte[] getContentBefore(@NotNull VcsChangeInfo change) throws VcsException
- Specified by:
getContentBefore
in interfaceVcsModificationEx
- Overrides:
getContentBefore
in classAbstractVcsModification
- Throws:
VcsException
-
setDescription
public void setDescription(@NotNull String newDescription)
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
-
getContentAfter
@NotNull public byte[] getContentAfter(@NotNull VcsChangeInfo change) throws VcsException
- Specified by:
getContentAfter
in interfaceVcsModificationEx
- Overrides:
getContentAfter
in classAbstractVcsModification
- Throws:
VcsException
-
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
-
getVersionControlName
public String getVersionControlName()
Description copied from interface:VcsModification
Return version control name as returned byVcsSupportConfig.getDisplayName()
; for personal builds "Remote Run" string is returned.- Specified by:
getVersionControlName
in interfaceVcsModification
- Overrides:
getVersionControlName
in classAbstractVcsModification
- Returns:
- version control name
-
getVcsRoot
@NotNull public VcsRootInstance getVcsRoot()
Description copied from interface:SVcsModification
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.- Specified by:
getVcsRoot
in interfaceSVcsModification
- Overrides:
getVcsRoot
in classAbstractVcsModification
- Returns:
- vcs root instance.
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull SBuildType buildType)
Description copied from interface:SVcsModification
Returns list of changed files filtered according to checkout rules of the specified build configuration- Specified by:
getFilteredChanges
in interfaceSVcsModification
- Overrides:
getFilteredChanges
in classAbstractVcsModification
- Parameters:
buildType
- build configuration- Returns:
- list of filtered changed files
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull SBuild build)
Description copied from interface:SVcsModification
Returns list of changed files filtered according to checkout rules of the specified build- Specified by:
getFilteredChanges
in interfaceSVcsModification
- Overrides:
getFilteredChanges
in classAbstractVcsModification
- Parameters:
build
- build- Returns:
- list of filtered changed files
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull BuildPromotion buildPromotion)
Description copied from interface:SVcsModification
Returns list of changed files filtered according to checkout rules of the specified build promotion- Specified by:
getFilteredChanges
in interfaceSVcsModification
- Overrides:
getFilteredChanges
in classAbstractVcsModification
- Parameters:
buildPromotion
- build promotion- Returns:
- list of filtered changed files
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull CheckoutRules rules)
Description copied from interface:VcsModificationEx
Returns list of changed files filtered according to given checkout rules.- Specified by:
getFilteredChanges
in interfaceVcsModificationEx
- Overrides:
getFilteredChanges
in classAbstractVcsModification
- Parameters:
rules
- checkout rules to filter by.- Returns:
- list of filtered changed files.
-
getReachableVcsBranches
@NotNull public Set<String> getReachableVcsBranches()
- Specified by:
getReachableVcsBranches
in interfaceVcsModificationEx
- Overrides:
getReachableVcsBranches
in classAbstractVcsModification
-
getPersonalChangeInfo
@NotNull public PersonalChangeInfo getPersonalChangeInfo()
Description copied from interface:SVcsModification
For personal changes, returns personal change information details. For non-personal builds, throws exception- Specified by:
getPersonalChangeInfo
in interfaceSVcsModification
- Overrides:
getPersonalChangeInfo
in classAbstractVcsModification
- Returns:
- see above
- See Also:
VcsModification.isPersonal()
-
getRelatedConfigurations
@NotNull public Collection<SBuildType> getRelatedConfigurations()
Description copied from interface:SVcsModification
Returns collection of build configurations where this modification appeared.- Specified by:
getRelatedConfigurations
in interfaceSVcsModification
- Overrides:
getRelatedConfigurations
in classAbstractVcsModification
- Returns:
- collection of build configurations
-
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
-
getId
public long getId()
Description copied from interface:VcsModification
Unique identifier for the modification- Specified by:
getId
in interfaceVcsModification
- Specified by:
getId
in classAbstractVcsModification
- Returns:
- unique identifier of the modification
-
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)
-
getVersion
@NotNull public String getVersion()
- Specified by:
getVersion
in interfaceVcsModification
- Specified by:
getVersion
in classAbstractVcsModification
-
getDisplayVersion
public String getDisplayVersion()
- Specified by:
getDisplayVersion
in interfaceVcsModification
- Specified by:
getDisplayVersion
in classAbstractVcsModification
-
getBuildTypeRelations
@NotNull public Map<SBuildType,RelationType> getBuildTypeRelations()
- Specified by:
getBuildTypeRelations
in interfaceSVcsModification
- Overrides:
getBuildTypeRelations
in classAbstractVcsModification
- Returns:
- relations this modification has to build configurations
-
getRegistrationDate
@NotNull public Date getRegistrationDate()
Description copied from interface:SVcsModification
Returns date of this VCS modification registration in the TeamCity server database.- Specified by:
getRegistrationDate
in interfaceSVcsModification
- Overrides:
getRegistrationDate
in classAbstractVcsModification
- Returns:
- date of VCS modification registration
-
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
-
getType
@NotNull public String getType()
- Specified by:
getType
in interfaceChangeDescriptor
- Overrides:
getType
in classAbstractVcsModification
-
getRelatedVcsChange
@Nullable public SVcsModification getRelatedVcsChange()
- Specified by:
getRelatedVcsChange
in interfaceChangeDescriptor
- Overrides:
getRelatedVcsChange
in classAbstractVcsModification
-
getDate
@NotNull public Date getDate()
- Specified by:
getDate
in interfaceChangeDescriptor
- Overrides:
getDate
in classAbstractVcsModification
-
getAssociatedData
@NotNull public Map<String,Object> getAssociatedData()
- Specified by:
getAssociatedData
in interfaceChangeDescriptor
- Overrides:
getAssociatedData
in classAbstractVcsModification
-
-