当前位置: 首页>>代码示例>>Java>>正文


Java ISVNInfo.getRepository方法代码示例

本文整理汇总了Java中org.tigris.subversion.svnclientadapter.ISVNInfo.getRepository方法的典型用法代码示例。如果您正苦于以下问题:Java ISVNInfo.getRepository方法的具体用法?Java ISVNInfo.getRepository怎么用?Java ISVNInfo.getRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tigris.subversion.svnclientadapter.ISVNInfo的用法示例。


在下文中一共展示了ISVNInfo.getRepository方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateRootUrl

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
/**
 * @param resource
 * @return rootURL
 */
private SVNUrl updateRootUrl(ISVNResource resource) {
	ISVNClientAdapter client = null;
    try {
        client = SVNProviderPlugin.getPlugin().getSVNClient();
        SVNProviderPlugin.disableConsoleLogging(); 
        ISVNInfo info = client.getInfo(resource.getUrl());
        SVNProviderPlugin.enableConsoleLogging(); 
        if (info.getRepository() == null)
            return resource.getUrl();
        else {
            // update the saved root URL
            resource.getRepository().setRepositoryRoot(info.getRepository());
            return info.getRepository();
        }
    } catch (Exception e) {
        SVNProviderPlugin.enableConsoleLogging(); 
        return resource.getUrl();
    } finally {
     SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
    }
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:26,代码来源:LogEntry.java

示例2: setSharing

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
/**
 * Set the sharing for a project to enable it to be used with the SVNTeamProvider.
    * This is used when a project has .svn directory but is not shared in Eclipse.
 * An exception is thrown if project does not have a remote directory counterpart
 */
public static void setSharing(IProject project, IProgressMonitor monitor) throws TeamException {

	// Ensure provided info matches that of the project
	LocalResourceStatus status = peekResourceStatusFor(project);

       // this folder needs to be managed but also to have a remote counter-part
       // because we need to know its url
       // we will change this exception !
       if (!status.hasRemote())
           throw new SVNException(new SVNStatus(IStatus.ERROR, Policy.bind("SVNProvider.infoMismatch", project.getName())));//$NON-NLS-1$

       String repositoryURL = null;
       ISVNClientAdapter client = SVNProviderPlugin.getPlugin().getSVNClient();
       try {
           SVNProviderPlugin.disableConsoleLogging();
		ISVNInfo info = client.getInfoFromWorkingCopy(project.getLocation().toFile());
		if (info.getRepository() != null)
			repositoryURL = info.getRepository().toString();
	} catch (SVNClientException e) {
	} finally {
        SVNProviderPlugin.enableConsoleLogging();
           SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
	}
	if (repositoryURL == null)
		repositoryURL = status.getUrlString();

	// Ensure that the provided location is managed
	SVNProviderPlugin.getPlugin().getRepositories().getRepository(repositoryURL, false);

	// Register the project with Team
	RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:38,代码来源:SVNWorkspaceRoot.java

示例3: validateConnection

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
public void validateConnection(IProgressMonitor monitor) throws SVNException {
	ISVNClientAdapter svnClient = getSVNClient();
	try {
		// we try to get the list of directories and files using the connection
		ISVNInfo info = svnClient.getInfo(getUrl());
	    repositoryRootUrl = info.getRepository();
	} catch (SVNClientException e) {
		// If the validation failed, dispose of any cached info
		dispose();
		throw SVNException.wrapException(e);
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:13,代码来源:SVNRepositoryLocation.java

示例4: getRootURL

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
private String getRootURL(ISVNLocalResource localResource) {
	if (!atomicCommit)
		return null;
	ISVNInfo info = getSVNInfo(localResource);
	if (info == null)
		return null;
	SVNUrl repos = info.getRepository();
	if (repos == null)
		return null;
   	return repos.toString();
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:12,代码来源:CommitOperation.java


注:本文中的org.tigris.subversion.svnclientadapter.ISVNInfo.getRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。