jetbrains.buildServer.vcs
Interface RootMerger


public interface RootMerger

Implement the interface in the VcsSupport to allow vcs root merge by the version control (merging several roots with one by adding checkout rules).


Method Summary
 VcsRoot getCommonParent(VcsRoot root1, VcsRoot root2)
          returns common parent of two roots.
 java.lang.String getPrefixPath(VcsRoot parent, VcsRoot subRoot)
          returns prefix of the root according to the parent.
 

Method Detail

getCommonParent

@Nullable
VcsRoot getCommonParent(@NotNull
                                 VcsRoot root1,
                                 @NotNull
                                 VcsRoot root2)
returns common parent of two roots.

Parameters:
root1 - first root.
root2 - second root.
Returns:
common parent. Null if roots do not have common parent.

getPrefixPath

@NotNull
java.lang.String getPrefixPath(@NotNull
                                       VcsRoot parent,
                                       @NotNull
                                       VcsRoot subRoot)
returns prefix of the root according to the parent. Adding checkout root with the same left part as prefix has to transform parent root into child one.

Parameters:
parent - parent root.
subRoot - child root.
Returns:
prefix which has transform parent root into child. For example, parent svn root has url svn://server/project child svn root has url svn://server/project/branch/src Other properties are equal. Prefix should be branch/src