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


Java ISVNInfo类代码示例

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


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


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