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()intgetChangeCount()Return number of files changed in this modificationList<VcsFileModification>getChanges()Returns list of file modifications related to the changeDategetCommitDate()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.Collection<SUser>getCommitters()byte[]getContentAfter(VcsChangeInfo change)byte[]getContentBefore(VcsChangeInfo change)VcsModificationContextgetContext()DategetDate()StringgetDescription()Returns user comment made for the changeStringgetDisplayVersion()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.longgetId()Unique identifier for the modificationCollection<String>getParentRevisions()Returns parent revisions for modifications from dag-based VCSes as they were reported by a VCS plugin.PersonalChangeInfogetPersonalChangeInfo()For personal changes, returns personal change information details.Set<String>getReachableVcsBranches()DategetRegistrationDate()Returns date of this VCS modification registration in the TeamCity server database.Collection<SBuildType>getRelatedConfigurations()Returns collection of build configurations where this modification appeared.SVcsModificationgetRelatedVcsChange()StringgetType()StringgetUserName()Returns name of the user who did this commit (according information from VCS system)DategetVcsDate()Returns when this modification was madeVcsRootInstancegetVcsRoot()For non-personal modifications returns VCS root where this modification occurred.StringgetVersion()StringgetVersionControlName()Return version control name as returned byVcsSupportConfig.getDisplayName(); for personal builds "Remote Run" string is returned.booleanisCommitter(User committer)Returns if the specified user is committer for the modification.booleanisPersonal()Return true if this modification corresponds to personal change of personal build or pre-tested commitvoidsetDescription(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:VcsModificationReturn true if this modification corresponds to personal change of personal build or pre-tested commit- Specified by:
isPersonalin interfaceVcsModification- Overrides:
isPersonalin 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:
getCommittersin interfaceSVcsModification- Overrides:
getCommittersin 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: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.
-
getChanges
@NotNull public List<VcsFileModification> getChanges()
Description copied from interface:VcsModificationReturns list of file modifications related to the change- Specified by:
getChangesin interfaceVcsModification- Overrides:
getChangesin classAbstractVcsModification- Returns:
- list of file modifications related to the change
-
getContentBefore
@NotNull public byte[] getContentBefore(@NotNull VcsChangeInfo change) throws VcsException- Specified by:
getContentBeforein interfaceVcsModificationEx- Overrides:
getContentBeforein classAbstractVcsModification- Throws:
VcsException
-
setDescription
public void setDescription(@NotNull String newDescription)Description 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
-
getContentAfter
@NotNull public byte[] getContentAfter(@NotNull VcsChangeInfo change) throws VcsException- Specified by:
getContentAfterin interfaceVcsModificationEx- Overrides:
getContentAfterin classAbstractVcsModification- Throws:
VcsException
-
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
-
getVersionControlName
public String getVersionControlName()
Description copied from interface:VcsModificationReturn version control name as returned byVcsSupportConfig.getDisplayName(); for personal builds "Remote Run" string is returned.- Specified by:
getVersionControlNamein interfaceVcsModification- Overrides:
getVersionControlNamein classAbstractVcsModification- Returns:
- version control name
-
getVcsRoot
@NotNull public VcsRootInstance getVcsRoot()
Description copied from interface:SVcsModificationFor 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:
getVcsRootin interfaceSVcsModification- Overrides:
getVcsRootin classAbstractVcsModification- Returns:
- vcs root instance.
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull SBuildType buildType)
Description copied from interface:SVcsModificationReturns list of changed files filtered according to checkout rules of the specified build configuration- Specified by:
getFilteredChangesin interfaceSVcsModification- Overrides:
getFilteredChangesin classAbstractVcsModification- Parameters:
buildType- build configuration- Returns:
- list of filtered changed files
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull SBuild build)
Description copied from interface:SVcsModificationReturns list of changed files filtered according to checkout rules of the specified build- Specified by:
getFilteredChangesin interfaceSVcsModification- Overrides:
getFilteredChangesin classAbstractVcsModification- Parameters:
build- build- Returns:
- list of filtered changed files
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull BuildPromotion buildPromotion)
Description copied from interface:SVcsModificationReturns list of changed files filtered according to checkout rules of the specified build promotion- Specified by:
getFilteredChangesin interfaceSVcsModification- Overrides:
getFilteredChangesin classAbstractVcsModification- Parameters:
buildPromotion- build promotion- Returns:
- list of filtered changed files
-
getFilteredChanges
@NotNull public List<FilteredVcsChange> getFilteredChanges(@NotNull CheckoutRules rules)
Description copied from interface:VcsModificationExReturns list of changed files filtered according to given checkout rules.- Specified by:
getFilteredChangesin interfaceVcsModificationEx- Overrides:
getFilteredChangesin classAbstractVcsModification- Parameters:
rules- checkout rules to filter by.- Returns:
- list of filtered changed files.
-
getReachableVcsBranches
@NotNull public Set<String> getReachableVcsBranches()
- Specified by:
getReachableVcsBranchesin interfaceVcsModificationEx- Overrides:
getReachableVcsBranchesin classAbstractVcsModification
-
getPersonalChangeInfo
@NotNull public PersonalChangeInfo getPersonalChangeInfo()
Description copied from interface:SVcsModificationFor personal changes, returns personal change information details. For non-personal builds, throws exception- Specified by:
getPersonalChangeInfoin interfaceSVcsModification- Overrides:
getPersonalChangeInfoin classAbstractVcsModification- Returns:
- see above
- See Also:
VcsModification.isPersonal()
-
getRelatedConfigurations
@NotNull public Collection<SBuildType> getRelatedConfigurations()
Description copied from interface:SVcsModificationReturns collection of build configurations where this modification appeared.- Specified by:
getRelatedConfigurationsin interfaceSVcsModification- Overrides:
getRelatedConfigurationsin classAbstractVcsModification- Returns:
- collection of build configurations
-
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
-
getId
public long getId()
Description copied from interface:VcsModificationUnique identifier for the modification- Specified by:
getIdin interfaceVcsModification- Specified by:
getIdin classAbstractVcsModification- Returns:
- unique identifier of the modification
-
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)
-
getVersion
@NotNull public String getVersion()
- Specified by:
getVersionin interfaceVcsModification- Specified by:
getVersionin classAbstractVcsModification
-
getDisplayVersion
public String getDisplayVersion()
- Specified by:
getDisplayVersionin interfaceVcsModification- Specified by:
getDisplayVersionin classAbstractVcsModification
-
getBuildTypeRelations
@NotNull public Map<SBuildType,RelationType> getBuildTypeRelations()
- Specified by:
getBuildTypeRelationsin interfaceSVcsModification- Overrides:
getBuildTypeRelationsin classAbstractVcsModification- Returns:
- relations this modification has to build configurations
-
getRegistrationDate
@NotNull public Date getRegistrationDate()
Description copied from interface:SVcsModificationReturns date of this VCS modification registration in the TeamCity server database.- Specified by:
getRegistrationDatein interfaceSVcsModification- Overrides:
getRegistrationDatein classAbstractVcsModification- Returns:
- date of VCS modification registration
-
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
-
getType
@NotNull public String getType()
- Specified by:
getTypein interfaceChangeDescriptor- Overrides:
getTypein classAbstractVcsModification
-
getRelatedVcsChange
@Nullable public SVcsModification getRelatedVcsChange()
- Specified by:
getRelatedVcsChangein interfaceChangeDescriptor- Overrides:
getRelatedVcsChangein classAbstractVcsModification
-
getDate
@NotNull public Date getDate()
- Specified by:
getDatein interfaceChangeDescriptor- Overrides:
getDatein classAbstractVcsModification
-
getAssociatedData
@NotNull public Map<String,Object> getAssociatedData()
- Specified by:
getAssociatedDatain interfaceChangeDescriptor- Overrides:
getAssociatedDatain classAbstractVcsModification
-
-