Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 .

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
669 views
Welcome To Ask or Share your Answers For Others

1 Answer

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()); 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...