Class VcsPluginUtil

  • Direct Known Subclasses:
    VcsSupportUtil

    public class VcsPluginUtil
    extends 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 List<ModificationData> collectBuildChanges​(@NotNull
                                                                 VcsRoot root,
                                                                 @NotNull
                                                                 String fromVersion,
                                                                 @Nullable
                                                                 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 List<ModificationData> collectBuildChanges​(@NotNull
                                                                 VcsRoot root,
                                                                 @NotNull
                                                                 String fromVersion,
                                                                 @Nullable
                                                                 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 String removeFromAddTo​(@NotNull
                                             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
                                      String fromVersion,
                                      @NotNull
                                      String toVersion,
                                      @NotNull
                                      PatchBuilder builder,
                                      @NotNull
                                      CheckoutRules checkoutRules,
                                      @NotNull
                                      BuildPatchByIncludeRules patcher)
                               throws 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:
        IOException - exception occurred while sending patch to patch builder
        VcsException - exception occurred while getting patch from version control
      • getRepositoryVersion

        @NotNull
        public static 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:
        IllegalArgumentException - if provided state either contains information for multiple branches or is empty
        Since:
        8.1
      • shouldDebugVcsCallsFor

        public static boolean shouldDebugVcsCallsFor​(@NotNull
                                                     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