Package com._1c.g5.v8.dt.compare.git
Class AbstractCompareWithPerformer
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.git.AbstractCompareWithPerformer
-
- Direct Known Subclasses:
CompareWithTestPerformer
public abstract class AbstractCompareWithPerformer extends Object
An abstract class that provides ability to run Git 'Compare With' command using the EDT comparison mechanism.
-
-
Constructor Summary
Constructors Constructor Description AbstractCompareWithPerformer(org.eclipse.jgit.lib.Repository repository, String revisionToCompareWith, MatchingStrategy matchingStrategy, boolean mergeObjectsContent, boolean parseBslModuleStructure, Collection<org.eclipse.core.resources.IProject> projects, Map<org.eclipse.core.resources.IProject,List<Path>> pathsToFilter, String mergeSettingsFileName, IQualifiedNameFilePathConverter filePathConverter, IV8ProjectManager v8ProjectManager, IComparisonManager comparisonManager)
Creates a new instance with the given parameters.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.jgit.revwalk.RevCommit
getBaseCommit()
Returns the base commit.protected org.eclipse.jgit.revwalk.RevCommit
getCommitToCompareWith()
Returns the commit to compare with.protected CompareMergeProcessBatch
getCompareMergeProcessBatch()
Returns the compare/merge process batch.protected org.eclipse.jgit.revwalk.RevCommit
getHeadCommit()
Returns the head commit.protected Collection<org.eclipse.core.resources.IProject>
getProjects()
Returns the projects on which the git comparison is performed.protected org.eclipse.jgit.lib.Repository
getRepository()
Returns the Git repository.protected String
getRevisionToCompareWith()
Returns the revision to compare with, may be commit hash, branch name or index revisionGitCompareUtils.INDEX
.protected abstract void
onNothingToCompare()
The callback method if there no changes to compare.void
perform(org.eclipse.core.runtime.IProgressMonitor monitor)
Performs the 3-way comparison with the specified revision.protected abstract void
runComparison(CompareMergeProcessBatch batch)
Runs the comparison on the built compare/merge process batch.
-
-
-
Constructor Detail
-
AbstractCompareWithPerformer
public AbstractCompareWithPerformer(org.eclipse.jgit.lib.Repository repository, String revisionToCompareWith, MatchingStrategy matchingStrategy, boolean mergeObjectsContent, boolean parseBslModuleStructure, Collection<org.eclipse.core.resources.IProject> projects, Map<org.eclipse.core.resources.IProject,List<Path>> pathsToFilter, String mergeSettingsFileName, IQualifiedNameFilePathConverter filePathConverter, IV8ProjectManager v8ProjectManager, IComparisonManager comparisonManager)
Creates a new instance with the given parameters.- Parameters:
repository
- the Git repository to run comparison on, cannot benull
revisionToCompareWith
- the revision to compare with, may be commit hash, branch name or index revisionGitCompareUtils.INDEX
, cannot benull
matchingStrategy
- the matching strategy, cannot benull
mergeObjectsContent
- tells whether only objects content is to be mergedparseBslModuleStructure
- tells whether to compare and merge a Bsl module with parsing module structureprojects
- the projects to run Git 'Compare With' command on, cannot benull
pathsToFilter
- the map from a compared project to paths in the project limiting search for changes on the comparison, may benull
mergeSettingsFileName
- the merge settings file name, may benull
filePathConverter
- the qualified name file path converter, cannot benull
v8ProjectManager
- the V8 project manager, cannot benull
comparisonManager
- the comparison process manager, cannot benull
- See Also:
IComparisonProcessSettings
-
-
Method Detail
-
perform
public void perform(org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException, InvalidPreferencesFormatException
Performs the 3-way comparison with the specified revision.- Parameters:
monitor
- the progress monitor to indicate progress, may benull
- Throws:
IOException
- if failed to read the Git repositoryInvalidPreferencesFormatException
- if the input settings did not conform to the appropriate XML document type for a collection of preferences
-
onNothingToCompare
protected abstract void onNothingToCompare()
The callback method if there no changes to compare.
-
runComparison
protected abstract void runComparison(CompareMergeProcessBatch batch)
Runs the comparison on the built compare/merge process batch.- Parameters:
batch
- the compare/merge process batch, cannot benull
-
getRepository
protected org.eclipse.jgit.lib.Repository getRepository()
Returns the Git repository.- Returns:
- the Git repository, never
null
-
getRevisionToCompareWith
protected String getRevisionToCompareWith()
Returns the revision to compare with, may be commit hash, branch name or index revisionGitCompareUtils.INDEX
.- Returns:
- the revision to compare with, never
null
-
getProjects
protected Collection<org.eclipse.core.resources.IProject> getProjects()
Returns the projects on which the git comparison is performed.- Returns:
- the projects, never
null
-
getCompareMergeProcessBatch
protected CompareMergeProcessBatch getCompareMergeProcessBatch()
Returns the compare/merge process batch.- Returns:
- the compare/merge process batch, may be
null
if the comparison hasn't started
-
getBaseCommit
protected org.eclipse.jgit.revwalk.RevCommit getBaseCommit()
Returns the base commit.- Returns:
- the base commit, may be
null
only if the comparison hasn't started or an error has occurred or there is no base commit for the compared commits
-
getHeadCommit
protected org.eclipse.jgit.revwalk.RevCommit getHeadCommit()
Returns the head commit.- Returns:
- the head commit, may be
null
only if the comparison hasn't started or an error has occurred
-
getCommitToCompareWith
protected org.eclipse.jgit.revwalk.RevCommit getCommitToCompareWith()
Returns the commit to compare with.- Returns:
- the commit to compare with, may be
null
only if the comparison hasn't started or an error has occurred or it is the comparison with git index
-
-