[hg]: allow to switch off hg ignored files processing

* IDEA-174155 - add registry key to avoid hg status --ignored command
 for a large number of files;
This commit is contained in:
Nadya Zabrodina
2017-06-19 17:04:28 +03:00
parent 57f7810cc1
commit 6c77fb98ff
2 changed files with 19 additions and 16 deletions
@@ -883,7 +883,7 @@ git.diff.renameLimit.infinity.description=Sets diff.renameLimit configuration va
If option is set to false, diff.renameLimit is taken from Git configuration (it is usually not zero by default).\
Switching this option off may prevent Git from detecting renames in large commits in the file history.
hg4idea.process.ignored=false
hg4idea.process.ignored=true
hg4idea.process.ignored.description=Process and highlight mercurial ignored files. \
Switching on this option may lead to some performance problems.
@@ -18,6 +18,7 @@ package org.zmlx.hg4idea.provider;
import com.intellij.dvcs.repo.AsyncFilesManagerListener;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
@@ -59,22 +60,24 @@ public class HgLocalIgnoredHolder implements Disposable {
}
public void startRescan() {
myUpdateQueue.queue(new Update("hgRescanIgnored") {
@Override
public boolean canEat(Update update) {
return true;
}
@Override
public void run() {
if (myInUpdateMode.compareAndSet(false, true)) {
fireUpdateStarted();
rescanAllIgnored();
myInUpdateMode.set(false);
fireUpdateFinished();
if (Registry.is("hg4idea.process.ignored")) {
myUpdateQueue.queue(new Update("hgRescanIgnored") {
@Override
public boolean canEat(Update update) {
return true;
}
}
});
@Override
public void run() {
if (myInUpdateMode.compareAndSet(false, true)) {
fireUpdateStarted();
rescanAllIgnored();
myInUpdateMode.set(false);
fireUpdateFinished();
}
}
});
}
}
private void fireUpdateStarted() {