svnkit:如何从SVN DB获取最新版本号? [英] svnkit: how to get latest revision number from SVN DB?
本文介绍了svnkit:如何从SVN DB获取最新版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用SVNKIT获取SVN数据库的最新版本号。我不想更新本地存储库并获取头版本号,我想直接联系SVN存储库并获取最新的版本号。请帮我 。
I want to get the latest revision number of the SVN database using SVNKIT. I don't want to update the local repository and get the head revision number , i want to directly contact the SVN repository and get the latest revision number. please help me .
推荐答案
DAVRepositoryFactory.setup();
String url = "(directory in svn url)";
String name = "(login name)";
String password = "(login password)";
SVNRepository repository = null;
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(name, password);
repository.setAuthenticationManager(authManager);
SVNDirEntry entry = repository.info(".", -1);
System.out.println("Latest Rev: " + entry.getRevision());
这篇关于svnkit:如何从SVN DB获取最新版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文