Commit 009140b1 authored by Dmitry Zhuravlev's avatar Dmitry Zhuravlev Committed by intellij-monorepo-bot
Browse files

IDEA-CR-51235: vcs-ignore: add registry flag to disable ignored to exclude...

IDEA-CR-51235: vcs-ignore: add registry flag to disable ignored to exclude synchronization (IDEA-219152)

Processing file events may affects overall performance and may lead to EDT freezes. Introduce registry flag which disable event processing in IgnoredToExcludedSynchronizer component.

(cherry picked from commit 23191b33bc202648ebcf7a8ccf1a496f752cc0ef)

GitOrigin-RevId: 8898a49774401e09a510facaac612d92e3b86243
parent 6dd19475
Showing with 6 additions and 0 deletions
+6 -0
......@@ -54,6 +54,7 @@ class IgnoredToExcludedSynchronizer(project: Project, parentDisposable: Disposab
}
private fun updateNotificationState() {
if (synchronizationTurnOff()) return
// in case if the project roots changed (e.g. by build tools) then the directories shown in notification can be outdated.
// filter directories which excluded or containing source roots and expire notification if needed.
if (notificationNotPresent()) return
......@@ -94,6 +95,7 @@ class IgnoredToExcludedSynchronizer(project: Project, parentDisposable: Disposab
override fun updateFinished(ignoredPaths: Collection<FilePath>) {
ProgressManager.checkCanceled()
if (synchronizationTurnOff()) return
if (!Registry.`is`("vcs.propose.add.ignored.directories.to.exclude", true)) return
if (!VcsConfiguration.getInstance(project).MARK_IGNORED_AS_EXCLUDED && wasAskedBefore()) return
......@@ -136,6 +138,7 @@ class IgnoredToExcludedSynchronizer(project: Project, parentDisposable: Disposab
}
}
private fun synchronizationTurnOff() = !Registry.`is`("vcs.enable.add.ignored.directories.to.exclude", true)
private fun allowShowNotification() = Registry.`is`("vcs.propose.add.ignored.directories.to.exclude", true)
private fun getProjectSourceRoots() =
......
......@@ -530,6 +530,8 @@ vcs.code.analysis.before.checkin.show.only.new.threshold.description=Show only n
vcs.process.externally.added.files=true
vcs.process.externally.added.files.description=Process externally added files. Add such files to VCS automatically or prompt user.
vcs.enable.add.ignored.directories.to.exclude=false
vcs.enable.add.ignored.directories.to.exclude.description=Enables synchronization of ignored (but not excluded) directories with excluded directories on VCS ignored files rescan.
vcs.propose.add.ignored.directories.to.exclude=false
vcs.propose.add.ignored.directories.to.exclude.description=Show notification with proposal to add ignored (but not excluded) directories to exclude.
......
......@@ -23,6 +23,7 @@ class GitIgnoredToExcludedSynchronizerTest : GitSingleRepoTest() {
override fun setUp() {
super.setUp()
Registry.get("vcs.enable.add.ignored.directories.to.exclude").setValue(true, testRootDisposable)
Registry.get("vcs.propose.add.ignored.directories.to.exclude").setValue(true, testRootDisposable)
}
......
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