Package com._1c.g5.v8.dt.testing.compare
Class CherryPickPerformer
java.lang.Object
com._1c.g5.v8.dt.compare.git.merge.AbstractMergePerformer
com._1c.g5.v8.dt.compare.git.merge.AbstractCherryPickPerformer
com._1c.g5.v8.dt.testing.compare.CherryPickPerformer
- All Implemented Interfaces:
AutoCloseable
Cherry-picks Git commit.
-
Nested Class Summary
Nested classes/interfaces inherited from class com._1c.g5.v8.dt.compare.git.merge.AbstractMergePerformer
AbstractMergePerformer.PerformStatus -
Field Summary
Fields inherited from class com._1c.g5.v8.dt.compare.git.merge.AbstractMergePerformer
comparisonManager, fastForwardMode, filePathConverter, matchingStrategy, parseBslModuleStructure, refNameToMergeWith, repository, v8ProjectManager -
Constructor Summary
ConstructorsConstructorDescriptionCherryPickPerformer(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Gets text description of a problem.booleanReports whether some problems found.booleanTells whether merge validation errors happened (and thus no merge performed).booleanTells whether there was nothing to merge.protected voidonAdditionalFilesMergeFailed(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) The callback method if the merge of the additional user files failed.protected voidonComparisonFinished(CompareMergeProcessBatch batch, boolean hasPotentialProblems) Called if the comparison finished.protected voidonFastForwardDetected(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) The callback method if fast-forward was detected.protected voidonFastForwardFailed(org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit commitToMergeWith) The callback method if fast-forward was expected (fast forward mode isMergeCommand.FastForwardMode.FF_ONLY), but it was failed.protected voidonMergeFinished(CompareMergeProcessBatch batch, AbstractMergePerformer.PerformStatus status, org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit commitToMergeWith) The callback to notify about finish of the merge process.protected voidonMergeProblemsFound(List<CompareMergeProcessDescriptor> descriptors, List<ComparisonProcessHandle> handles) The callback method if the merge problems were found.protected voidonNothingToCommit(org.eclipse.jgit.lib.Ref headRef, org.eclipse.jgit.lib.Ref parentRefToMergeWith, org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit parentCommitToMergeWith) The callback method if there are no changes to commit.protected voidonNothingToMerge(org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit commitToMergeWith) The callback method if there no changes to merge.protected voidrunMerge(CompareMergeProcessBatch batch) Runs the merge on the specified batch.voidwaitForFutureCompletion(CompletableFuture<AbstractMergePerformer.PerformStatus> futureOfMergeOperationResult, int timeoutMins) Waits for completion of future.Methods inherited from class com._1c.g5.v8.dt.compare.git.merge.AbstractCherryPickPerformer
canBeMergedMultipleTimes, doCommit, getBaseCommit, getOperationName, getProjectDiffs, handleAdditionalFilesMergeFail, onMergeUsingExternalToolFinishedMethods inherited from class com._1c.g5.v8.dt.compare.git.merge.AbstractMergePerformer
cancel, perform, setMonitorTaskName, setStatus, setStatusCancel, setStatusFailed, setStatusOk, setStatusToBeResolved, startMergeAndWait
-
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 benullrefNameToMergeWith- the ref name to cherry-pick, cannot benullv8Project- the active V8 project to perform cherry-pick on, cannot benullresultChecker- the external cherry-pick result checker, cannot benullfilePathConverter- the qualified name file path converter, cannot benullv8ProjectManager- the V8 project manager, cannot benullcomparisonManager- the comparison process manager, cannot benulldtProjectManager- the Dt project manager, cannot benullworkspaceOrchestrator- the workspace orchestrator, cannot benullexternalObjectDumpSupport- the external object dumps support, cannot benull
-
-
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 benulltimeoutMins- limit waiting to avoid tests hanging in minutes
-
hasProblems
public boolean hasProblems()Reports whether some problems found.- Returns:
trueif some problems were found,falseotherwise
-
getProblemDescription
Gets text description of a problem.- Returns:
- the problem description or
nullif no problems found
-
isNothingToMergeHappened
public boolean isNothingToMergeHappened()Tells whether there was nothing to merge.- Returns:
trueif no merge required,falseotherwise
-
isMergeValidationErrorsHappened
public boolean isMergeValidationErrorsHappened()Tells whether merge validation errors happened (and thus no merge performed).- Returns:
trueif merge validation errors happened,falseotherwise
-
close
- Specified by:
closein interfaceAutoCloseable- 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:AbstractMergePerformerThe callback method if fast-forward was detected.- Overrides:
onFastForwardDetectedin classAbstractCherryPickPerformer- Parameters:
headRef- the head ref, cannot benullrefToMergeWith- the ref to merge with, cannot benullheadCommit- the head commit, cannot benullcommitToMergeWith- the commit to merge with, cannot benullrevWalk- theRevWalkinstance, cannot benull
-
onFastForwardFailed
protected void onFastForwardFailed(org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit commitToMergeWith) Description copied from class:AbstractMergePerformerThe callback method if fast-forward was expected (fast forward mode isMergeCommand.FastForwardMode.FF_ONLY), but it was failed. Completes withAbstractMergePerformer.PerformStatus.FAILEDby default.- Overrides:
onFastForwardFailedin classAbstractCherryPickPerformer- Parameters:
headCommit- the head commit, cannot benullcommitToMergeWith- the commit to merge with, cannot benull
-
onNothingToMerge
protected void onNothingToMerge(org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit commitToMergeWith) Description copied from class:AbstractMergePerformerThe callback method if there no changes to merge. Completes withAbstractMergePerformer.PerformStatus.SUCCEEDby default.- Overrides:
onNothingToMergein classAbstractMergePerformer- Parameters:
headCommit- the head commit, cannot benullcommitToMergeWith- the commit to merge with, cannot benull
-
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:AbstractMergePerformerThe callback method if there are no changes to commit.- Overrides:
onNothingToCommitin classAbstractCherryPickPerformer- Parameters:
headRef- the head ref, cannot benullparentRefToMergeWith- the ref to merge with, cannot benullheadCommit- the head commit, cannot benullparentCommitToMergeWith- the commit to merge with, cannot benull
-
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:AbstractMergePerformerThe callback method if the merge of the additional user files failed.- Overrides:
onAdditionalFilesMergeFailedin classAbstractCherryPickPerformer- Parameters:
headRef- the head ref, cannot benullrefToMergeWith- the ref to merge with, cannot benullheadCommit- the head commit, cannot benullcommitToMergeWith- the commit to merge with, cannot benullbaseCommit- the base commit, cannot benullfailingPaths- the list of paths causing the merge of the additional user files to fail, may benullunmergedPaths- the paths with conflicts, cannot benull
-
onComparisonFinished
Description copied from class:AbstractMergePerformerCalled if the comparison finished. After the comparison finished the merge didn't start automatically, to run merge callAbstractMergePerformer.runMerge(CompareMergeProcessBatch)method.- Specified by:
onComparisonFinishedin classAbstractMergePerformer- Parameters:
batch- the comparison merge process batch, cannot benullhasPotentialProblems- tells whether the comparison batch has potential problems
-
onMergeProblemsFound
protected void onMergeProblemsFound(List<CompareMergeProcessDescriptor> descriptors, List<ComparisonProcessHandle> handles) Description copied from class:AbstractMergePerformerThe callback method if the merge problems were found.- Specified by:
onMergeProblemsFoundin classAbstractMergePerformer- Parameters:
descriptors- the compare/merge process descriptors, cannot benullhandles- the comparison handles with merge problems, cannot benull
-
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:AbstractMergePerformerThe callback to notify about finish of the merge process. Called at the very end of this performer activity.- Overrides:
onMergeFinishedin classAbstractCherryPickPerformer- Parameters:
batch- the batch of compare/merge processes, cannot benullstatus- merge process finish status, cannot benullheadCommit- the head commit, cannot benullcommitToMergeWith- the commit to merge with, cannot benull
-
runMerge
Description copied from class:AbstractMergePerformerRuns the merge on the specified batch. By default it starts the merge and waits its finish.- Overrides:
runMergein classAbstractMergePerformer- Parameters:
batch- the batch of compare/merge processes to be merged, cannot benull
-