简体   繁体   English

svnkit:如何获取工作副本修订号?

[英]svnkit: how to get working copy revision number?

I am using SVNKit 1.3.2 and trying to obtain working copy revision number. 我正在使用SVNKit 1.3.2并尝试获取工作副本修订号。

Working copy is checkouted also with SVNKit, but when I'm trying to call SVNKit也可以签出工作副本,但是当我尝试调用时

clientManager.getLookClient().doGetYoungestRevision(destination);

I got FileNotFoundException telling me that 'format' file is not found under destination path, ex /path/to/working/copy/format 我收到FileNotFoundException告诉我在目标路径(例如/path/to/working/copy/format下找不到“ format”文件

I can see 2 troubles: - It tries to access 'format' file right in working directory root, while this file supposed to be in .svn folder 我看到2种麻烦:-它尝试直接在工作目录根目录中访问“格式”文件,而该文件应该位于.svn文件夹中

  • There is not file in this .svn folder. .svn文件夹中没有文件。

Any clues? 有什么线索吗? Thank you! 谢谢!

Seems to be it should be done through SVNStatusClient: 似乎应该通过SVNStatusClient完成:

clientManager.getStatusClient().doStatus(destination, false).getRevision().getNumber();

Though still don't understand what's the problem with doGetYoungestRevision(destination)... 尽管仍然不了解doGetYoungestRevision(destination)的问题是什么...

It is not working because doGetYoungestRevision is for a repository, not for a working copy. 它不起作用,因为doGetYoungestRevision用于存储库,而不用于工作副本。

I was hoping to achieve the same things as you, and found out that when destination is pointing to a repository, it returns the last revision number of the repository. 我希望能达到与您相同的destination ,并且发现当destination指向存储库时,它返回存储库的最新修订号。

The class in itself is for working with repository, you can look at the documentation here . 该类本身是用于存储库的类,您可以在此处查看文档。

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

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