2

Using tortoiseSVN, I can commit the root folder, so that all the files that were modified are checked in automatically. In other words - I don't need to commit them one by one, manually. I'd like svnKit to do the same: Providing only a folder (in this case - the root folder), I'd like it to commit all the files that were modified, without me adding them to the code. In many code examples I saw, or answers to relative questions, there were always some references to specific files - or specific ACTIONS (delete, add, change, etc.). Is svnKit capable of doing so?

Thanks in advance.

4

1 回答 1

3

这是我使用的代码

public static SVNCommitInfo addDirectoryContentToSubversion(final String repositoryURL, final String subVersionedDirectory, final String userName, final String hashedPassword, final String commitMessage) throws SVNException {
        final SVNClientManager cm = SVNClientManager.newInstance(new DefaultSVNOptions(), userName, hashedPassword);
        cm.getCommitClient().doImport(new File(subVersionedDirectory), SVNURL.parseURIEncoded(repositoryURL), "<import> " + commitMessage, null, false, true, SVNDepth.fromRecurse(true));
        return cm.getCommitClient().doCommit(new File[]{new File(subVersionedDirectory)}, false, "<commit> " + commitMessage, null, null, false, true, SVNDepth.INFINITY);
    }
于 2012-09-05T21:29:29.290 回答