Невозможно извлечь весь репозиторий SVN на локальный компьютер с помощью svnkit
Я пытаюсь извлечь весь SVN-репозиторий, используя svnkit для локального каталога, и когда я пытаюсь SVNUpdateClient updateClient = clientManger.getUpdateClient(); всегда возвращать ноль. Я использую svnkit для этого.
Вот мой код:
File wcFolder=new File("some directory path");
ISVNOptions myOptions=SVNWCUtil.createDefaultOptions(true);
ISVNAuthenticationManager myAuthManager=SVNWCUtil.createDefaultAuthenticationManager("xyz","abc");
SVNClientManager clientManger = SVNClientManager.newInstance(myOptions, myAuthManager);
SVNUpdateClient updateClient = clientManger.getUpdateClient();
updateClient.setIgnoreExternals(false);
updateClient.doCheckout(SVNURL.parseURIDecoded("some path to xyz/trunk"), wcFolder, SVNRevision.HEAD,SVNRevision.HEAD, SVNDepth.INFINITY, true);
1 ответ
Решение
Я нашел правильный способ проверить SVN,
SVNURL svnurl = SVNURL.parseURIDecoded(url);
SVNRepository repository = SVNRepositoryFactory.create(svnurl);
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(uname, password);
repository.setAuthenticationManager(authManager);
SVNClientManager ourClientManager = SVNClientManager.newInstance();
ourClientManager.setAuthenticationManager(authManager);
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(true);
long latestRevision = repository.getLatestRevision();
if (updateClient.doCheckout(svnurl, destinationDir,
SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY,
allowUnversionedObstructions) == latestRevision) {
ourClientManager.dispose();
}