2011-09-02 5 views
3

샘플 Java 코드를 사용하여 파일의 버전 기록을 가져 왔지만 버전은 하나뿐입니다. 이 파일의 저장소에는 많은 개정이 있습니다. 그렇다면이 파일의 모든 개정판을 한 번에 어떻게 얻을 수 있습니까? 최종 개정SVNkit을 사용하여 특수 파일에 대한 모든 개정판을 구할 수 있습니까?

… 
long startRevision = -1; 
long endRevision = 0; //HEAD (i.e. the latest) revision 

SVNRepositoryFactoryImpl.setup(); 
repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url)); 
ISVNAuthenticationManager authManager = 
     SVNWCUtil.createDefaultAuthenticationManager(name, password); 
repository.setAuthenticationManager(authManager); 

Collection logEntries = null; 
logEntries = repository.log(new String[] { "EJB.java" }, null, startRevision, 
          endRevision, true, true); 
… 

답변

1

시작 개정을 사용하여 0과 -1

0

(로그를 확인하고 그 logEntries 이제

SVNRepository repository = null; 
      repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); 
      ISVNAuthenticationManager authManager = 
           SVNWCUtil.createDefaultAuthenticationManager("", ""); 
      repository.setAuthenticationManager(authManager); 
      SvnOperationFactory operationFactory = new SvnOperationFactory(); 
      SvnLog logOperation = operationFactory.createLog(); 
      logOperation.setSingleTarget(
        SvnTarget.fromURL(
          SVNURL.parseURIEncoded(url))); 
      logOperation.setRevisionRanges(Collections.singleton(
        SvnRevisionRange.create(
          SVNRevision.create(1), 
          SVNRevision.HEAD 
        ) 
      )); 
      Collection<SVNLogEntry> logEntries = logOperation.run(null); 

logEntries throught를 반복하고 logEntry.getRevision을 사용을 사용하여 버전을 얻을) 날짜까지 모든 개정판을 가져올 수 있습니다.

관련 문제