Commit 598b6ab5 authored by Nadya Zabrodina's avatar Nadya Zabrodina
Browse files

git: add a Registry property to switch off incoming/outgoing branch info for all projects

parent 92c75782
Showing with 9 additions and 2 deletions
+9 -2
......@@ -1213,6 +1213,8 @@ git.use.no.optional.locks=true
git.use.no.optional.locks.description=Use 'GIT_OPTIONAL_LOCKS' env variable to avoid taking unnecessary locks in git. Ex: to avoid "git status" to interfere with 'git rebase' process in terminal.
git.process.ignored=true
git.process.ignored.description=Process and highlight Git ignored files.
git.update.incoming.outgoing.info=true
git.update.incoming.outgoing.info.description=Update branches info that have incoming/outgoing commits in the Branches popup.
hg4idea.process.ignored=true
......
......@@ -169,6 +169,7 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList
}
private void scheduleUpdate() {
if (!myGitSettings.shouldUpdateBranchInfo()) return;
myQueue.queue(Update.create("update", () -> {
List<GitRepository> toPull;
List<GitRepository> toPush;
......
......@@ -14,6 +14,7 @@ import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.ui.EnumComboBoxModel;
......@@ -189,7 +190,7 @@ public class GitVcsPanel implements ConfigurableUi<GitVcsConfigurable.GitVcsSett
myProtectedBranchesField.setText(ParametersListUtil.COLON_LINE_JOINER.fun(sharedSettings.getForcePushProhibitedPatterns()));
myUpdateBranchInfoCheckBox.setSelected(projectSettings.shouldUpdateBranchInfo());
boolean branchInfoSupported = isBranchInfoSupported();
myUpdateBranchInfoCheckBox.setEnabled(branchInfoSupported);
myUpdateBranchInfoCheckBox.setEnabled(Registry.is("git.update.incoming.outgoing.info") && branchInfoSupported);
UIUtil.setEnabled(myBranchTimePanel, myUpdateBranchInfoCheckBox.isSelected() && branchInfoSupported, true);
updateSupportedBranchInfo();
myBranchUpdateTimeField.setValue(projectSettings.getBranchInfoUpdateTime());
......@@ -286,6 +287,7 @@ public class GitVcsPanel implements ConfigurableUi<GitVcsConfigurable.GitVcsSett
}
private void applyBranchUpdateInfo(@NotNull GitVcsSettings projectSettings) {
if (!Registry.is("git.update.incoming.outgoing.info")) return;
boolean branchInfoSupported = isBranchInfoSupported();
myUpdateBranchInfoCheckBox.setEnabled(branchInfoSupported);
UIUtil.setEnabled(myBranchTimePanel, myUpdateBranchInfoCheckBox.isSelected() && branchInfoSupported, true);
......@@ -302,6 +304,7 @@ public class GitVcsPanel implements ConfigurableUi<GitVcsConfigurable.GitVcsSett
}
private boolean isUpdateBranchSettingsModified(@NotNull GitVcsSettings projectSettings) {
if (!Registry.is("git.update.incoming.outgoing.info")) return false;
return projectSettings.getBranchInfoUpdateTime() != (Integer)myBranchUpdateTimeField.getValue() ||
projectSettings.shouldUpdateBranchInfo() != myUpdateBranchInfoCheckBox.isSelected();
}
......
......@@ -7,6 +7,7 @@ import com.intellij.dvcs.branch.DvcsCompareSettings;
import com.intellij.dvcs.branch.DvcsSyncSettings;
import com.intellij.openapi.components.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ObjectUtils;
import com.intellij.util.xmlb.annotations.Attribute;
......@@ -242,7 +243,7 @@ public class GitVcsSettings implements PersistentStateComponent<GitVcsSettings.S
}
public boolean shouldUpdateBranchInfo() {
return myState.UPDATE_BRANCHES_INFO;
return Registry.is("git.update.incoming.outgoing.info") && myState.UPDATE_BRANCHES_INFO;
}
public void setUpdateBranchInfo(boolean state) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment