svn: Moved "MergeCalculatorTask.myMergeChecker" preparation to pooled thread

This commit is contained in:
Konstantin Kolosovsky
2016-10-11 04:28:23 +03:00
parent a14a30f72f
commit e900069b85
2 changed files with 6 additions and 24 deletions
@@ -15,11 +15,9 @@
*/
package org.jetbrains.idea.svn.integrate;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.util.continuation.TaskDescriptor;
import com.intellij.util.continuation.Where;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class MergeAllOrSelectedChooserTask extends BaseMergeTask {
@@ -41,11 +39,8 @@ public class MergeAllOrSelectedChooserTask extends BaseMergeTask {
next(loader, dialog);
break;
case select:
MergeCalculatorTask calculator = getMergeCalculatorTask();
if (calculator != null) {
next(getCalculateFirstCopyPointTask(calculator), calculator);
}
MergeCalculatorTask calculator = new MergeCalculatorTask(myMergeProcess);
next(getCalculateFirstCopyPointTask(calculator), calculator);
break;
}
}
@@ -56,18 +51,4 @@ public class MergeAllOrSelectedChooserTask extends BaseMergeTask {
.getFirstCopyPointTask(myMergeContext.getWcInfo().getRepositoryRoot(), myMergeContext.getWcInfo().getRootUrl(),
myMergeContext.getSourceUrl(), mergeCalculator);
}
@Nullable
private MergeCalculatorTask getMergeCalculatorTask() {
MergeCalculatorTask result = null;
try {
result = new MergeCalculatorTask(myMergeProcess);
}
catch (VcsException e) {
end(e);
}
return result;
}
}
@@ -53,22 +53,23 @@ public class MergeCalculatorTask extends BaseMergeTask
myCopyData.set(value);
}
public MergeCalculatorTask(@NotNull QuickMerge mergeProcess) throws VcsException {
public MergeCalculatorTask(@NotNull QuickMerge mergeProcess) {
super(mergeProcess, "Calculating not merged revisions", Where.POOLED);
// TODO: Previously it was configurable - either to use OneShotMergeInfoHelper or BranchInfo as merge checker, but later that logic
// TODO: was commented (in 80ebdbfea5210f6c998e67ddf28ca9c670fa4efe on 5/28/2010).
// TODO: Still check if we need to preserve such configuration or it is sufficient to always use OneShotMergeInfoHelper.
myMergeChecker = new OneShotMergeInfoHelper(myMergeContext);
myMergeChecker.prepare();
myCopyData = new AtomicReference<>();
}
@Override
public void run() {
public void run() throws VcsException {
SvnBranchPointsCalculator.WrapperInvertor copyPoint = getCopyPoint();
if (copyPoint != null && myMergeContext.getWcInfo().getFormat().supportsMergeInfo()) {
myMergeChecker.prepare();
List<Pair<SvnChangeList, LogHierarchyNode>> afterCopyPointChangeLists =
getChangeListsAfter(copyPoint.getTrue().getTargetRevision());
List<CommittedChangeList> notMergedChangeLists = getNotMergedChangeLists(afterCopyPointChangeLists);