[英]How to get SVNKit log between two dates?
我正在使用SVNKit 1.7,我想獲得兩個日期之間條目的歷史記錄。 我找到的所有文檔僅顯示檢索兩個修訂號之間的條目。
我基本上想要運行以下命令
svn log -v --xml --non-interactive --no-auth-cache http://foo.com --username myusername --password mypassword -r {""2012-10-02""}:{""2012-11-01""}
現在我正在通過命令行執行此操作,使用Runtime類在Java中調用它。
我使用此信息的目的是按月生成SVN活動的指標。
如果我必須使用修訂號,有沒有辦法根據日期找到最近的修訂版#?
謝謝你的幫助。
謝謝Dmitry你的回答非常有幫助,但我最終使用了org.tmatesoft.svn.core.io.SVNRepository類和該類的getDatedRevision()方法。 在查看文檔時,我多次瀏覽了這個方法。
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
try {
final SVNURL url = ...;
svnOperationFactory.setAuthenticationManager(new BasicAuthenticationManager("myusername", "mypassword"));
final SvnLog log = svnOperationFactory.createLog();
log.addRange(SvnRevisionRange.create(SVNRevision.create(date1), SVNRevision.create(date2)));
log.setDiscoverChangedPaths(true);
log.setSingleTarget(SvnTarget.fromURL(url));
log.setReceiver(new ISvnObjectReceiver<SVNLogEntry>() {
@Override
public void receive(SvnTarget target, SVNLogEntry logEntry) throws SVNException {
...
}
});
log.run();
} finally {
svnOperationFactory.dispose();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.