jetbrains.buildServer.vcs.utils
Class VcsPluginUtil

java.lang.Object
  extended by jetbrains.buildServer.vcs.utils.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 Summary
VcsPluginUtil()
           
 
Method Summary
static void buildPatch(VcsRoot root, java.lang.String fromVersion, java.lang.String toVersion, PatchBuilder builder, CheckoutRules checkoutRules, BuildPatchByIncludeRules patcher)
          Service method, allows to build patch for each root include rule in the specified checkout rules
static java.util.List<ModificationData> collectBuildChanges(VcsRoot root, java.lang.String fromVersion, java.lang.String toVersion, CheckoutRules commonRule, CollectChangesByIncludeRules collector)
          Util method, can be used with CollectChangesByIncludeRules to collect all changes for a set of CheckoutRules
protected static ModificationData processRelativePaths(ModificationData change, IncludeRule includeRule)
           
static java.lang.String removeFromAddTo(java.lang.String path, IncludeRule includeRule)
          In path, replaces includeRule.getFrom with includeRule.getTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
VcsException - rethrows exception, thrown by CollectChangesByIncludeRules implementation object

processRelativePaths

@NotNull
protected static ModificationData processRelativePaths(@NotNull
                                                               ModificationData change,
                                                               @NotNull
                                                               IncludeRule includeRule)

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