Class CherryPickPerformer

All Implemented Interfaces:
AutoCloseable

public class CherryPickPerformer extends AbstractCherryPickPerformer implements AutoCloseable
Cherry-picks Git commit.
  • Constructor Details

    • CherryPickPerformer

      public CherryPickPerformer(org.eclipse.jgit.lib.Repository repository, String refNameToMergeWith, IV8Project v8Project, ICompareMergeResultChecker resultChecker, IQualifiedNameFilePathConverter filePathConverter, IV8ProjectManager v8ProjectManager, IComparisonManager comparisonManager, IDtProjectManager dtProjectManager, IWorkspaceOrchestrator workspaceOrchestrator, IExternalObjectDumpSupport externalObjectDumpSupport)
      Creates performer instance.
      Parameters:
      repository - the Git repository to run cherry-pick on, cannot be null
      refNameToMergeWith - the ref name to cherry-pick, cannot be null
      v8Project - the active V8 project to perform cherry-pick on, cannot be null
      resultChecker - the external cherry-pick result checker, cannot 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
      dtProjectManager - the Dt project manager, cannot be null
      workspaceOrchestrator - the workspace orchestrator, cannot be null
      externalObjectDumpSupport - the external object dumps support, cannot be null
  • Method Details

    • waitForFutureCompletion

      public void waitForFutureCompletion(CompletableFuture<AbstractMergePerformer.PerformStatus> futureOfMergeOperationResult, int timeoutMins)
      Waits for completion of future.
      Parameters:
      futureOfMergeOperationResult - future to wait completion of, cannot be null
      timeoutMins - limit waiting to avoid tests hanging in minutes
    • hasProblems

      public boolean hasProblems()
      Reports whether some problems found.
      Returns:
      true if some problems were found, false otherwise
    • getProblemDescription

      public String getProblemDescription()
      Gets text description of a problem.
      Returns:
      the problem description or null if no problems found
    • isNothingToMergeHappened

      public boolean isNothingToMergeHappened()
      Tells whether there was nothing to merge.
      Returns:
      true if no merge required, false otherwise
    • isMergeValidationErrorsHappened

      public boolean isMergeValidationErrorsHappened()
      Tells whether merge validation errors happened (and thus no merge performed).
      Returns:
      true if merge validation errors happened, false otherwise
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • 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.
      Overrides:
      onFastForwardDetected in class AbstractCherryPickPerformer
      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. Completes with AbstractMergePerformer.PerformStatus.FAILED by default.
      Overrides:
      onFastForwardFailed in class AbstractCherryPickPerformer
      Parameters:
      headCommit - the head commit, cannot be null
      commitToMergeWith - the commit to merge with, cannot be null
    • 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. Completes with AbstractMergePerformer.PerformStatus.SUCCEED by default.
      Overrides:
      onNothingToMerge in class AbstractMergePerformer
      Parameters:
      headCommit - the head commit, cannot be null
      commitToMergeWith - the commit to merge with, cannot be null
    • onNothingToCommit

      protected void onNothingToCommit(org.eclipse.jgit.lib.Ref headRef, org.eclipse.jgit.lib.Ref parentRefToMergeWith, org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit parentCommitToMergeWith)
      Description copied from class: AbstractMergePerformer
      The callback method if there are no changes to commit.
      Overrides:
      onNothingToCommit in class AbstractCherryPickPerformer
      Parameters:
      headRef - the head ref, cannot be null
      parentRefToMergeWith - the ref to merge with, cannot be null
      headCommit - the head commit, cannot be null
      parentCommitToMergeWith - 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.
      Overrides:
      onAdditionalFilesMergeFailed in class AbstractCherryPickPerformer
      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
    • onComparisonFinished

      protected void onComparisonFinished(CompareMergeProcessBatch batch, boolean hasPotentialProblems)
      Description copied from class: AbstractMergePerformer
      Called if the comparison finished. After the comparison finished the merge didn't start automatically, to run merge call AbstractMergePerformer.runMerge(CompareMergeProcessBatch) method.
      Specified by:
      onComparisonFinished in class AbstractMergePerformer
      Parameters:
      batch - the comparison merge process batch, cannot be null
      hasPotentialProblems - tells whether the comparison batch has potential problems
    • onMergeProblemsFound

      protected void onMergeProblemsFound(List<CompareMergeProcessDescriptor> descriptors, List<ComparisonProcessHandle> handles)
      Description copied from class: AbstractMergePerformer
      The callback method if the merge problems were found.
      Specified by:
      onMergeProblemsFound in class AbstractMergePerformer
      Parameters:
      descriptors - the compare/merge process descriptors, cannot be null
      handles - the comparison handles with merge problems, cannot be null
    • onMergeFinished

      protected void onMergeFinished(CompareMergeProcessBatch batch, AbstractMergePerformer.PerformStatus 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.
      Overrides:
      onMergeFinished in class AbstractCherryPickPerformer
      Parameters:
      batch - the batch of compare/merge processes, 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
    • runMerge

      protected void runMerge(CompareMergeProcessBatch batch)
      Description copied from class: AbstractMergePerformer
      Runs the merge on the specified batch. By default it starts the merge and waits its finish.
      Overrides:
      runMerge in class AbstractMergePerformer
      Parameters:
      batch - the batch of compare/merge processes to be merged, cannot be null