Class VcsPluginUtil

  • Direct Known Subclasses:
    VcsSupportUtil

    public class VcsPluginUtil
    extends java.lang.Object
    Created 28.09.12 19:36
    Since:
    8.0
    Author:
    Eugene Petrenko (eugene.petrenko@jetbrains.com)
    • Constructor Detail

      • VcsPluginUtil

        public VcsPluginUtil()
    • Method Detail

      • collectBuildChanges

        public static java.util.List<ModificationData> collectBuildChanges​(@NotNull
                                                                           VcsRoot root,
                                                                           @NotNull
                                                                           java.lang.String fromVersion,
                                                                           @Nullable
                                                                           java.lang.String toVersion,
                                                                           @NotNull
                                                                           CheckoutRules commonRule,
                                                                           @NotNull
                                                                           CollectChangesByIncludeRules collector)
                                                                    throws VcsException
        Util method, can be used with CollectChangesByIncludeRules to collect all changes for a set of CheckoutRules
        Parameters:
        root - vcs root to collect changes for
        fromVersion - version to collect changes from (excluding this version)
        toVersion - version to collect changes to (including this version)
        commonRule - checkout rule to collect changes for
        collector - interface which collects changes for include rules
        Returns:
        collected changes
        Throws:
        VcsIncludeRulesException - rethrows exception, thrown by CollectChangesByIncludeRules implementation object, and contains failing IncludeRules from passed CheckoutRules object
        VcsException
      • collectBuildChanges

        public static java.util.List<ModificationData> collectBuildChanges​(@NotNull
                                                                           VcsRoot root,
                                                                           @NotNull
                                                                           java.lang.String fromVersion,
                                                                           @Nullable
                                                                           java.lang.String toVersion,
                                                                           @NotNull
                                                                           CheckoutRules commonRule,
                                                                           @NotNull
                                                                           CollectSingleStateChangesByIncludeRules collector)
                                                                    throws VcsException
        Util method, can be used with CollectSingleStateChangesByIncludeRules to collect all changes for a set of CheckoutRules
        Parameters:
        root - vcs root to collect changes for
        fromVersion - version to collect changes from (excluding this version)
        toVersion - version to collect changes to (including this version)
        commonRule - checkout rule to collect changes for
        collector - interface which collects changes for include rules
        Returns:
        collected changes
        Throws:
        VcsIncludeRulesException - rethrows exception, thrown by CollectSingleStateChangesByIncludeRules implementation object, and contains failing IncludeRules from passed CheckoutRules object
        VcsException
      • removeFromAddTo

        @Nullable
        public static java.lang.String removeFromAddTo​(@NotNull
                                                       java.lang.String path,
                                                       @NotNull
                                                       IncludeRule includeRule)
        In path, replaces includeRule.getFrom with includeRule.getTo
        Parameters:
        path - path for replacement
        includeRule - include rule
        Returns:
        see above
        Since:
        5.0
      • buildPatch

        public static void buildPatch​(@NotNull
                                      VcsRoot root,
                                      @Nullable
                                      java.lang.String fromVersion,
                                      @NotNull
                                      java.lang.String toVersion,
                                      @NotNull
                                      PatchBuilder builder,
                                      @NotNull
                                      CheckoutRules checkoutRules,
                                      @NotNull
                                      BuildPatchByIncludeRules patcher)
                               throws java.io.IOException,
                                      VcsException
        Service method, allows to build patch for each root include rule in the specified checkout rules
        Parameters:
        root - vcs root to build patch for
        fromVersion - version to build patch from
        toVersion - version to build patch to
        builder - patch builder
        checkoutRules - rules to build patch for (rules how to map repository file names to working ones)
        patcher - implementation, builds patch for one specified include rule
        Throws:
        java.io.IOException - exception occurred while sending patch to patch builder
        VcsException - exception occurred while getting patch from version control
      • getRepositoryVersion

        @NotNull
        public static java.lang.String getRepositoryVersion​(@NotNull
                                                            VcsRepositoryState state)
        Service method, which allows to obtain String representation of VcsRepositoryState for VCSs, having only one branch
        Parameters:
        state - repository state to convert
        Returns:
        String representation of VcsRepositoryState
        Throws:
        java.lang.IllegalArgumentException - if provided state either contains information for multiple branches or is empty
        Since:
        8.1
      • shouldDebugVcsCallsFor

        public static boolean shouldDebugVcsCallsFor​(@NotNull
                                                     java.lang.String fullPath)
        This is an auxiliary method which allows to check for deep debugging of VCS calls. The idea is that for debugging purpose, a user may set `teamcity.vcs.debug.path` system property in internal.properties file If this fragment is set, VCS support may use this method to check whether to perform detailed debugging for the path. Initially this method was supposed to be used with `mapFullPath` method in VcsPersonalSupport to get suitable configurations.
        Parameters:
        fullPath - path to be considered
        Returns:
        true if this detailed debug logging should be performed for this path.
        Since:
        9.1