本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL.removePathTail方法的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL.removePathTail方法的具體用法?Java SVNURL.removePathTail怎麽用?Java SVNURL.removePathTail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.tmatesoft.svn.core.SVNURL
的用法示例。
在下文中一共展示了SVNURL.removePathTail方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: goUpInRepo
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@NotNull
private SvnMergeInfoCache.MergeCheckResult goUpInRepo(final long revisionAsked,
final long targetRevision,
final SVNURL branchUrl,
final String trunkUrl) throws VcsException, SVNException {
SvnMergeInfoCache.MergeCheckResult result;
Set<Long> mergeInfo = myPathMergedMap.get(branchUrl.toString() + "@" + targetRevision);
if (mergeInfo != null) {
// take from self or first parent with info; do not go further
result = SvnMergeInfoCache.MergeCheckResult.getInstance(mergeInfo.contains(revisionAsked));
}
else {
SvnTarget target = SvnTarget.fromURL(branchUrl);
PropertyValue mergeinfoProperty = myVcs.getFactory(target).createPropertyClient()
.getProperty(target, SvnPropertyKeys.MERGE_INFO, false, SVNRevision.create(targetRevision));
if (mergeinfoProperty == null) {
final String newTrunkUrl = SVNPathUtil.removeTail(trunkUrl).trim();
final SVNURL newBranchUrl = branchUrl.removePathTail();
final String absoluteTrunk = SVNPathUtil.append(myInfo.getRepoUrl(), newTrunkUrl);
result = newTrunkUrl.length() <= 1 ||
newBranchUrl.toString().length() <= myInfo.getRepoUrl().length() ||
newBranchUrl.toString().equals(absoluteTrunk)
? SvnMergeInfoCache.MergeCheckResult.NOT_MERGED
: goUpInRepo(revisionAsked, targetRevision, newBranchUrl, newTrunkUrl);
}
else {
result = processMergeinfoProperty(branchUrl.toString() + "@" + targetRevision, revisionAsked, mergeinfoProperty, trunkUrl, false);
}
}
return result;
}
示例2: getServerUrl
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private SVNURL getServerUrl(String realm) {
SVNURL result = parseUrl(realm);
while (result != null && !StringUtil.isEmpty(result.getPath())) {
try {
result = result.removePathTail();
}
catch (SVNException e) {
result = null;
}
}
return result;
}
示例3: getBranchLocationsParent
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@Nullable
private static SVNURL getBranchLocationsParent(@NotNull SVNURL url) throws SVNException {
while (!hasEmptyName(url) && !hasDefaultName(url)) {
url = url.removePathTail();
}
return hasDefaultName(url) ? url.removePathTail() : null;
}