• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ISVNInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getPropertyFile

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private File getPropertyFile(boolean base) throws SVNClientException {
    SvnClient client = Subversion.getInstance().getClient(false);
    ISVNInfo info = null;
    try {
        info = SvnUtils.getInfoFromWorkingCopy(client, file);
    } catch (SVNClientException ex) {
        throw ex;
    }
    if(info instanceof ParserSvnInfo) {
        if(base) {
            return ((ParserSvnInfo) info).getBasePropertyFile();
        } else {
            return ((ParserSvnInfo) info).getPropertyFile();
        }
    } else {
        return SvnWcUtils.getPropertiesFile(file, base);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:PropertiesClient.java


示例2: recountStartRevision

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private static RevertModifications.RevisionInterval recountStartRevision(SvnClient client, SVNUrl repository, RevertModifications.RevisionInterval ret) throws SVNClientException {
    SVNRevision currStartRevision = ret.startRevision;
    SVNRevision currEndRevision = ret.endRevision;

    if(currStartRevision.equals(SVNRevision.HEAD)) {
        ISVNInfo info = client.getInfo(repository);
        currStartRevision = info.getRevision();
    }

    long currStartRevNum = Long.parseLong(currStartRevision.toString());
    long newStartRevNum = (currStartRevNum > 0) ? currStartRevNum - 1
                                                : currStartRevNum;

    return new RevertModifications.RevisionInterval(
                                     new SVNRevision.Number(newStartRevNum),
                                     currEndRevision);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:RevertModificationsAction.java


示例3: checkUrlExistance

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private ISVNInfo checkUrlExistance (SvnClient client, SVNUrl url, SVNRevision revision) throws SVNClientException {
    if (url == null) {
        // local file, not yet in the repository
        return null;
    }
    if (parentMissing(url, revision)) {
        return null;
    }
    try {
        return client.getInfo(url, revision, revision);
    } catch (SVNClientException ex) {
        if (SvnClientExceptionHandler.isWrongURLInRevision(ex.getMessage())){
            cacheParentMissing(url, revision);
            return null;
        } else {
            throw ex;
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:RevisionSetupsSupport.java


示例4: validateInput

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private boolean validateInput(File root, RepositoryFile toRepositoryFile) {
    boolean ret = false;
    SvnClient client;
    try {                   
        client = Subversion.getInstance().getClient(toRepositoryFile.getRepositoryUrl());
        ISVNInfo info = client.getInfo(toRepositoryFile.getFileUrl());
        if(info.getNodeKind() == SVNNodeKind.DIR && root.isFile()) {
            SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFileToFolderError"));
            ret = false;
        } else if(info.getNodeKind() == SVNNodeKind.FILE && root.isDirectory()) {
            SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFolderToFileError"));
            ret = false;
        } else {
            ret = true;
        }
    } catch (SVNClientException ex) {
        SvnClientExceptionHandler.notifyException(ex, true, true);
        return ret;
    }                            
    return ret;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:SwitchToAction.java


示例5: validateTargetPath

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private String validateTargetPath(CreateCopy createCopy) {
    String errorText = null;
    try {
        RepositoryFile toRepositoryFile = createCopy.getToRepositoryFile();
        SvnClient client = Subversion.getInstance().getClient(toRepositoryFile.getRepositoryUrl());
        ISVNInfo info = null;
        try {
            info = client.getInfo(toRepositoryFile.getFileUrl());
        } catch (SVNClientException e) {
            if (!SvnClientExceptionHandler.isWrongUrl(e.getMessage())) {
                throw e;
            }
        }
        if (info != null) {
            errorText = NbBundle.getMessage(CreateCopyAction.class, "MSG_CreateCopy_Target_Exists");     // NOI18N
        }
    } catch (SVNClientException ex) {
        errorText = null;
    }
    return errorText;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:CreateCopyAction.java


示例6: importIntoExisting

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
/**
 * Checks if the target folder already exists in the repository.
 * If it does exist, user will be asked to confirm the import into the existing folder.
 * @param client
 * @param repositoryFileUrl
 * @return true if the target does not exist or user wishes to import anyway.
 */
private boolean importIntoExisting(SvnClient client, SVNUrl repositoryFileUrl) {
    try {
        ISVNInfo info = client.getInfo(repositoryFileUrl);
        if (info != null) {
            // target folder exists, ask user for confirmation
            final boolean flags[] = {true};
            NotifyDescriptor nd = new NotifyDescriptor(NbBundle.getMessage(ImportStep.class, "MSG_ImportIntoExisting", SvnUtils.decodeToString(repositoryFileUrl)), //NOI18N
                    NbBundle.getMessage(ImportStep.class, "CTL_TargetFolderExists"), NotifyDescriptor.YES_NO_CANCEL_OPTION, //NOI18N
                    NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION);
            if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.YES_OPTION) {
                flags[0] = false;
            }
            return flags[0];
        }
    } catch (SVNClientException ex) {
        // ignore
    }
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ImportStep.java


示例7: testCopyURL2URL

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testCopyURL2URL(String srcPath, String targetFileName) throws Exception {
    createAndCommitParentFolders(srcPath);
    File file = createFile(srcPath);
    add(file);
    commit(file);

    File filecopy = createFile(renameFile(srcPath, targetFileName));
    filecopy.delete();

    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), getFileUrl(filecopy), "copy", SVNRevision.HEAD);

    ISVNInfo info = getInfo(getFileUrl(filecopy));
    assertNotNull(info);
    assertEquals(getFileUrl(filecopy), TestUtilities.decode(info.getUrl()));

    assertNotifiedFiles(new File[] {});
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:CopyTestHidden.java


示例8: testCopyFile2URL

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testCopyFile2URL(String srcPath, String targetFileName) throws Exception {
        createAndCommitParentFolders(srcPath);
        File file = createFile(srcPath);
        add(file);
        commit(file);

        // File filecopy = new File(createFolder(file.getParentFile(), targetFileName), file.getName());
        File filecopy = createFile(renameFile(srcPath, targetFileName));

        ISVNClientAdapter c = getNbClient();
//        c.copy(file, getFileUrl(filecopy), "copy"); XXX is failing with javahl and we don't use it anyway
        c.copy(new File[] {file}, getFileUrl(filecopy), "copy", false, true);

        ISVNInfo info = getInfo(getFileUrl(filecopy));
        assertNotNull(info);
        assertEquals(getFileUrl(filecopy), TestUtilities.decode(info.getUrl()));
        assertNotifiedFiles(new File[] {});
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:CopyTestHidden.java


示例9: testCopyFile2File

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testCopyFile2File(String srcPath, String target) throws Exception {
        createAndCommitParentFolders(srcPath);
        File file = createFile(srcPath);
        add(file);
        commit(file);

        // File filecopy = new File(createFolder(file.getParentFile(), targetFileName), file.getName());
        File filecopy = new File(file.getParentFile(), target);

        ISVNClientAdapter c = getNbClient();
//        c.copy(file, getFileUrl(filecopy), "copy"); XXX is failing with javahl and we don't use it anyway
        c.copy(file, filecopy);

        assertTrue(filecopy.exists());

        ISVNInfo info = getInfo(filecopy);
        assertNotNull(info);
        assertEquals(getFileUrl(filecopy), TestUtilities.decode(info.getUrl()));
        assertNotifiedFiles(new File[] {});
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:CopyTestHidden.java


示例10: testInfoLocked

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testInfoLocked(String filePath) throws Exception {
    if(!isCommandLine()) {
        return;
    }
    createAndCommitParentFolders(filePath);
    File file = createFile(filePath);
    add(file);
    commit(file);
    String msg =
        "Tamaryokucha and other types of sencha are made in essentially the same way.\n" +
        "Slight differences in processing, however, give tamaryokucha its characteristic\n" +
        "fresh taste and reduced astringency.";
    lock(file, msg, true);

    ISVNClientAdapter c = getNbClient();

    ISVNInfo info1 = c.getInfo(getFileUrl(file));
    ISVNInfo info2 = getInfo(getFileUrl(file));

    assertTrue(info1.getLockComment().startsWith("Tamaryokucha"));
    assertInfos(info1, info2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:InfoTestHidden.java


示例11: testInfoCopied

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void testInfoCopied(String srcFileName,
                            String targetFileName) throws Exception {
    File file = createFile(srcFileName);
    add(file);
    commit(file);
    
    File copy = new File(targetFileName);
    copy(getFileUrl(file), getFileUrl(copy));
    
    ISVNClientAdapter c = getNbClient();
   
    ISVNInfo info1 = c.getInfo(getFileUrl(copy));        
    ISVNInfo info2 = getInfo(getFileUrl(copy));
    
    assertInfos(info1, info2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:InfoTestHidden.java


示例12: blameNullAuthor

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void blameNullAuthor(Annotator annotator) throws Exception {                                
    
    File file = createFile("file");
    add(file);
    commit(file);
    
    // 1. line
    write(file, "a\n");
    anoncommit(file);
    ISVNInfo info = getInfo(file);
    Number rev1 = info.getRevision();

    ISVNAnnotations a1 = annotator.annotate(getNbClient(), file, null, null);
    
    // test 
    assertEquals(1, a1.numberOfLines());        
    assertEquals("a", a1.getLine(0));        
    assertNull(a1.getAuthor(0));
    // assertNull(a.getChanged(0)); is null only for svnClientAdapter
    assertEquals(rev1.getNumber(), a1.getRevision(0));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:BlameTestHidden.java


示例13: testImportFile

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
public void testImportFile(String fileToImport, String lastUrlPart) throws Exception {
    File file = createFile(fileToImport);
            
    assertTrue(file.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getRepoUrl().appendPath(getName()).appendPath(lastUrlPart);
    c.doImport(file, url, "imprd", false);

    assertTrue(file.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, file);

    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {file});    // XXX empty also in svnCA - why?! - no output from cli    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ImportTestHidden.java


示例14: testImportFolder

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
public void testImportFolder() throws Exception {                                        
    File folder = createFolder("folder");
            
    assertTrue(folder.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName()); 
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.mkdir(url, "mrkvadir");        
    c.doImport(folder, url, "imprd", false);

    assertTrue(folder.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {});        // XXX empty also in svnCA - why?! - no output from cli
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ImportTestHidden.java


示例15: diff

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
@Override
public String diff( String oldCommitId, String newCommitId, String file ) {
  AbstractJhlClientAdapter client = (AbstractJhlClientAdapter) svnClient;
  OutputStream outStream = new ByteArrayOutputStream();
  try {
    String target = directory + File.separator + FilenameUtils.separatorsToSystem( file );
    ISVNInfo info = svnClient.getInfoFromWorkingCopy( new File( target ) );
    if ( info instanceof SVNInfoUnversioned ) {
      return "Unversioned";
    }
    if ( info.getRevision() == null || info.isCopied() ) { // not commited yet or copied
      oldCommitId = null;
    }
    client.getSVNClient().diff(
        target,
        null, resolveRevision( oldCommitId ), resolveRevision( newCommitId ),
        directory.replace( "\\", "/" ), outStream, Depth.infinityOrImmediates( true ), null, true, false, false, true, false, false );
    return outStream.toString().replaceAll( "\n", System.getProperty( "line.separator" ) );
  } catch ( Exception e ) {
    return e.getMessage();
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:23,代码来源:SVN.java


示例16: acquireInfo

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
/**
 * Always contacts the repository.  In the future, might want to
 * allow for use of
 * <code>ISVNInfo.getInfoFromWorkingCopy()</code>, which uses only
 * the meta data from the WC.
 *
 * @exception SVNClientException If ISVNInfo.getInfo(target)
 * fails.
 */
private ISVNInfo acquireInfo() throws SVNClientException {
    File targetAsFile = new File( Project.translatePath( this.target ) );
    if( targetAsFile.exists() ) {
        // Since the target exists locally, assume it's not a URL.
        return getClient().getInfo( targetAsFile );
    } else {
        try {
            SVNUrl url = new SVNUrl( this.target );
            return getClient().getInfo( url );
        } catch( MalformedURLException ex ) {
            // Since we don't have a valid URL with which to
            // contact the repository, assume the target is a
            // local file, even though it doesn't exist locally.
            return getClient().getInfo( targetAsFile );
        }
    }
}
 
开发者ID:subclipse,项目名称:svnant,代码行数:27,代码来源:Info.java


示例17: acquireInfo

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
/**
 * Always contacts the repository. In the future, might want to allow for use of
 * <code>ISVNInfo.getInfoFromWorkingCopy()</code>, which uses only the meta data 
 * from the WC.
 *
 * @exception SVNClientException If ISVNInfo.getInfo(target) fails.
 */
private ISVNInfo acquireInfo() throws SVNClientException {
    File asfile = new File( Project.translatePath( target ) );
    if( asfile.exists() ) {
        // Since the target exists locally, assume it's not a URL.
        return getClient().getInfo( asfile );
    } else {
        try {
            SVNUrl url = new SVNUrl( target );
            return getClient().getInfo( url );
        } catch( MalformedURLException ex ) {
            // Since we don't have a valid URL with which to
            // contact the repository, assume the target is a
            // local file, even though it doesn't exist locally.
            return getClient().getInfo( asfile );
        }
    }
}
 
开发者ID:subclipse,项目名称:svnant,代码行数:25,代码来源:SingleInfo.java


示例18: autoShareProjectIfSVNWorkingCopy

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
private void autoShareProjectIfSVNWorkingCopy(IProject project) {
	ISVNClientAdapter client = null;
	try {
		client = SVNProviderPlugin.getPlugin().getSVNClient();
		SVNProviderPlugin.disableConsoleLogging();
		ISVNInfo info = client.getInfoFromWorkingCopy(project.getLocation().toFile());
		if (info != null) {
			SVNTeamProviderType.getAutoShareJob().share(project);
		}
	} catch (Exception e) {}
	finally {
	    SVNProviderPlugin.enableConsoleLogging();
	    if (client != null) {
	    	SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
	    }
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:FileModificationManager.java


示例19: getRemoteFile

import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入依赖的package包/类
public ISVNRemoteFile getRemoteFile(SVNUrl url) throws SVNException{
	ISVNClientAdapter svnClient = getSVNClient();
	ISVNInfo info = null;
	try {
		if (this.getRepositoryRoot().equals(url))
		    return new RemoteFile(this, url, SVNRevision.HEAD);
		else
		    info = svnClient.getInfo(url, SVNRevision.HEAD, SVNRevision.HEAD);
	} catch (SVNClientException e) {
		throw new SVNException(
			"Can't get latest remote resource for "
				+ url);
	}

	if (info == null)
		return null; // no remote file
	else {
		return new RemoteFile(null, // we don't know its parent
		this,
			url,
			SVNRevision.HEAD,
			info.getLastChangedRevision(),
			info.getLastChangedDate(),
			info.getLastCommitAuthor());
	}		
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:27,代码来源:SVNRepositoryLocation.java


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AlphaPatternDrawable类代码示例发布时间:2022-05-23
下一篇:
Java KeyControl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap