使用SVNKit检出目录/文件 [英] Checking Out Directory / File with SVNKit

查看:88
本文介绍了使用SVNKit检出目录/文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在维基上看到记录结帐的地方。理想情况下,我想查看文件example / folder / file.xml,如果不仅仅是文件夹...然后当应用程序关闭或以其他方式时,能够提交回更改此文件。我该怎么做?

解决方案

你无法在Subversion中签出文件。你必须签出一个文件夹。



要签出一个包含一个或多个文件的文件夹:

  SVNClientManager ourClientManager = SVNClientManager.newInstance(null,
repository.getAuthenticationManager());
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
updateClient.doCheckout(url,destPath,revision,revision,
isRecursive);

提交先前签出的文件夹:



< pre class =lang-java prettyprint-override> SVNClientManager ourClientManager = SVNClientManager.newInstance(null,
repository.getAuthenticationManager());
ourClientManager.getWCClient()。doInfo(wcPath,SVNRevision.HEAD);
ourClientManager.getCommitClient()。doCommit
(new File [] {wcPath},keepLo​​cks,commitMessage,false,true);


I can't see on the wiki where checking out is documented. Ideally, I would like to check out a file "example/folder/file.xml", if not just the folder... and then when the application closes down or otherwise, be able to commit back in changes to this file. How do I do this?

解决方案

You cannot check out a file in Subversion. You have to check out a folder.

To check out a folder with one or more files:

SVNClientManager ourClientManager = SVNClientManager.newInstance(null, 
            repository.getAuthenticationManager());
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
updateClient.doCheckout(url, destPath, revision, revision,
            isRecursive);

To commit a previously checked out folder:

SVNClientManager ourClientManager = SVNClientManager.newInstance(null, 
            repository.getAuthenticationManager());
ourClientManager.getWCClient().doInfo(wcPath, SVNRevision.HEAD);
ourClientManager.getCommitClient().doCommit
        (new File[] { wcPath }, keepLocks, commitMessage, false, true);

这篇关于使用SVNKit检出目录/文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆