开发者

SVNKit: Retrieve files for specific revision

开发者 https://www.devze.com 2022-12-25 13:51 出处:网络
I\'m writing a tool which will push changes to database after commit to svn. The question is how to retrieve dirs for particular revision.

I'm writing a tool which will push changes to database after commit to 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.开发者_如何学C Of course I can stripped them using if(as it is done now), but I don't think it's good approach.

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. You may issue a log() to find out changed paths of your target revision and query the repository for each of them.

0

精彩评论

暂无评论...
验证码 换一张
取 消