我在中继中有一个工作目录,并想将其切换到指定的分支.我怎样才能做到这一点?
我想有一种方法
public static void switchToBranch(File baseDir, String branchUrl){
}
我该如何实施?
解决方法:
[更新]更好的版本:
public static void switchToBranch(final String branchUrl,
final File basedir,
final ISVNDebugLog log) throws SVNException, IOException{
final SVNUpdateClient updateClient =
SVNClientManager
.newInstance().getUpdateClient();
if(log != null) updateClient.setDebugLog(log);
updateClient.doSwitch(basedir,
SVNURL.parseURIEncoded(branchUrl),
SVNRevision.HEAD,
SVNRevision.HEAD,
SVNDepth.INFINITY,
false,
false);
}
凭证显然是从〜/ .subversion目录自动获取的.
(当然,它不必是分支,SVN不会在标签,分支或任何其他路径之间产生区别)