diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java b/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java index 0f52fb9ec87c..edb45b31163f 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/HgVFSListener.java @@ -84,12 +84,10 @@ public class HgVFSListener extends VcsVFSListener { it.remove(); } } - // exlude files which are additional ignored from .hgignore and execute adding - final Map> sortedFiles; - sortedFiles = HgUtil.sortByHgRoots(myProject, addedFiles); + // exclude files which are ignored in .hgignore in background and execute adding after that + final Map> sortedFiles = HgUtil.sortByHgRoots(myProject, addedFiles); final HashSet untrackedFiles = new HashSet(); - final ProgressManager progressManager = ProgressManager.getInstance(); - progressManager.run(new Task.Backgroundable(myProject, HgVcsMessages.message("hg4idea.progress.checking.ignored"), false) { + new Task.Backgroundable(myProject, HgVcsMessages.message("hg4idea.progress.checking.ignored"), false) { @Override public void run(@NotNull ProgressIndicator pi) { for (Map.Entry> e : sortedFiles.entrySet()) { @@ -119,7 +117,7 @@ public class HgVFSListener extends VcsVFSListener { }); } } - }); + }.queue(); } /** diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgStatusCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgStatusCommand.java index 4f391933cd05..dc9fcf611ed7 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgStatusCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgStatusCommand.java @@ -20,6 +20,7 @@ import com.intellij.openapi.vcs.ObjectsConvertor; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.vcsUtil.VcsFileUtil; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.zmlx.hg4idea.HgChange; import org.zmlx.hg4idea.HgFile; @@ -192,11 +193,11 @@ public class HgStatusCommand { includeUnknown = true; } - public Collection getHgUntrackedFiles(VirtualFile repo, List files) throws VcsException { + @NotNull + public Collection getHgUntrackedFiles(@NotNull VirtualFile repo, @NotNull List files) throws VcsException { Collection untrackedFiles = new HashSet(); setOnlyUntrackedTrue(); - List filePaths; - filePaths = ObjectsConvertor.vf2fp(files); + List filePaths = ObjectsConvertor.vf2fp(files); Set change = execute(repo, filePaths); for (HgChange hgChange : change) { untrackedFiles.add(hgChange.afterFile().toFilePath().getVirtualFile());