Class 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 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 be null
        revisionToCompareWith - the revision to compare with, may be commit hash, branch name or index revision GitCompareUtils.INDEX, cannot be null
        matchingStrategy - the matching strategy, cannot be null
        mergeObjectsContent - tells whether only objects content is to be merged
        parseBslModuleStructure - tells whether to compare and merge a Bsl module with parsing module structure
        projects - the projects to run Git 'Compare With' command on, cannot be null
        pathsToFilter - the map from a compared project to paths in the project limiting search for changes on the comparison, may be null
        mergeSettingsFileName - the merge settings file name, may be null
        filePathConverter - the qualified name file path converter, cannot be null
        v8ProjectManager - the V8 project manager, cannot be null
        comparisonManager - the comparison process manager, cannot be null
        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 be null
        Throws:
        IOException - if failed to read the Git repository
        InvalidPreferencesFormatException - 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 be null
      • 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 revision GitCompareUtils.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