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.RevCommitgetBaseCommit()Returns the base commit.protected org.eclipse.jgit.revwalk.RevCommitgetCommitToCompareWith()Returns the commit to compare with.protected CompareMergeProcessBatchgetCompareMergeProcessBatch()Returns the compare/merge process batch.protected org.eclipse.jgit.revwalk.RevCommitgetHeadCommit()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.RepositorygetRepository()Returns the Git repository.protected StringgetRevisionToCompareWith()Returns the revision to compare with, may be commit hash, branch name or index revisionGitCompareUtils.INDEX.protected abstract voidonNothingToCompare()The callback method if there no changes to compare.voidperform(org.eclipse.core.runtime.IProgressMonitor monitor)Performs the 3-way comparison with the specified revision.protected abstract voidrunComparison(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 benullrevisionToCompareWith- the revision to compare with, may be commit hash, branch name or index revisionGitCompareUtils.INDEX, cannot benullmatchingStrategy- the matching strategy, cannot benullmergeObjectsContent- 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 benullpathsToFilter- the map from a compared project to paths in the project limiting search for changes on the comparison, may benullmergeSettingsFileName- the merge settings file name, may benullfilePathConverter- the qualified name file path converter, cannot benullv8ProjectManager- the V8 project manager, cannot benullcomparisonManager- the comparison process manager, cannot benull- See Also:
IComparisonProcessSettings
-
-
Method Detail
-
perform
public void perform(org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException, InvalidPreferencesFormatExceptionPerforms 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
nullif the comparison hasn't started
-
getBaseCommit
protected org.eclipse.jgit.revwalk.RevCommit getBaseCommit()
Returns the base commit.- Returns:
- the base commit, may be
nullonly 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
nullonly 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
nullonly if the comparison hasn't started or an error has occurred or it is the comparison with git index
-
-