mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-121990 Filter by old branch fails with exception if full graph is not loaded
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.vcs.log;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class InvalidRequestException extends RuntimeException {
|
||||
|
||||
public InvalidRequestException(@NotNull String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -16,6 +16,7 @@
|
||||
package com.intellij.vcs.log.newgraph.facade;
|
||||
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import com.intellij.vcs.log.InvalidRequestException;
|
||||
import com.intellij.vcs.log.newgraph.PermanentGraph;
|
||||
import com.intellij.vcs.log.newgraph.SomeGraph;
|
||||
import com.intellij.vcs.log.newgraph.utils.DfsUtil;
|
||||
@@ -54,7 +55,9 @@ public class CurrentBranches {
|
||||
if (heads.contains(myPermanentGraph.getHashIndex(i)))
|
||||
startedNodes.add(i);
|
||||
}
|
||||
assert !startedNodes.isEmpty();
|
||||
if (startedNodes.size() != heads.size() || heads.isEmpty()) {
|
||||
throw new InvalidRequestException("Heads size is invalid! startedNodes " + startedNodes + "; heads: " + heads);
|
||||
}
|
||||
selectAllVisibleNodes(startedNodes);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.intellij.vcs.log.data;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.EmptyRunnable;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.vcs.log.*;
|
||||
import com.intellij.vcs.log.impl.VcsLogUtil;
|
||||
@@ -19,7 +22,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -121,7 +123,18 @@ public class VcsLogFilterer {
|
||||
myUI.getTable().executeWithoutRepaint(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dataPack.getGraphFacade().setVisibleBranches(branchFilter != null ? getMatchingHeads(dataPack, branchFilter) : null);
|
||||
try {
|
||||
dataPack.getGraphFacade().setVisibleBranches(branchFilter != null ? getMatchingHeads(dataPack, branchFilter) : null);
|
||||
}
|
||||
catch (InvalidRequestException e) {
|
||||
if (!myLogDataHolder.isFullLogShowing()) {
|
||||
myLogDataHolder.showFullLog(EmptyRunnable.getInstance());
|
||||
throw new ProcessCanceledException();
|
||||
}
|
||||
else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user