我想实现一个方法,可以从已检出SVN存储库的路径获取svn修订号.方法声明看起来像这样:
long getRevisionNumber(String localPath) { ... }
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用SVNKit,但它似乎需要一个SVN URL开头.有没有办法从本地路径开始?
我正在使用SVNKit从我们的存储库中获取文件的内容.我想在代码中更改内容并提交更改,而不必先检出文件.我已经搜索过网络,只找到了需要结账到本地文件系统的解决方案.
有谁知道这样做的方法?
我正在使用SVNKit,我发现测试Authentification到服务器的唯一方法是使用testConnection()类的方法SVNRepository.
该方法不返回布尔值但抛出异常.
public abstract void testConnection()
throws SVNException
Run Code Online (Sandbox Code Playgroud)
问题是,我得到了一个冷血错误,而不是被捕获:

这是我的代码:
clientManager = CreateObject("java", "org.tmatesoft.svn.core.wc.SVNClientManager").newInstance();
authManagerJO = CreateObject("java", "org.tmatesoft.svn.core.wc.SVNWCUtil").
createDefaultAuthenticationManager(ARGUMENTS.username, JavaCast("String", ARGUMENTS.password));
authManagerJO.setAuthenticationForced(true);
clientManager.setAuthenticationManager(authManagerJO);
svnDavRepoFactory = CreateObject("java", "org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory").setup();
repositoryUrlJO = CreateObject("java", "org.tmatesoft.svn.core.SVNURL").parseURIDecoded(APPLICATION.svn_repository_audifiles);
svnRepository = clientManager.createRepository(repositoryUrlJO, true);
try{
svnRepository.testConnection();
}
catch (Exception e){
svnRepository = "";
}
Run Code Online (Sandbox Code Playgroud) 我正在使用SVNKit 1.7,我想获得两个日期之间条目的历史记录.我找到的所有文档仅显示检索两个修订号之间的条目.
我基本上想要运行以下命令
svn log -v --xml --non-interactive --no-auth-cache http://foo.com --username myusername --password mypassword -r {""2012-10-02""}:{""2012-11-01""}
Run Code Online (Sandbox Code Playgroud)
现在我正在通过命令行执行此操作,使用Runtime类在Java中调用它.
我使用此信息的目的是按月生成SVN活动的指标.
如果我必须使用修订号,有没有办法根据日期找到最近的修订版#?
谢谢你的帮助.
我在我的应用程序中使用svnkit-1.3.5.jar.在我的一个屏幕上单击一个按钮,我需要显示一个jQuery对话框,其中包含SVN中特定路径中存在的文件夹列表.svnkit是否提供检索特定位置存在的所有文件夹名称的任何方法?我如何在java中实现这一点?
我想使用SVNKIT获取SVN数据库的最新版本号.我不想更新本地存储库并获取头版本号,我想直接联系SVN存储库并获取最新的版本号.请帮我 .
如何使用SVNKit在SVN中提交特定文件而不是整个目录?
提交整个目录的代码:
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager((String) session.getAttribute("USERNAME"), (String) session.getAttribute("PASSWORD"));
repository.setAuthenticationManager(authManager);
SVNClientManager ourClientManager = SVNClientManager.newInstance(null,repository.getAuthenticationManager());
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.doUpdate(wcDir, SVNRevision.HEAD, SVNDepth.INFINITY, false, false);
ourClientManager.getWCClient().doInfo(wcDir, SVNRevision.HEAD);
SVNCommitInfo s1=ourClientManager.getCommitClient().doCommit(new File[] {wcDir}, true, "From Code", svnProperties.getRegularProperties(), null, true, false, SVNDepth.INFINITY);
Run Code Online (Sandbox Code Playgroud) /bin/sh: svn: command not found
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to check for local modifications
Provider message:
The svn command failed.
Run Code Online (Sandbox Code Playgroud)
即使已经安装了"Subversion插件",Jenkins也找不到Subversion.
假设您有SVN的开始修订号和结束修订号,是否有任何SDK api可以在java中获取它们的更改列表?我正在使用TortoiseSVN.谢谢.