Class SvnTagBranchUtils
- java.lang.Object
-
- org.apache.maven.scm.provider.svn.SvnTagBranchUtils
-
public final class SvnTagBranchUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]REVISION_SPECIFIERSstatic java.lang.String[]SVN_BASE_DIRSstatic java.lang.StringSVN_BRANCHESstatic java.lang.StringSVN_TAGSstatic java.lang.StringSVN_TRUNK
-
Constructor Summary
Constructors Modifier Constructor Description privateSvnTagBranchUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringaddSuffix(java.lang.String baseString, java.lang.String suffix)(package private) static java.lang.StringappendPath(java.lang.String basePath, java.lang.String addlPath)Simple helper function to concatenate two paths together with a "/".private static booleancheckRevisionArg(java.lang.String arg)static java.lang.StringgetProjectRoot(java.lang.String repoPath)Returns the project root for the given repository url, where "project root" is the root of the /trunk, /branches, /tags directories.static booleanisRevisionSpecifier(ScmVersion version)Returns whether the supplied tag refers to an actual revision or is specifying a tag/branch url in the repository.static java.lang.StringresolveBranchBase(java.lang.String repositoryUrl)static java.lang.StringresolveBranchBase(SvnScmProviderRepository repository)static java.lang.StringresolveBranchUrl(java.lang.String repositoryUrl, ScmBranch branch)Resolves a branch name to a repository url.static java.lang.StringresolveBranchUrl(SvnScmProviderRepository repository, ScmBranch branch)Resolves a branch name to a repository url.static java.lang.StringresolveTagBase(java.lang.String repositoryUrl)static java.lang.StringresolveTagBase(SvnScmProviderRepository repository)static java.lang.StringresolveTagUrl(java.lang.String repositoryUrl, ScmTag tag)Resolves a tag to a repository url.static java.lang.StringresolveTagUrl(SvnScmProviderRepository repository, ScmTag tag)Resolves a tag to a repository url.static java.lang.StringresolveUrl(java.lang.String repositoryUrl, java.lang.String tagBase, java.lang.String subdir, ScmBranch branchTag)Resolves a tag or branch name to a repository url.
If thebranchTagNameis an absolute URL, that value is returned.
-
-
-
Field Detail
-
REVISION_SPECIFIERS
public static final java.lang.String[] REVISION_SPECIFIERS
-
SVN_TRUNK
public static final java.lang.String SVN_TRUNK
- See Also:
- Constant Field Values
-
SVN_BRANCHES
public static final java.lang.String SVN_BRANCHES
- See Also:
- Constant Field Values
-
SVN_TAGS
public static final java.lang.String SVN_TAGS
- See Also:
- Constant Field Values
-
SVN_BASE_DIRS
public static final java.lang.String[] SVN_BASE_DIRS
-
-
Method Detail
-
appendPath
static java.lang.String appendPath(java.lang.String basePath, java.lang.String addlPath)Simple helper function to concatenate two paths together with a "/". Handles trailing / on basePath. Returns no trailing "/" if the addlPath is null.
-
getProjectRoot
public static java.lang.String getProjectRoot(java.lang.String repoPath)
Returns the project root for the given repository url, where "project root" is the root of the /trunk, /branches, /tags directories.- Parameters:
repoPath- repository path/url to be searched- Returns:
- TODO
-
resolveTagBase
public static java.lang.String resolveTagBase(SvnScmProviderRepository repository)
-
resolveTagBase
public static java.lang.String resolveTagBase(java.lang.String repositoryUrl)
-
resolveBranchBase
public static java.lang.String resolveBranchBase(SvnScmProviderRepository repository)
-
resolveBranchBase
public static java.lang.String resolveBranchBase(java.lang.String repositoryUrl)
-
resolveTagUrl
public static java.lang.String resolveTagUrl(SvnScmProviderRepository repository, ScmTag tag)
Resolves a tag to a repository url. By supplying the repository to this function (rather than callingresolveTagUrl(String,ScmTag)the resolution can use the repository's tagBase to override the default tag location.- Parameters:
repository- the repository to use as a base for tag resolutiontag- tag name- Returns:
- TODO
- See Also:
resolveUrl(String,String,String,ScmBranch)
-
resolveTagUrl
public static java.lang.String resolveTagUrl(java.lang.String repositoryUrl, ScmTag tag)Resolves a tag to a repository url. Will not use theSvnScmProviderRepository.getTagBase()during resolution.- Parameters:
repositoryUrl- string url for the repositorytag- tag name- Returns:
- TODO
- See Also:
resolveUrl(String,String,String,ScmBranch)
-
resolveBranchUrl
public static java.lang.String resolveBranchUrl(SvnScmProviderRepository repository, ScmBranch branch)
Resolves a branch name to a repository url. By supplying the repository to this function (rather than callingresolveBranchUrl(String,ScmBranch)the resolution can use the repository's tagBase to override the default tag location.- Parameters:
repository- the repository to use as a base for tag resolutionbranch- tag name- Returns:
- TODO
- See Also:
resolveUrl(String,String,String,ScmBranch)
-
resolveBranchUrl
public static java.lang.String resolveBranchUrl(java.lang.String repositoryUrl, ScmBranch branch)Resolves a branch name to a repository url. Will not use theSvnScmProviderRepository.getTagBase()during resolution.- Parameters:
repositoryUrl- string url for the repositorybranch- branch name- Returns:
- TODO
- See Also:
resolveUrl(String,String,String,ScmBranch)
-
addSuffix
private static java.lang.String addSuffix(java.lang.String baseString, java.lang.String suffix)
-
resolveUrl
public static java.lang.String resolveUrl(java.lang.String repositoryUrl, java.lang.String tagBase, java.lang.String subdir, ScmBranch branchTag)Resolves a tag or branch name to a repository url.
If thebranchTagNameis an absolute URL, that value is returned. (i.e. http://foo.com/svn/myproject/tags/my-tag)
If the repository has a
SvnScmProviderRepository.getTagBase()specified, the tag is simply appended to the tagBase value. Note that at this time, we are using the tagBase as a base for both branches and tags.
If the
branchTagNamecontains a branch/tag specifier (i.e. "/branches", "/tags", "/trunk"), thebranchTagNameis appended to theprojectRootwithout adding the subdir.
Else, the result is in the format ofprojectRoot/subdir/branchTagNamedirectory.- Parameters:
repositoryUrl- string url for the repositorytagBase- tagBase to usesubdir- subdirectory to append to the project root (for branching use "branches", tags use "tags")branchTag- name of the actual branch or tag. Can be an absolute url, simple tag/branch name, or even contain a relative path to the root like "branches/my-branch"- Returns:
- TODO
-
checkRevisionArg
private static boolean checkRevisionArg(java.lang.String arg)
-
isRevisionSpecifier
public static boolean isRevisionSpecifier(ScmVersion version)
Returns whether the supplied tag refers to an actual revision or is specifying a tag/branch url in the repository. According to the subversion documentation, the following are valid revision specifiers: NUMBER revision number "{" DATE "}" revision at start of the date "HEAD" latest in repository "BASE" base rev of item's working copy "COMMITTED" last commit at or before BASE "PREV"For command such as diff, the revision argument can be in the format of: IDENTIFIER:IDENTIFIER where IDENTIFIER is one of the args listed above.
-
-