Class AbstractCherryPickPerformer

    • Constructor Detail

      • AbstractCherryPickPerformer

        protected AbstractCherryPickPerformer​(org.eclipse.jgit.lib.Repository repository,
                                              String commit,
                                              MatchingStrategy matchingStrategy,
                                              boolean parseBslModuleStructure,
                                              IQualifiedNameFilePathConverter filePathConverter,
                                              IBmModelManager bmModelManager,
                                              IV8ProjectManager v8ProjectManager,
                                              IComparisonManager comparisonManager,
                                              String mergeSettingsFileName)
        Creates a new instance with the given parameters.
        Parameters:
        repository - the Git repository to cherry-pick on, cannot be null
        commit - the name of the commit which is cherry-picked to the current head, cannot be null
        matchingStrategy - the matching strategy, cannot be null
        parseBslModuleStructure - tells whether to compare and merge a Bsl module with parsing module structure
        filePathConverter - the qualified name file path converter, cannot be null
        bmModelManager - the Bm model manager, cannot be null
        v8ProjectManager - the V8 project manager, cannot be null
        comparisonManager - the comparison process manager, cannot be null
        mergeSettingsFileName - the merge settings file name, may be null
    • Method Detail

      • getBaseCommit

        protected org.eclipse.jgit.revwalk.RevCommit getBaseCommit​(org.eclipse.jgit.revwalk.RevCommit headCommit,
                                                                   org.eclipse.jgit.revwalk.RevCommit commitToMergeWith,
                                                                   org.eclipse.jgit.revwalk.RevWalk revWalk)
                                                            throws org.eclipse.jgit.api.errors.GitAPIException,
                                                                   IOException
        Description copied from class: AbstractMergePerformer
        Returns a base commit for the head commit and commit to merge with.
        Specified by:
        getBaseCommit in class AbstractMergePerformer
        Parameters:
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
        revWalk - the RevWalk instance, cannot be null
        Returns:
        the base commit or null if there is no base commit
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException - if failed to get the base commit
        IOException - if failed to read the Git repository
      • getProjectDiffs

        protected List<FileDiff> getProjectDiffs​(org.eclipse.jgit.revwalk.RevCommit headCommit,
                                                 org.eclipse.jgit.revwalk.RevCommit commitToMergeWith,
                                                 org.eclipse.jgit.revwalk.RevCommit baseCommit,
                                                 String projectPath,
                                                 org.eclipse.core.runtime.IProgressMonitor monitor)
                                          throws IOException
        Description copied from class: AbstractMergePerformer
        Returns the project diffs for the specified commits.
        Specified by:
        getProjectDiffs in class AbstractMergePerformer
        Parameters:
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
        baseCommit - the base commit, cannot be null
        projectPath - the project path relative to repository root, cannot be null
        monitor - the monitor to indicate the progress, cannot be null
        Returns:
        the diff entries, never null
        Throws:
        IOException - if it failed to read the Git repository
      • onNothingToMerge

        protected void onNothingToMerge​(org.eclipse.jgit.revwalk.RevCommit headCommit,
                                        org.eclipse.jgit.revwalk.RevCommit commitToMergeWith)
        Description copied from class: AbstractMergePerformer
        The callback method if there no changes to merge.
        Specified by:
        onNothingToMerge in class AbstractMergePerformer
        Parameters:
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
      • doCommit

        protected void doCommit​(org.eclipse.jgit.lib.Ref headRef,
                                org.eclipse.jgit.lib.Ref refToMergeWith,
                                org.eclipse.jgit.revwalk.RevCommit headCommit,
                                org.eclipse.jgit.revwalk.RevCommit commitToMergeWith)
        Description copied from class: AbstractMergePerformer
        Makes commit, writes the commit message and calls commit operation if necessary.
        Specified by:
        doCommit in class AbstractMergePerformer
        Parameters:
        headRef - the head ref, cannot be null
        refToMergeWith - the ref to merge with, cannot be null
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
      • onFastForwardDetected

        protected void onFastForwardDetected​(org.eclipse.jgit.lib.Ref headRef,
                                             org.eclipse.jgit.lib.Ref refToMergeWith,
                                             org.eclipse.jgit.revwalk.RevCommit headCommit,
                                             org.eclipse.jgit.revwalk.RevCommit commitToMergeWith,
                                             org.eclipse.jgit.revwalk.RevWalk revWalk)
        Description copied from class: AbstractMergePerformer
        The callback method if fast-forward was detected.
        Specified by:
        onFastForwardDetected in class AbstractMergePerformer
        Parameters:
        headRef - the head ref, cannot be null
        refToMergeWith - the ref to merge with, cannot be null
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
        revWalk - the RevWalk instance, cannot be null
      • onFastForwardFailed

        protected void onFastForwardFailed​(org.eclipse.jgit.revwalk.RevCommit headCommit,
                                           org.eclipse.jgit.revwalk.RevCommit commitToMergeWith)
        Description copied from class: AbstractMergePerformer
        The callback method if fast-forward was expected (fast forward mode is MergeCommand.FastForwardMode.FF_ONLY), but it was failed.
        Specified by:
        onFastForwardFailed in class AbstractMergePerformer
        Parameters:
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
      • onAdditionalFilesMergeFailed

        protected void onAdditionalFilesMergeFailed​(org.eclipse.jgit.lib.Ref headRef,
                                                    org.eclipse.jgit.lib.Ref refToMergeWith,
                                                    org.eclipse.jgit.revwalk.RevCommit headCommit,
                                                    org.eclipse.jgit.revwalk.RevCommit commitToMergeWith,
                                                    org.eclipse.jgit.revwalk.RevCommit baseCommit,
                                                    Map<String,​org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason> failingPaths,
                                                    List<String> unmergedPaths)
        Description copied from class: AbstractMergePerformer
        The callback method if the merge of the additional user files failed.
        Specified by:
        onAdditionalFilesMergeFailed in class AbstractMergePerformer
        Parameters:
        headRef - the head ref, cannot be null
        refToMergeWith - the ref to merge with, cannot be null
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null
        baseCommit - the base commit, cannot be null
        failingPaths - the list of paths causing the merge of the additional user files to fail, may be null
        unmergedPaths - the paths with conflicts, cannot be null
      • onMergeFinished

        protected void onMergeFinished​(CompareMergeProcessBatch batch,
                                       IMergeCallback callback,
                                       AbstractMergePerformer.MergeFinishStatus status,
                                       org.eclipse.jgit.revwalk.RevCommit headCommit,
                                       org.eclipse.jgit.revwalk.RevCommit commitToMergeWith)
        Description copied from class: AbstractMergePerformer
        The callback to notify about finish of the merge process. Called at the very end of this performer activity.
        Specified by:
        onMergeFinished in class AbstractMergePerformer
        Parameters:
        batch - the batch of compare/merge processes, cannot be null
        callback - the merge process callback, cannot be null
        status - merge process finish status, cannot be null
        headCommit - the head commit, cannot be null
        commitToMergeWith - the commit to merge with, cannot be null