use of org.tmatesoft.svn.core.wc.SVNUpdateClient in project oxTrust by GluuFederation.
the class SvnHelper method switchToURL.
/*
* Updates a working copy to a different URL. Like 'svn switch URL' command.
* It's done by invoking
*
* SVNUpdateClient.doSwitch(File file, SVNURL url, SVNRevision revision,
* boolean recursive)
*
* which takes the following parameters:
*
* file - a working copy entry that is to be switched to a new url;
*
* url - a target URL a working copy is to be updated against;
*
* revision - a revision to which a working copy is to be updated;
*
* recursive - if true and an entry (file) is a directory then doSwitch(..)
* recursively switches the entire directory, otherwise - only child entries
* of the directory;
*/
public static long switchToURL(SVNClientManager clientManager, File wcPath, SVNURL url, SVNRevision updateToRevision, boolean isRecursive) throws SVNException {
SVNUpdateClient updateClient = clientManager.getUpdateClient();
/*
* sets externals not to be ignored during the switch
*/
updateClient.setIgnoreExternals(false);
/*
* returns the number of the revision wcPath was updated to
*/
return updateClient.doSwitch(wcPath, url, SVNRevision.UNDEFINED, updateToRevision, SVNDepth.getInfinityOrFilesDepth(isRecursive), false, false);
}
Aggregations