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

Java SVNRevision类代码示例

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

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



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

示例1: testCopyURL2File

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCopyURL2File(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), filecopy, SVNRevision.HEAD);

    assertTrue(filecopy.exists());
    assertStatus(SVNStatusKind.ADDED, filecopy);
    if (isSvnkit()) {
        // svnkit does not notify about files
        assertNotifiedFiles(new File[] {});
    } else {
        assertNotifiedFiles(new File[] {filecopy});
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:CopyTestHidden.java


示例2: getStagedFiles

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public List<UIFile> getStagedFiles( String oldCommitId, String newCommitId ) {
  List<UIFile> files = new ArrayList<UIFile>();
  try {
    Arrays.stream( svnClient.diffSummarize( svnClient.getInfoFromWorkingCopy( root ).getUrl(), null, new SVNRevision.Number( Long.parseLong( oldCommitId ) ),
         new SVNRevision.Number( Long.parseLong( newCommitId ) ),
        100, true ) )
      .forEach( diffStatus -> {
          files.add( new UIFile( diffStatus.getPath().replaceFirst( directory.replace( "\\", "\\\\" ), "" ),
              convertTypeToGit( diffStatus.getDiffKind().toString() ), false ) );
      }
      );
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return files;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:18,代码来源:SVN.java


示例3: pull

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public boolean pull() {
  try {
    SVNRevision.Number lastRevision = svnClient.getInfoFromWorkingCopy( root ).getRevision();
    long newLastRevision = svnClient.update( root, SVNRevision.HEAD, true );
    if ( lastRevision.getNumber() == newLastRevision ) {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), "Up-to-date" );
    } else {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
    }
    return true;
  } catch ( SVNClientException e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return false;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:17,代码来源:SVN.java


示例4: testListFiles

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testListFiles() throws Exception {                        
    File file1 = createFile("file1");
    File file2 = createFile("file2");
    File file3 = createFile("file3");
            
    add(file1);                       
    add(file2);                       
    add(file3);                       
    commit(getWC());
                            
    ISVNDirEntry[] entries1 = getNbClient().getList(getTestUrl().appendPath(getWC().getName()), SVNRevision.HEAD, false);        
    assertEquals(3, entries1.length);
    ISVNDirEntry[] entries2 = getFullWorkingClient().getList(getTestUrl().appendPath(getWC().getName()), SVNRevision.HEAD, false);
    
    assertEntryArrays(entries1, entries2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ListTestHidden.java


示例5: selectItem

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void selectItem (JComboBox cmbDiffTree, SVNRevision revision) {
    Object toSelect = null;
    if (fileUrl != null) {
        DefaultComboBoxModel model = (DefaultComboBoxModel) cmbDiffTree.getModel();
        for (int i = 0; i < model.getSize(); ++i) {
            Object o = model.getElementAt(i);
            if (o instanceof RepositoryFile) {
                RepositoryFile inModel = (RepositoryFile) o;
                if (inModel.getFileUrl().equals(fileUrl) && revision.equals(inModel.getRevision())) {
                    toSelect = o;
                    break;
                }
            }
        }
    }
    if (toSelect != null) {
        cmbDiffTree.setSelectedItem(toSelect);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:MultiDiffPanel.java


示例6: testCommitFile

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCommitFile(String path) throws Exception {
    createAndCommitParentFolders(path);
    File file = createFile(path);

    add(file);
    assertStatus(SVNStatusKind.ADDED, file);

    SVNRevision revisionBefore = (SVNRevision.Number) getRevision(getRepoUrl());

    ISVNClientAdapter client = getNbClient();

    long r = client.commit(new File[] {file}, "commit", true);

    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());

    assertTrue(file.exists());
    assertStatus(SVNStatusKind.NORMAL, file);
    assertNotSame(revisionBefore, revisionAfter);
    assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
    assertNotifiedFiles(file);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:CommitTestHidden.java


示例7: testCommitFolder

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCommitFolder(String folderName, String fileName) throws Exception {
    File folder = createFolder(folderName);
    File file = createFile(folder, fileName);
            
    add(folder);               
    assertStatus(SVNStatusKind.ADDED, file);
    assertStatus(SVNStatusKind.ADDED, folder);

    SVNRevision revisionBefore = (SVNRevision.Number) getRevision(getRepoUrl());
    
    ISVNClientAdapter client = getNbClient();        
    long r = client.commit(new File[] {folder}, "commit", true);
    
    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
    
    assertTrue(file.exists());        
    assertStatus(SVNStatusKind.NORMAL, file);                
    assertStatus(SVNStatusKind.NORMAL, folder);                
    assertNotSame(revisionBefore, revisionAfter);
    assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
    assertNotifiedFiles(new File[] {file, folder});
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:CommitTestHidden.java


示例8: rollback

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public boolean rollback( String name ) {
  if ( !isClean() ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), "Dirty working-tree" );
    return false;
  }
  try {
    svnClient.merge( new SVNUrl( getRemote() ),
        null,
        new SVNRevisionRange[] { new SVNRevisionRange(
            svnClient.getInfoFromWorkingCopy( root ).getRevision(),
            new SVNRevision.Number( Long.parseLong( name ) )
            ) },
        root,
        false, 100, true, false, false );
    return true;
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return false;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:22,代码来源:SVN.java


示例9: RepositoryFile

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public RepositoryFile(SVNUrl repositoryUrl, String[] pathSegments, SVNRevision revision) throws MalformedURLException {
    this(repositoryUrl, revision);
    this.pathSegments = pathSegments;    
    repositoryRoot = pathSegments == null;        
    
    if(!repositoryRoot) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < pathSegments.length; i++) {
            sb.append(pathSegments[i]);
            if(i<pathSegments.length-1) {
            sb.append("/"); // NOI18N
            }            
        }
        path = sb.toString();        
        fileUrl = repositoryUrl.appendPath(path);        
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:RepositoryFile.java


示例10: testSwitchToFile

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testSwitchToFile() throws Exception {                                        
    File file = createFile("file");
    add(file);
    commit(file);
            
    File filecopy = createFile("filecopy");
    
    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), getFileUrl(filecopy), "copy", SVNRevision.HEAD);

    assertCopy(getFileUrl(filecopy));
    assertInfo(file, getFileUrl(file));
    
    c.switchToUrl(file, getFileUrl(filecopy), SVNRevision.HEAD, false);
    
    assertInfo(file, getFileUrl(filecopy));         
    assertNotifiedFiles();// XXX empty also in svnCA - why?! - no output from cli
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:SwitchToTestHidden.java


示例11: getResortedRevisionInterval

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private RevisionInterval getResortedRevisionInterval(SVNRevision revision1, SVNRevision revision2) {
    RevisionInterval ret; 
    if(revision1.equals(SVNRevision.HEAD) && revision1.equals(SVNRevision.HEAD)) {
        ret = new RevisionInterval (revision1, revision2);
    } else if (revision1.equals(SVNRevision.HEAD)) {
        ret = new RevisionInterval (revision2, revision1);
    } else if (revision2.equals(SVNRevision.HEAD)) {
        ret = new RevisionInterval (revision1, revision2);                
    } else {
        Long r1 = Long.parseLong(revision1.toString());
        Long r2 = Long.parseLong(revision2.toString());
        if(r1.compareTo(r2) < 0) {
            ret = new RevisionInterval (revision1, revision2);
        } else {
            ret = new RevisionInterval (revision2, revision1);
        }
    }
    return ret;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:RevertModifications.java


示例12: testDiffSame

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testDiffSame () throws Exception {
    // init
    File folder = new File(wc, "folder");
    File file = new File(folder, "file");
    folder.mkdirs();
    file.createNewFile();
    
    add(folder);
    commit(folder);
    
    RepositoryFile left = new RepositoryFile(repoUrl, wc.getName() + "/folder", SVNRevision.HEAD);
    RepositoryFile right = new RepositoryFile(repoUrl, wc.getName() + "/folder", SVNRevision.HEAD);
    final RevisionSetupsSupport revSupp = new RevisionSetupsSupport(left, right, repoUrl, new Context(folder));
    final AtomicReference<Setup[]> ref = new AtomicReference<>();
    new SvnProgressSupport() {
        @Override
        protected void perform () {
            ref.set(revSupp.computeSetupsBetweenRevisions(this));
        }
    }.start(RequestProcessor.getDefault(), repoUrl, "bbb").waitFinished();
    Setup[] setups = ref.get();
    assertNotNull(setups);
    assertEquals(0, setups.length);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:RevisionSetupSupportTest.java


示例13: testCheckoutFolder

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCheckoutFolder(String repoFolderName,
                                String targetFolderName) throws Exception {
    File cifolder = createFolder(repoFolderName);
    File folder1 = createFolder(cifolder, "folder1");
    File file = createFile(folder1, "file");

    importFile(cifolder);        

    File checkout = createFolder(targetFolderName);
    SVNUrl url = getTestUrl().appendPath(cifolder.getName());
    ISVNClientAdapter c = getNbClient();         
    c.checkout(url, checkout, SVNRevision.HEAD, true);
            
    File chFolder1 = new File(checkout, folder1.getName());
    File chFile = new File(chFolder1, file.getName());
    
    assertTrue(chFolder1.exists());
    assertTrue(chFile.exists());
    assertStatus(SVNStatusKind.NORMAL, checkout);                   
    assertStatus(SVNStatusKind.NORMAL, chFolder1);        
    assertStatus(SVNStatusKind.NORMAL, chFile);

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


示例14: testCopyURL2FilePrevRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private void testCopyURL2FilePrevRevision(String srcPath,
                                          String targetFileName) throws Exception {
    createAndCommitParentFolders(srcPath);
    File file = createFile(srcPath);
    write(file, 1);
    add(file);
    commit(file);
    SVNRevision prevRev = getRevision(file);
    write(file, 2);
    commit(getWC());

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

    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), filecopy, prevRev);

    assertContents(filecopy, 1);
    if (isSvnkit()) {
        // svnkit does not notify about files
        assertNotifiedFiles(new File[] {});
    } else {
        assertNotifiedFiles(new File[] {filecopy});
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:CopyTestHidden.java


示例15: merge

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
@Override
public boolean merge() {
  String name = null;
  List<String> names = getBranches();
  EnterSelectionDialog esd = new EnterSelectionDialog( shell, names.toArray( new String[names.size()] ),
    "Select Branch", "Select the branch to be merged (reintegrated) into the current working copy" );
  name = esd.open();
  if ( name == null ) {
    return false;
  }
  try {
    svnClient.mergeReintegrate( new SVNUrl( getRemoteRoot() + File.separator + name ),
        SVNRevision.HEAD, root, false, false );
    return true;
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return false;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:20,代码来源:SVN.java


示例16: testDiffNoChange

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public void testDiffNoChange () throws Exception {
    // init
    File trunk = new File(wc, "trunk");
    File folder = new File(trunk, "folder");
    File file = new File(folder, "file");
    folder.mkdirs();
    file.createNewFile();
    
    add(trunk);
    commit(trunk);
    
    RepositoryFile left = new RepositoryFile(repoUrl, wc.getName() + "/trunk/folder", SVNRevision.HEAD);
    RepositoryFile right = new RepositoryFile(repoUrl, wc.getName() + "/branches/B/folder", SVNRevision.HEAD);
    getClient().copy(left.getFileUrl(), right.getFileUrl(), "copying...", SVNRevision.HEAD, true);
    
    final RevisionSetupsSupport revSupp = new RevisionSetupsSupport(left, right, repoUrl, new Context(folder));
    final AtomicReference<Setup[]> ref = new AtomicReference<>();
    new SvnProgressSupport() {
        @Override
        protected void perform () {
            ref.set(revSupp.computeSetupsBetweenRevisions(this));
        }
    }.start(RequestProcessor.getDefault(), repoUrl, "bbb").waitFinished();
    Setup[] setups = ref.get();
    assertNotNull(setups);
    assertEquals(0, setups.length);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:RevisionSetupSupportTest.java


示例17: addPropertySetups

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
private List<Setup> addPropertySetups (SvnClient client, SVNUrl leftFileUrl, SVNRevision leftRevision,
        SVNUrl rightFileUrl, SVNRevision rightRevision) throws SVNClientException {
    List<Setup> propSetups = new ArrayList<>();
    DiffProvider diffAlgorithm = (DiffProvider) Lookup.getDefault().lookup(DiffProvider.class);
    try {
        Map<String, byte[]> leftProps = leftFileUrl == null
                ? Collections.<String, byte[]>emptyMap()
                : toMap(client.getProperties(leftFileUrl, leftRevision, leftRevision));
        Map<String, byte[]> rightProps = rightFileUrl == null
                ? Collections.<String, byte[]>emptyMap()
                : toMap(client.getProperties(rightFileUrl, rightRevision, rightRevision));

        Set<String> allProps = new TreeSet<>(leftProps.keySet());
        allProps.addAll(rightProps.keySet());
        for (String key : allProps) {
            boolean isLeft = leftProps.containsKey(key);
            boolean isRight = rightProps.containsKey(key);
            boolean propertiesDiffer = true;
            if (isLeft && isRight) {
                MultiDiffPanel.Property p1 = new MultiDiffPanel.Property(leftProps.get(key));
                MultiDiffPanel.Property p2 = new MultiDiffPanel.Property(rightProps.get(key));
                Difference[] diffs = diffAlgorithm.computeDiff(p1.toReader(), p2.toReader());
                propertiesDiffer = (diffs.length != 0);
            }
            if (propertiesDiffer) {
                // TODO finish property setups init
            }
        }
    } catch (IOException e) {
        Subversion.LOG.log(Level.INFO, null, e);
    }
    return propSetups;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:RevisionSetupsSupport.java


示例18: handleLogException

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public static boolean handleLogException(SVNUrl url, SVNRevision revision, SVNClientException e) {
    String protocol = url.getProtocol();
    if(  ( protocol.startsWith("https") && SvnClientExceptionHandler.isSecureConnTruncated(e.getMessage()) ) ||                    
         ( protocol.startsWith("http") && SvnClientExceptionHandler.isReportOf200(e.getMessage())              ) ||
         ( ( protocol.startsWith("file") || protocol.startsWith("svn+") ) && SvnClientExceptionHandler.isFileNotFoundInRevision(e.getMessage()) ) ) 
    {            
        Subversion.LOG.log(Level.INFO, e.getMessage(), e);    // keep track
        annotate(NbBundle.getMessage(SvnClientExceptionHandler.class, "MSG_ErrorFileNotFoundInRevision", new String[] {revision.toString()} )); // NOI18N                      
        return true;
    } 
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SvnClientExceptionHandler.java


示例19: InfoCommand

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public InfoCommand(File[] files, SVNRevision revision, SVNRevision pegging) {
    this.files = files;
    this.revision = revision;
    this.pegging = pegging;
    
    url = null;
    
    type = InfoType.files;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:InfoCommand.java


示例20: getRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入依赖的package包/类
public SVNRevision getRevision() {
    
    if (revisionTextField == null) {
        return SVNRevision.HEAD;
    }
    String revisionString = getRevisionString();

    if (revisionString.equals("")) {
        return SVNRevision.HEAD;
    }            
    return SvnUtils.getSVNRevision(revisionString);        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:RepositoryPaths.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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