svn: Restore working copy format statistics collecting

1e5c313405 follow-up

FUS-108
This commit is contained in:
Konstantin Kolosovsky
2018-06-18 16:54:48 +03:00
parent 3995da4e91
commit d2bd8353c6
2 changed files with 25 additions and 0 deletions
+3
View File
@@ -142,6 +142,9 @@
<configurable id="vcs.Subversion.SSH" displayName="SSH" instance="org.jetbrains.idea.svn.SvnConfigurable$Ssh"/>
</projectConfigurable>
<vcsPopupProvider implementation="org.jetbrains.idea.svn.actions.SvnQuickListContentProvider"/>
<statistics.projectUsagesCollector implementation="org.jetbrains.idea.svn.statistics.SvnWorkingCopyFormatUsagesCollector"/>
<changesViewContent tabName="Subversion Working Copies Information" className="org.jetbrains.idea.svn.WorkingCopiesContent"
predicateClassName="org.jetbrains.idea.svn.WorkingCopiesContent$VisibilityPredicate"/>
@@ -0,0 +1,22 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.idea.svn.statistics
import com.intellij.internal.statistic.beans.UsageDescriptor
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector
import com.intellij.openapi.project.Project
import org.jetbrains.idea.svn.NestedCopyType
import org.jetbrains.idea.svn.SvnVcs
class SvnWorkingCopyFormatUsagesCollector : ProjectUsagesCollector() {
override fun getGroupId() = "statistics.vcs.svn.format"
override fun getUsages(project: Project): Set<UsageDescriptor> {
val vcs = SvnVcs.getInstance(project)
// do not track roots with errors (SvnFileUrlMapping.getErrorRoots()) as they are "not usable" until errors are resolved
// skip externals and switched directories as they will have the same format
val roots = vcs.svnFileUrlMapping.allWcInfos.filter { it.type == null || it.type == NestedCopyType.inner }
return roots.groupingBy { it.format }.eachCount().map { UsageDescriptor(it.key.toString(), it.value) }.toSet()
}
}