Checking Out Directory / File with SVNKit

后端 未结 3 1605
南方客
南方客 2020-12-16 03:57

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

3条回答
  •  难免孤独
    2020-12-16 04:36

    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);
    

提交回复
热议问题