[vcs-log] add registry key to disable filters copying for the new tab

This commit is contained in:
Aleksey Pivovarov
2019-03-20 14:38:58 +03:00
parent aea60cacb0
commit ab2449ca99
2 changed files with 8 additions and 1 deletions
@@ -472,6 +472,8 @@ vcs.log.speedsearch=false
vcs.log.speedsearch.description=Enable speedsearch in Log (warning: performance is not excellent)
vcs.log.filter.messages.by.hash=true
vcs.log.filter.messages.by.hash.description=Find hashes in commit messages when filtering by hash.
vcs.log.copy.filters.to.new.tab=true
vcs.log.copy.filters.to.new.tab.description=If enabled, "Open Another Log Tab" action will copy active filters to the new tab.
vcs.log.max.changes.shown=50000
vcs.log.max.changes.shown.description=Limit for showing commits in the changes view.
vcs.new.history=true
@@ -20,12 +20,15 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.vcs.log.VcsLogDataKeys;
import com.intellij.vcs.log.VcsLogFilterCollection;
import com.intellij.vcs.log.VcsLogUi;
import com.intellij.vcs.log.impl.VcsLogManager;
import com.intellij.vcs.log.impl.VcsProjectLog;
import com.intellij.vcs.log.statistics.VcsLogUsageTriggerCollector;
import com.intellij.vcs.log.ui.VcsLogInternalDataKeys;
import com.intellij.vcs.log.visible.filters.VcsLogFilterObject;
import org.jetbrains.annotations.NotNull;
public class OpenAnotherLogTabAction extends DumbAwareAction {
@@ -54,6 +57,8 @@ public class OpenAnotherLogTabAction extends DumbAwareAction {
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER);
VcsLogUi logUi = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
VcsProjectLog.getInstance(project).getTabsManager().openAnotherLogTab(logManager, logUi.getFilterUi().getFilters());
VcsLogFilterCollection filters = Registry.is("vcs.log.copy.filters.to.new.tab") ? logUi.getFilterUi().getFilters()
: VcsLogFilterObject.collection();
VcsProjectLog.getInstance(project).getTabsManager().openAnotherLogTab(logManager, filters);
}
}