public final class SvnTagBranchUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
REVISION_SPECIFIERS |
static String[] |
SVN_BASE_DIRS |
static String |
SVN_BRANCHES |
static String |
SVN_TAGS |
static String |
SVN_TRUNK |
Modifier and Type | Method and Description |
---|---|
static String |
getProjectRoot(String repoPath)
Returns the project root for the given repository url,
where "project root" is the root of the /trunk, /branches, /tags
directories
|
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.
|
static String |
resolveBranchBase(String repositoryUrl) |
static String |
resolveBranchBase(SvnScmProviderRepository repository) |
static String |
resolveBranchUrl(String repositoryUrl,
ScmBranch branch)
Resolves a branch name to a repository url.
|
static String |
resolveBranchUrl(SvnScmProviderRepository repository,
ScmBranch branch)
Resolves a branch name to a repository url.
|
static String |
resolveTagBase(String repositoryUrl) |
static String |
resolveTagBase(SvnScmProviderRepository repository) |
static String |
resolveTagUrl(String repositoryUrl,
ScmTag tag)
Resolves a tag to a repository url.
|
static String |
resolveTagUrl(SvnScmProviderRepository repository,
ScmTag tag)
Resolves a tag to a repository url.
|
static String |
resolveUrl(String repositoryUrl,
String tagBase,
String subdir,
ScmBranch branchTag)
Resolves a tag or branch name to a repository url.
If the branchTagName is an absolute URL, that value is returned. |
public static final String[] REVISION_SPECIFIERS
public static final String SVN_TRUNK
public static final String SVN_BRANCHES
public static final String SVN_TAGS
public static final String[] SVN_BASE_DIRS
public static String getProjectRoot(String repoPath)
repoPath
- Repository path/url to be searchedpublic static String resolveTagBase(SvnScmProviderRepository repository)
public static String resolveTagBase(String repositoryUrl)
public static String resolveBranchBase(SvnScmProviderRepository repository)
public static String resolveBranchBase(String repositoryUrl)
public static String resolveTagUrl(SvnScmProviderRepository repository, ScmTag tag)
resolveTagUrl(String,ScmTag)
the resolution can use the repository's tagBase to override the default tag location.repository
- the repository to use as a base for tag resolutiontag
- tag nameresolveUrl(String,String,String,ScmBranch)
public static String resolveTagUrl(String repositoryUrl, ScmTag tag)
SvnScmProviderRepository.getTagBase()
during resolution.repositoryUrl
- string url for the repositorytag
- tag nameresolveUrl(String,String,String,ScmBranch)
public static String resolveBranchUrl(SvnScmProviderRepository repository, ScmBranch branch)
resolveBranchUrl(String,ScmBranch)
the resolution can use the repository's tagBase to override the default tag location.repository
- the repository to use as a base for tag resolutionbranch
- tag nameresolveUrl(String,String,String,ScmBranch)
public static String resolveBranchUrl(String repositoryUrl, ScmBranch branch)
SvnScmProviderRepository.getTagBase()
during resolution.repositoryUrl
- string url for the repositorybranch
- branch nameresolveUrl(String,String,String,ScmBranch)
public static String resolveUrl(String repositoryUrl, String tagBase, String subdir, ScmBranch branchTag)
branchTagName
is 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 branchTagName
contains a branch/tag specifier (i.e. "/branches", "/tags", "/trunk"),
the branchTagName
is appended to the projectRoot
without adding the subdir.
Else, the result is in the format of projectRoot/subdir/branchTagName
directory.
repositoryUrl
- string url for the repositorytagBase
- tagBase to use.subdir
- 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"public static boolean isRevisionSpecifier(ScmVersion version)
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
Copyright © 2003–2022 The Apache Software Foundation. All rights reserved.