2011-04-12 30 views

回答

2

[更新]更好的版本:

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在標籤,分支或任何其他路徑之間沒有區別)

相關問題