Package jetbrains.buildServer.vcs.impl
Class DBVcsModificationHistory
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.DBVcsModificationHistory
-
- All Implemented Interfaces:
VcsModificationHistory
,VcsModificationHistoryEx
public class DBVcsModificationHistory extends Object implements VcsModificationHistoryEx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.vcs.VcsModificationHistoryEx
VcsModificationHistoryEx.ModificationDataPersistingCallback, VcsModificationHistoryEx.ModificationDataRelations, VcsModificationHistoryEx.ModificationDataRelationsSupplier
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTACHED_TO_BT_PREFIX
static String
DETACHED_FROM_BT_PREFIX
static Logger
LOGGER_DIAG
static String
PERSIST_EDGE_RELATIONS
static String
TEAMCITY_VCS_HISTORY_PERSIST_CHANGES_CONCURRENTLY_PROP
static String
VCS_HISTORY_CHANGES_DETECTED_BY_OTHER_NODE_PREFETCH_SIZE
-
Constructor Summary
Constructors Constructor Description DBVcsModificationHistory(EventDispatcher<BuildServerListener> serverDispatcher, EventDispatcher<UserModelListener> userModel, EventDispatcher<ProjectsImportListener> projectImportListener, SQLRunnerEx sqlRunner, MultiNodesEvents multiNodesEvents, EntitiesIdsGroups entitiesIdsGroups, NumericIdSequences idSequences)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEdgeRelationsRequiredForBuildType(SBuildType buildType, boolean persistEdgeRelationsDefault)
static boolean
areEdgeRelationsRequiredForRevisionCalculation(VcsRootInstance rootInstance)
void
detachPendingChangesFromBuildType(SBuildType buildType, SVcsRoot parentRoot)
List<SFinishedBuild>
filterBuildsWithChanges(List<SFinishedBuild> builds)
Filters builds and returns only those builds that have at least one modification.SVcsModification
findChangeById(long id)
Return modification by its id.List<SVcsModification>
findExpiredModificationsRelatedToVcsRoot(VcsRootInstance vcsRootInstance, long startModId, int maxChangesToReturn)
This method is similar toVcsModificationHistory.findChangeById(long)
but it will search not only among cached changes, but also among changes that are already unloaded from the cache.SVcsModification
findModificationByVersion(VcsRootInstance root, String version)
Returns last modification with specified version in specified VCS rootLong
findModificationIdByVersion(VcsRootInstance root, String version)
List<SVcsModification>
findModificationsByDisplayVersion(String version)
Searches for all VCS modifications with given display versionVcsModification.getDisplayVersion()
Ordering: most recent modifications go first in the listList<SVcsModification>
findModificationsByVersion(String version)
Searches for all VCS modifications with given versionVcsModification.getVersion()
Ordering: most recent modifications go first in the listMap<String,SVcsModification>
findModificationsByVersions(VcsRootInstance root, Collection<String> versions)
List<SVcsModification>
getAllModifications()
Returns all VCS modifications.List<SVcsModification>
getAllModifications(SBuildType buildType)
Returns all stored modifications detected for the specified configuration.List<SVcsModification>
getAllModifications(VcsRootInstance root)
All configurations detected in the specified vcs root.List<SVcsModification>
getAllModificationsDetectedSince(Date sinceDate)
List<SVcsModification>
getAllUserModifications(User user)
Returns all VCS modifications of specified userMap<String,String>
getAttributes(SVcsModification modification)
Load attributes of the given modification from DB.Set<SUser>
getChangeDescriptorCommitters(Collection<ChangeDescriptor> changes, boolean ignoreNonPersonalCommitters)
Returns committers from the specified collection of change descriptors.Set<SUser>
getChangesCommitters(Collection<SVcsModification> changes, boolean ignoreNonPersonalCommitters)
Returns committers from the specified collection of changes.Collection<SVcsModification>
getDuplicates(SVcsModification modification, boolean byDisplayVersion)
Get duplicate modifications for given one, (the given modification is not included)List<Map<String,RelationType>>
getEdgeRelations(VcsModification childCommit)
Returns list of relations for edges from parent commits to the given child commit.List<FilteredVcsChange>
getFilteredChanges(SVcsModification modification, SBuildType buildType, SBuild build)
Returns filtered VCS changes for given VCS modification and build configuration.List<SVcsModification>
getFixedModificationsCount(SBuildType buildType, Long maxModificationId, int count)
Returns a number of VCS modifications related to the specified build configuration and having modification id <= maxModificationId Ordering: most recent modifications go first in the list resulting list can contain less than required count modifications if the configuration doesn't have the requested amount of modificationsSVcsModification
getLastModification(SBuildType buildType)
Returns last modification detected for the specified build configurationSVcsModification
getLastModification(LVcsRootInstance vcsRoot)
Return last modification detected in the given VcsRootList<SVcsModification>
getLastModifications(int numberOfActiveDays)
Returns latest VCS modifications detected within the specified number of active days.SVcsModification
getLastModificationUpTo(VcsRootInstance root, Long upperBoundModificationId)
Returns last modification detected in the given VCS root with id less than or equals to the given upper boundList<SVcsModification>
getLastUserModifications(User user, int numberOfActiveDays)
Returns last stored modification detected for the specified user.DAG<Long>
getModificationIdDag(VcsRootInstance root)
Returns a DAG of modification ids of specified VCS root instanceDAG<Long>
getModificationIdDag(VcsRootInstance root, Long upperBoundModificationId, Long lowerBoundModificationId)
Returns a DAG of modification ids of specified VCS root instance in specified bounds.RelatedConfigurations
getModificationRelations(SVcsModification modification)
Returns relations the given modification has to build configurations.List<SVcsModification>
getModificationsDetectedBetween(SBuildType buildType, Long fromModificationId, Long toModificationId)
Load all modifications related to specified build configuration and having modification id between specified ids (i.e.List<SVcsModification>
getModificationsInRange(VcsRootInstance root, Long fromId, Long toId)
Returns the list of modifications for the specified root, between specified modification ids.List<SVcsModification>
getModificationsInVersionsRange(VcsRootInstance root, String lowerBoundVersion, String upperBoundVersion)
Returns the list of modifications for the specified root, between specified versions (lower bound is excluded, upper bound is included).VcsModificationOrder
getModificationsOrder(VcsRootInstance root, String version1, String version2)
Get the order relationship between modifications with specified versions in given VCS rootList<SVcsModification>
getModificationsSinceLastSuccessful(SBuildType buildType)
Returns modifications related to specified build configuration detected since last successful build, returns empty list if there were no successful build.Collection<SVcsModification>
getParentModifications(SVcsModification modification)
Get parent modifications of the given one.List<String>
getParentRevisions(SVcsModification modification)
Get parent revisions of given modification.List<SVcsModification>
getPendingModifications(SBuildType buildType)
Returns pending modifications for the specified build configuration.RepositoryState
getStateWithActiveBranches(VcsRootInstance root, RepositoryState state, long maxBranchAgeMillis)
Returns repository state which contains only active branches, i.e.Iterator<SVcsModification>
getUniqueModificationsIterator(List<SVcsModification> modifications)
Returns iterator over list of VCS modifications.int
getUserChangesCounter()
Returns total number of times user accounts were changed/created or removed.void
initBuildTypeModifications(Collection<SBuildType> buildTypes)
void
invalidateBuildTypesModifications(Collection<SBuildType> buildTypes)
boolean
isVcsCacheInitialized()
protected Collection<SVcsModification>
loadMissingModifications(long modificationId)
void
loadMissingVcsRootModifications(VcsRootInstance rootInstance)
Loads VCS changes which could be persisted by some other node into the internal cacheSVcsModification
persistModification(ModificationData modificationData, Collection<SBuildType> relatedConfigurations)
Persists modification if there is no modification in the same root with the same version.SVcsModification
persistModification(ModificationData modificationData, Collection<SBuildType> relatedConfigurations, BuildTypeChangeRelationCalculator changeRelationCalculator)
List<SVcsModification>
persistModifications(List<ModificationData> modifications, VcsModificationHistoryEx.ModificationDataRelationsSupplier relationsSupplier, VcsModificationHistoryEx.ModificationDataPersistingCallback callback)
void
processBuildTypeModifications(SBuildType buildType, Predicate<VcsRootInstance> vcsRootInstancesFilter, ItemProcessor<SVcsModification> processor, Interval interval, Date minRegistrationDate, int expiredCommitsMaxNum, RelationType... relationTypes)
Processes VCS modifications related to specified build type within the specified interval.void
processModifications(ItemProcessor<SVcsModification> modificationsProcessor)
This method traverses all VCS modifications and passed them to the modificationsProcessor.void
scheduleDetachPendingChangesFromBuildType(SBuildType buildType, SVcsRoot parentRoot)
void
setActiveRevisionsFilter(ActiveRevisionsFilter activeRevisionsFilter)
void
setBuildTypeVcsRoots(BuildTypeVcsRootsEx buildTypeVcsRoots)
void
setExecutorServices(ExecutorServices executorServices)
void
setModificationDescription(long modificationId, String newDescription)
Set and save modification description for modification with given IDvoid
setPersonalBuildManager(PersonalBuildManagerEx personalBuildManager)
void
setProjectManager(ProjectManagerEx projectManager)
void
setServerResponsibility(ServerResponsibility serverResponsibility)
void
setTimeService(TimeService timeService)
void
setVcsChangesGraphQuery(VcsChangesGraphQuery vcsGraphQuery)
void
setVcsManager(VcsManager vcsManager)
void
setVcsModificationsStorage(VcsModificationsStorage vcsModificationsStorage)
-
-
-
Field Detail
-
PERSIST_EDGE_RELATIONS
public static final String PERSIST_EDGE_RELATIONS
- See Also:
- Constant Field Values
-
TEAMCITY_VCS_HISTORY_PERSIST_CHANGES_CONCURRENTLY_PROP
public static final String TEAMCITY_VCS_HISTORY_PERSIST_CHANGES_CONCURRENTLY_PROP
- See Also:
- Constant Field Values
-
LOGGER_DIAG
public static final Logger LOGGER_DIAG
-
ATTACHED_TO_BT_PREFIX
public static final String ATTACHED_TO_BT_PREFIX
- See Also:
- Constant Field Values
-
DETACHED_FROM_BT_PREFIX
public static final String DETACHED_FROM_BT_PREFIX
- See Also:
- Constant Field Values
-
VCS_HISTORY_CHANGES_DETECTED_BY_OTHER_NODE_PREFETCH_SIZE
public static final String VCS_HISTORY_CHANGES_DETECTED_BY_OTHER_NODE_PREFETCH_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DBVcsModificationHistory
public DBVcsModificationHistory(@NotNull EventDispatcher<BuildServerListener> serverDispatcher, @NotNull EventDispatcher<UserModelListener> userModel, @NotNull EventDispatcher<ProjectsImportListener> projectImportListener, @NotNull SQLRunnerEx sqlRunner, @NotNull MultiNodesEvents multiNodesEvents, @NotNull EntitiesIdsGroups entitiesIdsGroups, @NotNull NumericIdSequences idSequences)
-
-
Method Detail
-
loadMissingModifications
@NotNull protected Collection<SVcsModification> loadMissingModifications(long modificationId)
-
loadMissingVcsRootModifications
public void loadMissingVcsRootModifications(@NotNull VcsRootInstance rootInstance)
Description copied from interface:VcsModificationHistoryEx
Loads VCS changes which could be persisted by some other node into the internal cache- Specified by:
loadMissingVcsRootModifications
in interfaceVcsModificationHistoryEx
- Parameters:
rootInstance
- root instance whose changes will be loaded
-
isVcsCacheInitialized
public boolean isVcsCacheInitialized()
- Specified by:
isVcsCacheInitialized
in interfaceVcsModificationHistoryEx
- Returns:
- true if VCS history cache is loaded from the database. Note: if the cache is not initialized, then many methods looking for SVcsModification instances will be hanging.
-
initBuildTypeModifications
public void initBuildTypeModifications(@NotNull Collection<SBuildType> buildTypes)
-
setProjectManager
public void setProjectManager(ProjectManagerEx projectManager)
-
setPersonalBuildManager
public void setPersonalBuildManager(PersonalBuildManagerEx personalBuildManager)
-
setVcsModificationsStorage
public void setVcsModificationsStorage(@NotNull VcsModificationsStorage vcsModificationsStorage)
-
setVcsManager
public void setVcsManager(@NotNull VcsManager vcsManager)
-
setVcsChangesGraphQuery
public void setVcsChangesGraphQuery(@NotNull VcsChangesGraphQuery vcsGraphQuery)
-
setActiveRevisionsFilter
public void setActiveRevisionsFilter(@NotNull ActiveRevisionsFilter activeRevisionsFilter)
-
setBuildTypeVcsRoots
public void setBuildTypeVcsRoots(@NotNull BuildTypeVcsRootsEx buildTypeVcsRoots)
-
setExecutorServices
public void setExecutorServices(@NotNull ExecutorServices executorServices)
-
setServerResponsibility
public void setServerResponsibility(@NotNull ServerResponsibility serverResponsibility)
-
setTimeService
public void setTimeService(TimeService timeService)
-
getUserChangesCounter
public int getUserChangesCounter()
Description copied from interface:VcsModificationHistoryEx
Returns total number of times user accounts were changed/created or removed. This counter is used by VcsModification to check whether its committers cache is actual.- Specified by:
getUserChangesCounter
in interfaceVcsModificationHistoryEx
- Returns:
- see above
-
getLastUserModifications
public List<SVcsModification> getLastUserModifications(@NotNull User user, int numberOfActiveDays)
Description copied from interface:VcsModificationHistoryEx
Returns last stored modification detected for the specified user. Ordering: last modifications go first in the list- Specified by:
getLastUserModifications
in interfaceVcsModificationHistoryEx
-
getLastModifications
@NotNull public List<SVcsModification> getLastModifications(int numberOfActiveDays)
Description copied from interface:VcsModificationHistoryEx
Returns latest VCS modifications detected within the specified number of active days. Ordering: most recent modifications go first in the list- Specified by:
getLastModifications
in interfaceVcsModificationHistoryEx
- Returns:
- see above
-
getAllUserModifications
@NotNull public List<SVcsModification> getAllUserModifications(User user)
Description copied from interface:VcsModificationHistoryEx
Returns all VCS modifications of specified user- Specified by:
getAllUserModifications
in interfaceVcsModificationHistoryEx
- Parameters:
user
- user of interest- Returns:
- see above
-
processModifications
public void processModifications(@NotNull ItemProcessor<SVcsModification> modificationsProcessor)
Description copied from interface:VcsModificationHistoryEx
This method traverses all VCS modifications and passed them to the modificationsProcessor. Once modificationsProcessor returns false, the traversing stops.- Specified by:
processModifications
in interfaceVcsModificationHistoryEx
- Parameters:
modificationsProcessor
- SVcsModification items processor
-
getModificationsDetectedBetween
@NotNull public List<SVcsModification> getModificationsDetectedBetween(@NotNull SBuildType buildType, @Nullable Long fromModificationId, @Nullable Long toModificationId)
Description copied from interface:VcsModificationHistory
Load all modifications related to specified build configuration and having modification id between specified ids (i.e. returns modifications detected since modification with id fromModificationId till modification with id toModificationId (inclusive)). Specify null for fromModificationId or toModificationId to open the border. Ordering: most recent modifications go first in the list- Specified by:
getModificationsDetectedBetween
in interfaceVcsModificationHistory
- Parameters:
buildType
- specified build configuration.fromModificationId
- - will search for modifications with id > fromModificationIdtoModificationId
- - will search for modifications with id <= toModificationId- Returns:
- all modifications between fromModificationId and toModificationId.
-
processBuildTypeModifications
public void processBuildTypeModifications(@NotNull SBuildType buildType, @NotNull Predicate<VcsRootInstance> vcsRootInstancesFilter, @NotNull ItemProcessor<SVcsModification> processor, @NotNull Interval interval, @Nullable Date minRegistrationDate, int expiredCommitsMaxNum, RelationType... relationTypes)
Description copied from interface:VcsModificationHistoryEx
Processes VCS modifications related to specified build type within the specified interval. Most recent changes come first. Note: this processor traverses not only cached modifications but also expired once, which are already unloaded from the cache- Specified by:
processBuildTypeModifications
in interfaceVcsModificationHistoryEx
vcsRootInstancesFilter
- additional filter for VCS root instances, only SVcsModification objects from VCS roots accepted by this filter will be passed to the processorexpiredCommitsMaxNum
- max number of the expired commits to process (expired commit is one which exists in our DB but is unloaded from our in-memory cache), set to 0 to disable expired commits lookup
-
findExpiredModificationsRelatedToVcsRoot
@NotNull public List<SVcsModification> findExpiredModificationsRelatedToVcsRoot(@NotNull VcsRootInstance vcsRootInstance, long startModId, int maxChangesToReturn)
Description copied from interface:VcsModificationHistoryEx
This method is similar toVcsModificationHistory.findChangeById(long)
but it will search not only among cached changes, but also among changes that are already unloaded from the cache.- Specified by:
findExpiredModificationsRelatedToVcsRoot
in interfaceVcsModificationHistoryEx
- Returns:
- VCS modification with specified id belonging to the specified VCS root instance
-
getFixedModificationsCount
@NotNull public List<SVcsModification> getFixedModificationsCount(@NotNull SBuildType buildType, @Nullable Long maxModificationId, int count)
Description copied from interface:VcsModificationHistory
Returns a number of VCS modifications related to the specified build configuration and having modification id <= maxModificationId Ordering: most recent modifications go first in the list resulting list can contain less than required count modifications if the configuration doesn't have the requested amount of modifications- Specified by:
getFixedModificationsCount
in interfaceVcsModificationHistory
- Parameters:
buildType
- - specified build configuration.maxModificationId
- - will search for modifications with id <= maxModificationIdcount
- - count of modifications to return- Returns:
- list of modifications with id <=maxModificationId from newest to oldest and not more than the specified count
-
getModificationsSinceLastSuccessful
@NotNull public List<SVcsModification> getModificationsSinceLastSuccessful(@NotNull SBuildType buildType)
Description copied from interface:VcsModificationHistory
Returns modifications related to specified build configuration detected since last successful build, returns empty list if there were no successful build.- Specified by:
getModificationsSinceLastSuccessful
in interfaceVcsModificationHistory
- Parameters:
buildType
- build configuration- Returns:
- see above
-
getChangesCommitters
@NotNull public Set<SUser> getChangesCommitters(@NotNull Collection<SVcsModification> changes, boolean ignoreNonPersonalCommitters)
Description copied from interface:VcsModificationHistoryEx
Returns committers from the specified collection of changes.- Specified by:
getChangesCommitters
in interfaceVcsModificationHistoryEx
- Parameters:
changes
- changes collectionignoreNonPersonalCommitters
- if true non personal changes committers will not be returned- Returns:
- committers
-
getChangeDescriptorCommitters
@NotNull public Set<SUser> getChangeDescriptorCommitters(@NotNull Collection<ChangeDescriptor> changes, boolean ignoreNonPersonalCommitters)
Description copied from interface:VcsModificationHistoryEx
Returns committers from the specified collection of change descriptors. Change descriptors for non-vcs changes are ignored.- Specified by:
getChangeDescriptorCommitters
in interfaceVcsModificationHistoryEx
- Parameters:
changes
- change descriptors collectionignoreNonPersonalCommitters
- if true non personal changes committers will not be returned- Returns:
- see above
-
getModificationRelations
@NotNull public RelatedConfigurations getModificationRelations(@NotNull SVcsModification modification)
Description copied from interface:VcsModificationHistoryEx
Returns relations the given modification has to build configurations.- Specified by:
getModificationRelations
in interfaceVcsModificationHistoryEx
- Parameters:
modification
- modification of interest- Returns:
- see above
-
getEdgeRelations
@NotNull public List<Map<String,RelationType>> getEdgeRelations(@NotNull VcsModification childCommit)
Description copied from interface:VcsModificationHistoryEx
Returns list of relations for edges from parent commits to the given child commit. Index in the list is the number of the parent commit.- Specified by:
getEdgeRelations
in interfaceVcsModificationHistoryEx
-
scheduleDetachPendingChangesFromBuildType
public void scheduleDetachPendingChangesFromBuildType(@NotNull SBuildType buildType, @NotNull SVcsRoot parentRoot)
- Specified by:
scheduleDetachPendingChangesFromBuildType
in interfaceVcsModificationHistoryEx
-
detachPendingChangesFromBuildType
public void detachPendingChangesFromBuildType(@NotNull SBuildType buildType, @NotNull SVcsRoot parentRoot)
- Specified by:
detachPendingChangesFromBuildType
in interfaceVcsModificationHistoryEx
-
getPendingModifications
@NotNull public List<SVcsModification> getPendingModifications(@NotNull SBuildType buildType)
Description copied from interface:VcsModificationHistory
Returns pending modifications for the specified build configuration. Pending modifications are those that are not included in any build yet.- Specified by:
getPendingModifications
in interfaceVcsModificationHistory
- Parameters:
buildType
- build configuration- Returns:
- see above
-
findChangeById
@Nullable public SVcsModification findChangeById(long id)
Description copied from interface:VcsModificationHistory
Return modification by its id.- Specified by:
findChangeById
in interfaceVcsModificationHistory
- Parameters:
id
- VCS modification id- Returns:
- single modification information
- See Also:
SVcsModification
-
getAllModifications
@NotNull public List<SVcsModification> getAllModifications(@NotNull SBuildType buildType)
Description copied from interface:VcsModificationHistory
Returns all stored modifications detected for the specified configuration. Ordering: most recent modifications go first in the list- Specified by:
getAllModifications
in interfaceVcsModificationHistory
- Parameters:
buildType
- specified build configuration.- Returns:
- all stored modifications detected for the specified configuration.
-
invalidateBuildTypesModifications
public void invalidateBuildTypesModifications(@NotNull Collection<SBuildType> buildTypes)
-
getAllModifications
public List<SVcsModification> getAllModifications(@NotNull VcsRootInstance root)
Description copied from interface:VcsModificationHistory
All configurations detected in the specified vcs root. Ordering: most recent modifications go first in the list- Specified by:
getAllModifications
in interfaceVcsModificationHistory
- Parameters:
root
- specified vcs root.- Returns:
- all configurations detected in the specified vcs root.
-
getModificationsInRange
@NotNull public List<SVcsModification> getModificationsInRange(@Nullable VcsRootInstance root, @Nullable Long fromId, @Nullable Long toId)
Description copied from interface:VcsModificationHistory
Returns the list of modifications for the specified root, between specified modification ids. Any of parameters can be null, which means it is not set.- Specified by:
getModificationsInRange
in interfaceVcsModificationHistory
- Parameters:
root
- the VCS root (if null the result will include modifications from all roots)fromId
- will search for modifications with id > fromIdtoId
- - will search for modifications with id <= toId- Returns:
- the list of detected modifications in the specified range
-
filterBuildsWithChanges
public List<SFinishedBuild> filterBuildsWithChanges(@NotNull List<SFinishedBuild> builds)
Description copied from interface:VcsModificationHistory
Filters builds and returns only those builds that have at least one modification. All builds must correspond to the same project.- Specified by:
filterBuildsWithChanges
in interfaceVcsModificationHistory
- Parameters:
builds
- builds to filter, must be sorted in reverse order, i.e. most recent build first- Returns:
- builds containing at least one modification
-
getLastModification
public SVcsModification getLastModification(@NotNull LVcsRootInstance vcsRoot)
Description copied from interface:VcsModificationHistory
Return last modification detected in the given VcsRoot- Specified by:
getLastModification
in interfaceVcsModificationHistory
- Parameters:
vcsRoot
- VCS root- Returns:
- last modification detected in the given VcsRoot
- See Also:
SVcsModification
,VcsRoot
-
getLastModificationUpTo
public SVcsModification getLastModificationUpTo(@NotNull VcsRootInstance root, @NotNull Long upperBoundModificationId)
Description copied from interface:VcsModificationHistory
Returns last modification detected in the given VCS root with id less than or equals to the given upper bound- Specified by:
getLastModificationUpTo
in interfaceVcsModificationHistory
- Parameters:
root
- VCS root of interestupperBoundModificationId
- upper bound modification id- Returns:
- see above
-
getLastModification
public SVcsModification getLastModification(@NotNull SBuildType buildType)
Description copied from interface:VcsModificationHistory
Returns last modification detected for the specified build configuration- Specified by:
getLastModification
in interfaceVcsModificationHistory
- Parameters:
buildType
- build configuration- Returns:
- last modification detected
-
getFilteredChanges
public List<FilteredVcsChange> getFilteredChanges(@NotNull SVcsModification modification, @NotNull SBuildType buildType, @Nullable SBuild build)
Description copied from interface:VcsModificationHistory
Returns filtered VCS changes for given VCS modification and build configuration. Filtered VCS change is a changed file with information whether it was included or excluded by checkout rules of build configuration. Method should not be called for personal modifications.- Specified by:
getFilteredChanges
in interfaceVcsModificationHistory
- Parameters:
modification
- VCS modificationbuildType
- build configurationbuild
- where this modification occurred or null if there is no such build yet- Returns:
- filtered changes
-
getDuplicates
@NotNull public Collection<SVcsModification> getDuplicates(@NotNull SVcsModification modification, boolean byDisplayVersion)
Description copied from interface:VcsModificationHistoryEx
Get duplicate modifications for given one, (the given modification is not included)- Specified by:
getDuplicates
in interfaceVcsModificationHistoryEx
- Parameters:
modification
- modification of interestbyDisplayVersion
- if true, modifications will be compared not by version but by displayVersion, which would join more modifications but modifications from different branches could be present (in a case of Perforce, at least)- Returns:
- collection of duplicate modifications
-
getParentModifications
@NotNull public Collection<SVcsModification> getParentModifications(@NotNull SVcsModification modification)
Description copied from interface:VcsModificationHistoryEx
Get parent modifications of the given one. Returns an empty collection if VCS does not provide an information about parents or parents could not be found.- Specified by:
getParentModifications
in interfaceVcsModificationHistoryEx
- Parameters:
modification
- modification of interest- Returns:
- see above
-
getParentRevisions
@NotNull public List<String> getParentRevisions(@NotNull SVcsModification modification)
Description copied from interface:VcsModificationHistoryEx
Get parent revisions of given modification. Returns an empty collection if VCS does not provide an information about parents or parents could not be found.- Specified by:
getParentRevisions
in interfaceVcsModificationHistoryEx
- Parameters:
modification
- modification of interest- Returns:
- see above
-
getAttributes
@NotNull public Map<String,String> getAttributes(@NotNull SVcsModification modification)
Description copied from interface:VcsModificationHistoryEx
Load attributes of the given modification from DB.- Specified by:
getAttributes
in interfaceVcsModificationHistoryEx
- Parameters:
modification
- modification of interest- Returns:
- see above
-
findModificationByVersion
@Nullable public SVcsModification findModificationByVersion(@NotNull VcsRootInstance root, @NotNull String version)
Description copied from interface:VcsModificationHistoryEx
Returns last modification with specified version in specified VCS root- Specified by:
findModificationByVersion
in interfaceVcsModificationHistoryEx
- Parameters:
root
- VCS root of interestversion
- version of interest- Returns:
- see above
-
findModificationsByVersions
@NotNull public Map<String,SVcsModification> findModificationsByVersions(@NotNull VcsRootInstance root, @NotNull Collection<String> versions)
- Specified by:
findModificationsByVersions
in interfaceVcsModificationHistoryEx
- See Also:
VcsModificationHistoryEx.findModificationsByVersions(VcsRootInstance, Collection)
-
findModificationIdByVersion
@Nullable public Long findModificationIdByVersion(@NotNull VcsRootInstance root, @Nullable String version)
- Specified by:
findModificationIdByVersion
in interfaceVcsModificationHistoryEx
-
findModificationsByVersion
@NotNull public List<SVcsModification> findModificationsByVersion(@NotNull String version)
Description copied from interface:VcsModificationHistoryEx
Searches for all VCS modifications with given versionVcsModification.getVersion()
Ordering: most recent modifications go first in the list- Specified by:
findModificationsByVersion
in interfaceVcsModificationHistoryEx
- Parameters:
version
- VCS modification version- Returns:
- collection of found modifications
-
findModificationsByDisplayVersion
@NotNull public List<SVcsModification> findModificationsByDisplayVersion(@NotNull String version)
Description copied from interface:VcsModificationHistoryEx
Searches for all VCS modifications with given display versionVcsModification.getDisplayVersion()
Ordering: most recent modifications go first in the list- Specified by:
findModificationsByDisplayVersion
in interfaceVcsModificationHistoryEx
- Parameters:
version
- VCS modification display version- Returns:
- collection of found modifications
-
getModificationIdDag
@NotNull public DAG<Long> getModificationIdDag(@NotNull VcsRootInstance root)
Description copied from interface:VcsModificationHistoryEx
Returns a DAG of modification ids of specified VCS root instance- Specified by:
getModificationIdDag
in interfaceVcsModificationHistoryEx
- Parameters:
root
- VCS root instance of interest- Returns:
- see above
-
getModificationIdDag
@NotNull public DAG<Long> getModificationIdDag(@NotNull VcsRootInstance root, @Nullable Long upperBoundModificationId, @Nullable Long lowerBoundModificationId)
Description copied from interface:VcsModificationHistoryEx
Returns a DAG of modification ids of specified VCS root instance in specified bounds. Both bounds can be null, which means open ended range- Specified by:
getModificationIdDag
in interfaceVcsModificationHistoryEx
- Parameters:
root
- VCS root instance of interestupperBoundModificationId
- upper boundlowerBoundModificationId
- lower bound- Returns:
- see above
-
persistModification
@Nullable public SVcsModification persistModification(@NotNull ModificationData modificationData, @NotNull Collection<SBuildType> relatedConfigurations)
Description copied from interface:VcsModificationHistoryEx
Persists modification if there is no modification in the same root with the same version.- Specified by:
persistModification
in interfaceVcsModificationHistoryEx
- Parameters:
modificationData
- modification to persistrelatedConfigurations
- related configuration- Returns:
- persisted modification or null if modification with specified version in specified root was already persisted.
-
persistModification
@Nullable public SVcsModification persistModification(@NotNull ModificationData modificationData, @NotNull Collection<SBuildType> relatedConfigurations, @NotNull BuildTypeChangeRelationCalculator changeRelationCalculator)
- Specified by:
persistModification
in interfaceVcsModificationHistoryEx
-
persistModifications
@NotNull public List<SVcsModification> persistModifications(@NotNull List<ModificationData> modifications, @NotNull VcsModificationHistoryEx.ModificationDataRelationsSupplier relationsSupplier, @NotNull VcsModificationHistoryEx.ModificationDataPersistingCallback callback)
- Specified by:
persistModifications
in interfaceVcsModificationHistoryEx
-
areEdgeRelationsRequiredForRevisionCalculation
public static boolean areEdgeRelationsRequiredForRevisionCalculation(@NotNull VcsRootInstance rootInstance)
-
areEdgeRelationsRequiredForBuildType
public static boolean areEdgeRelationsRequiredForBuildType(@NotNull SBuildType buildType, boolean persistEdgeRelationsDefault)
-
getAllModifications
@NotNull public List<SVcsModification> getAllModifications()
Description copied from interface:VcsModificationHistory
Returns all VCS modifications. Ordering: most recent modifications go first in the list- Specified by:
getAllModifications
in interfaceVcsModificationHistory
- Returns:
- see above
-
getAllModificationsDetectedSince
@NotNull public List<SVcsModification> getAllModificationsDetectedSince(@NotNull Date sinceDate)
- Specified by:
getAllModificationsDetectedSince
in interfaceVcsModificationHistory
- Parameters:
sinceDate
- date when modification was detected by the server (not the date when it was made in repository).- Returns:
- all modifications detected since specified date.
-
getModificationsOrder
@NotNull public VcsModificationOrder getModificationsOrder(@NotNull VcsRootInstance root, @NotNull String version1, @NotNull String version2)
Description copied from interface:VcsModificationHistory
Get the order relationship between modifications with specified versions in given VCS root- Specified by:
getModificationsOrder
in interfaceVcsModificationHistory
- Parameters:
root
- VCS root of interestversion1
- version of the first modificationversion2
- version of the second modification- Returns:
- VcsModificationOrder.BEFORE if modification with version1 happened before modification with version2; VcsModificationOrder.EQUALS if version1 equals version2; VcsModificationOrder.AFTER if modification with version1 happened after modification with version2; VcsModificationOrder.UNKNOWN if the order of modifications cannot be established.
-
getStateWithActiveBranches
@NotNull public RepositoryState getStateWithActiveBranches(@NotNull VcsRootInstance root, @NotNull RepositoryState state, long maxBranchAgeMillis)
Description copied from interface:VcsModificationHistoryEx
Returns repository state which contains only active branches, i.e. branches with an age of the last modification smaller than themaxBranchAgeMillis
.- Specified by:
getStateWithActiveBranches
in interfaceVcsModificationHistoryEx
- Parameters:
root
- VCS root of intereststate
- repository state to filtermaxBranchAgeMillis
- max age of branch in milliseconds- Returns:
- see above
-
setModificationDescription
public void setModificationDescription(long modificationId, @NotNull String newDescription)
Description copied from interface:VcsModificationHistoryEx
Set and save modification description for modification with given ID- Specified by:
setModificationDescription
in interfaceVcsModificationHistoryEx
newDescription
- non-empty new modification description
-
getModificationsInVersionsRange
@NotNull public List<SVcsModification> getModificationsInVersionsRange(@NotNull VcsRootInstance root, @Nullable String lowerBoundVersion, @Nullable String upperBoundVersion)
Description copied from interface:VcsModificationHistoryEx
Returns the list of modifications for the specified root, between specified versions (lower bound is excluded, upper bound is included). Versions can be null, in this case open ended-intervals are used.- Specified by:
getModificationsInVersionsRange
in interfaceVcsModificationHistoryEx
- Parameters:
root
- the VCS root which modifications will be returned- Returns:
- the list of detected modifications in the specified range
- See Also:
VcsModificationHistory.getModificationsOrder(VcsRootInstance, String, String)
,VcsModificationOrder
-
getUniqueModificationsIterator
@NotNull public Iterator<SVcsModification> getUniqueModificationsIterator(List<SVcsModification> modifications)
Description copied from interface:VcsModificationHistoryEx
Returns iterator over list of VCS modifications. This iterator returns only unique (non-duplicate) modifications from specified collection.- Specified by:
getUniqueModificationsIterator
in interfaceVcsModificationHistoryEx
- Parameters:
modifications
- list of VCS modifications- Returns:
- see above
-
-