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 TypeMethodDescriptionvoid
close()
Gets text description of a problem.boolean
Reports whether some problems found.boolean
Tells whether merge validation errors happened (and thus no merge performed).boolean
Tells whether there was nothing to merge.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) The callback method if the merge of the additional user files failed.protected void
onComparisonFinished
(CompareMergeProcessBatch batch, boolean hasPotentialProblems) Called if the comparison finished.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) The callback method if fast-forward was detected.protected void
onFastForwardFailed
(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 void
onMergeFinished
(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 void
onMergeProblemsFound
(List<CompareMergeProcessDescriptor> descriptors, List<ComparisonProcessHandle> handles) The callback method if the merge problems were found.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) The callback method if there are no changes to commit.protected void
onNothingToMerge
(org.eclipse.jgit.revwalk.RevCommit headCommit, org.eclipse.jgit.revwalk.RevCommit commitToMergeWith) The callback method if there no changes to merge.protected void
runMerge
(CompareMergeProcessBatch batch) Runs the merge on the specified batch.void
waitForFutureCompletion
(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, onMergeUsingExternalToolFinished
Methods 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 benull
refNameToMergeWith
- the ref name to cherry-pick, cannot benull
v8Project
- the active V8 project to perform cherry-pick on, cannot benull
resultChecker
- the external cherry-pick result checker, cannot benull
filePathConverter
- the qualified name file path converter, cannot benull
v8ProjectManager
- the V8 project manager, cannot benull
comparisonManager
- the comparison process manager, cannot benull
dtProjectManager
- the Dt project manager, cannot benull
workspaceOrchestrator
- the workspace orchestrator, cannot benull
externalObjectDumpSupport
- 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 benull
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
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
- Specified by:
close
in 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:AbstractMergePerformer
The callback method if fast-forward was detected.- Overrides:
onFastForwardDetected
in classAbstractCherryPickPerformer
- Parameters:
headRef
- the head ref, cannot benull
refToMergeWith
- the ref to merge with, cannot benull
headCommit
- the head commit, cannot benull
commitToMergeWith
- the commit to merge with, cannot benull
revWalk
- theRevWalk
instance, cannot benull
-
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 isMergeCommand.FastForwardMode.FF_ONLY
), but it was failed. Completes withAbstractMergePerformer.PerformStatus.FAILED
by default.- Overrides:
onFastForwardFailed
in classAbstractCherryPickPerformer
- Parameters:
headCommit
- the head commit, cannot benull
commitToMergeWith
- 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:AbstractMergePerformer
The callback method if there no changes to merge. Completes withAbstractMergePerformer.PerformStatus.SUCCEED
by default.- Overrides:
onNothingToMerge
in classAbstractMergePerformer
- Parameters:
headCommit
- the head commit, cannot benull
commitToMergeWith
- 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:AbstractMergePerformer
The callback method if there are no changes to commit.- Overrides:
onNothingToCommit
in classAbstractCherryPickPerformer
- Parameters:
headRef
- the head ref, cannot benull
parentRefToMergeWith
- the ref to merge with, cannot benull
headCommit
- the head commit, cannot benull
parentCommitToMergeWith
- 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:AbstractMergePerformer
The callback method if the merge of the additional user files failed.- Overrides:
onAdditionalFilesMergeFailed
in classAbstractCherryPickPerformer
- Parameters:
headRef
- the head ref, cannot benull
refToMergeWith
- the ref to merge with, cannot benull
headCommit
- the head commit, cannot benull
commitToMergeWith
- the commit to merge with, cannot benull
baseCommit
- the base commit, cannot benull
failingPaths
- the list of paths causing the merge of the additional user files to fail, may benull
unmergedPaths
- the paths with conflicts, cannot benull
-
onComparisonFinished
Description copied from class:AbstractMergePerformer
Called if the comparison finished. After the comparison finished the merge didn't start automatically, to run merge callAbstractMergePerformer.runMerge(CompareMergeProcessBatch)
method.- Specified by:
onComparisonFinished
in classAbstractMergePerformer
- Parameters:
batch
- the comparison merge process batch, cannot benull
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 classAbstractMergePerformer
- Parameters:
descriptors
- the compare/merge process descriptors, cannot benull
handles
- 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:AbstractMergePerformer
The callback to notify about finish of the merge process. Called at the very end of this performer activity.- Overrides:
onMergeFinished
in classAbstractCherryPickPerformer
- Parameters:
batch
- the batch of compare/merge processes, cannot benull
status
- merge process finish status, cannot benull
headCommit
- the head commit, cannot benull
commitToMergeWith
- the commit to merge with, cannot benull
-
runMerge
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 classAbstractMergePerformer
- Parameters:
batch
- the batch of compare/merge processes to be merged, cannot benull
-