2
我有一個trunk
工作目錄,並希望將其切換到指定的分支。我怎樣才能做到這一點?使用SVNKit,我如何將一個目錄切換到不同的分支?
我想有一個方法
public static void switchToBranch(File baseDir, String branchUrl){
}
我怎麼能實現呢?
我有一個trunk
工作目錄,並希望將其切換到指定的分支。我怎樣才能做到這一點?使用SVNKit,我如何將一個目錄切換到不同的分支?
我想有一個方法
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在標籤,分支或任何其他路徑之間沒有區別)