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


Java SVNRevision.Number方法代码示例

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


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

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

示例2: recountStartRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的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: rollback

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
/**
 * Overwrites local file with this revision.
 *
 * @param event
 */
private static void rollback(final RepositoryRevision.Event[] events) {
    // TODO: confirmation
    SVNUrl repository = events[0].getLogInfoHeader().getRepositoryRootUrl();
    RequestProcessor rp = Subversion.getInstance().getRequestProcessor(repository);
    SvnProgressSupport support = new SvnProgressSupport() {
        @Override
        public void perform() {
            for(RepositoryRevision.Event event : events) {
                File file = event.getFile();
                boolean wasDeleted = event.getChangedPath().getAction() == 'D';
                SVNUrl repoUrl = event.getLogInfoHeader().getRepositoryRootUrl();
                SVNUrl fileUrl = repoUrl.appendPath(event.getChangedPath().getPath());                    
                SVNRevision.Number revision = event.getLogInfoHeader().getLog().getRevision();
                SvnUtils.rollback(file, repoUrl, fileUrl, revision, wasDeleted, getLogger());
            }
        }
    };
    support.start(rp, repository, NbBundle.getMessage(SummaryView.class, "MSG_Rollback_Progress")); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:SummaryView.java

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

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

示例6: testCommitFolderNonRecursively

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
public void testCommitFolderNonRecursively() throws Exception {                
    File folder = createFolder("folder");
    File file = createFile(folder, "file");
            
    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", false);
    
    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
    
    assertTrue(file.exists());        
    assertStatus(SVNStatusKind.ADDED, file);                
    assertStatus(SVNStatusKind.NORMAL, folder);                
    assertNotSame(revisionBefore, revisionAfter);
    assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
    assertNotifiedFiles(new File[] {folder});
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:CommitTestHidden.java

示例7: testUpdateFilePrevRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
private void testUpdateFilePrevRevision(String folder1Name,
                                        String folder2Name,
                                        String fileName) throws Exception {
    File wc1 = createFolder(folder1Name);
    File file1 = createFile(wc1, fileName);
    write(file1, 1);
    importFile(wc1);
                    
    assertStatus(SVNStatusKind.NORMAL, wc1);
    assertStatus(SVNStatusKind.NORMAL, file1);
                                    
    File wc2 = createFolder(folder2Name);
    File file2 = new File(wc2, fileName);
    
    SVNUrl url = getTestUrl().appendPath(wc1.getName());
    ISVNClientAdapter c = getNbClient();         
    c.checkout(url, wc2, SVNRevision.HEAD, true);
    assertStatus(SVNStatusKind.NORMAL, file2);
    assertContents(file2, 1);
            
    SVNRevision prevRev = (SVNRevision.Number) getRevision(getRepoUrl());
    
    write(file2, 2);
    assertStatus(SVNStatusKind.MODIFIED, file2);
    commit(file2);
    assertStatus(SVNStatusKind.NORMAL, file2);

    clearNotifiedFiles();             
    long r = c.update(file1, prevRev, false);
    
    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
            
    assertNotSame(r, ((SVNRevision.Number)revisionAfter).getNumber());
    assertEquals(((SVNRevision.Number)prevRev).getNumber(), r);
    assertStatus(SVNStatusKind.NORMAL, file1);
    assertContents(file1, 1);        
    assertNotifiedFiles(new File[] { /*file1*/ }); // XXX no output from cli!
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:UpdateTestHidden.java

示例8: endElement

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
@Override
public void endElement(String uri, String localName, String name) throws SAXException {
    tag = null;
    if (ENTRY_ELEMENT_NAME.equals(name)) {                      
        if(values != null) {
                                                            
            String commit = values.get(COMMIT_ELEMENT_NAME);
            if (commit != null) {
            
                String author = values.get(AUTHOR_ELEMENT_NAME);

                Date date = null;
                String dateValue = values.get(DATE_ELEMENT_NAME);
                if(dateValue != null) {
                    try {
                        date = dateFormat.parse(dateValue);
                    } catch (ParseException ex) {
                        // ignore
                    }
                }
                
                SVNRevision.Number rev = null;
                String revisionValue = values.get(REVISION_ATTR);
                if(revisionValue != null && !revisionValue.trim().equals("")) {
                    try {
                        rev = new SVNRevision.Number(Long.parseLong(revisionValue));
                    } catch (NumberFormatException e) {
                        rev = new SVNRevision.Number(-1);
                    }
                }               
                annotations.add(new Annotation(rev.getNumber(), author, date, null));
            } else {
                annotations.add(null);
            }                             
        }
    } else if(TARGET_ELEMENT_NAME.equals(name)) {                                                
        values = null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:BlameCommand.java

示例9: getRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
private Number getRevision(String revisionValue) {
    Number rev = null;
    if (revisionValue != null && !revisionValue.trim().equals("")) {
        try {
            rev = new SVNRevision.Number(Long.parseLong(revisionValue));
        } catch (NumberFormatException e) {
            // ignore
            new SVNRevision.Number(-1);
        }
    }
    return rev;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:LogCommand.java

示例10: getValue

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
@Override
public Object getValue() throws IllegalAccessException, InvocationTargetException {
    SVNRevision r = entry.getLastChangedRevision();
    if (r instanceof SVNRevision.Number) {
        return ((SVNRevision.Number) r).getNumber();
    } else if (r == null) {
        return "";
    } else {
        return r.toString();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:RepositoryPathNode.java

示例11: rollback

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
void rollback () {
    SvnProgressSupport support = new SvnProgressSupport() {
        @Override
        public void perform() {
            File file = getFile();
            boolean wasDeleted = getChangedPath().getAction() == 'D';
            SVNUrl repoUrl = getLogInfoHeader().getRepositoryRootUrl();
            SVNUrl fileUrl = repoUrl.appendPath(getChangedPath().getPath());                    
            SVNRevision.Number revision = getLogInfoHeader().getLog().getRevision();
            SvnUtils.rollback(file, repoUrl, fileUrl, revision, wasDeleted, getLogger());
        }
    };
    support.start(Subversion.getInstance().getRequestProcessor(repositoryRootUrl),
            repositoryRootUrl, NbBundle.getMessage(RepositoryRevision.class, "MSG_Rollback_Progress")); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:RepositoryRevision.java

示例12: getRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
public SVNRevision.Number getRevision() {
    return revision;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ParserSvnInfo.java

示例13: getCopyRev

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
public SVNRevision.Number getCopyRev() {
    return revisionCopiedFrom;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ParserSvnInfo.java

示例14: getLastChangedRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
public SVNRevision.Number getLastChangedRevision() {
    return lastChangedRevision;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ParserSvnInfo.java

示例15: getRevision

import org.tigris.subversion.svnclientadapter.SVNRevision; //导入方法依赖的package包/类
public SVNRevision.Number getRevision() {
           return getNumber(infoMap.get(INFO_REVISION));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:InfoCommand.java


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