简体   繁体   English

SVNKit:检索文件以进行特定修订

[英]SVNKit: Retrieve files for specific revision

I'm writing a tool which will push changes to database after commit to svn. 我正在写一个工具,将在提交svn之后将更改推送到数据库。

The question is how to retrieve dirs for particular revision. 问题是如何检索特定修订版本的目录。

SVNClientImpl clientImpl = SVNClientImpl.newInstance();
clientImpl.username(name);
clientImpl.password(password);
DirEntry[] dirs = clientImpl.list(url, Revision.getInstance(revision), true);
for (DirEntry d : dirs) {
   if (d.getLastChangedRevisionNumber() != revision)
      System.out.println(d.getLastChangedRevisionNumber());
}

The thing is that in list() in this case retrives all dirs from url, no matter what revision they have. 问题是在这种情况下,无论它们具有什么修订版本,在list()中都从url中检索所有目录。 Of course I can stripped them using if (as it is done now), but I don't think it's good approach. 当然,我可以使用if (现在已完成)剥离它们,但是我认为这不是一个好方法。

Is there a specific method for that? 是否有特定的方法?

AFAIK there is no such method and if there would be one, the SVN protocol would have to support this kind of query too, otherwise you will gain no performance improvement. AFAIK没有这种方法,如果有这种方法,SVN协议也必须支持这种查询,否则您将不会获得性能上的提高。 You may issue a log() to find out changed paths of your target revision and query the repository for each of them. 您可以发出log()来找出目标修订版的更改路径,并为每个查询存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM