# HG changeset patch # User Dmitry Neverov # Date 1391439236 -3600 # Node ID 4d543673433fc7fc88d41732f8fa75245de94a1e # Parent ea5b0ed87e1838805636160cd8b6d685a467c3ed TW-34703 mercurial subrepo usage statistics diff -r ea5b0ed87e18 -r 4d543673433f mercurial-server-tc/src/META-INF/build-server-plugin-mercurial-tc.xml --- a/mercurial-server-tc/src/META-INF/build-server-plugin-mercurial-tc.xml Tue Jan 28 18:44:27 2014 +0100 +++ b/mercurial-server-tc/src/META-INF/build-server-plugin-mercurial-tc.xml Mon Feb 03 15:53:56 2014 +0100 @@ -20,4 +20,5 @@ + diff -r ea5b0ed87e18 -r 4d543673433f mercurial-server-tc/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSubrepoUsageStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mercurial-server-tc/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSubrepoUsageStatistics.java Mon Feb 03 15:53:56 2014 +0100 @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jetbrains.buildServer.buildTriggers.vcs.mercurial; + +import jetbrains.buildServer.usageStatistics.impl.providers.BaseVCSFeatureUsageStatisticsProvider; +import jetbrains.buildServer.vcs.SVcsRoot; +import jetbrains.buildServer.vcs.VcsManager; +import org.jetbrains.annotations.NotNull; + +public class MercurialSubrepoUsageStatistics extends BaseVCSFeatureUsageStatisticsProvider { + + public MercurialSubrepoUsageStatistics(@NotNull VcsManager vcsManager) { + super(vcsManager); + } + + @NotNull + @Override + protected String getFeatureName() { + return "subRepoSupport-mercurial"; + } + + @NotNull + @Override + protected String getFeatureDisplayName() { + return "Mercurial VCS roots with subrepo support enabled"; + } + + @Override + protected boolean hasFeature(@NotNull SVcsRoot root) { + return Boolean.parseBoolean(root.getProperty(Constants.DETECT_SUBREPO_CHANGES)); + } +}