Search in sources :

Example 1 with SVNCommitPacket

use of org.tmatesoft.svn.core.wc.SVNCommitPacket in project intellij-community by JetBrains.

the class SvnKitCheckinClient method commit.

@NotNull
@Override
public CommitInfo[] commit(@NotNull List<File> paths, @NotNull String comment) throws VcsException {
    File[] pathsToCommit = ArrayUtil.toObjectArray(paths, File.class);
    boolean keepLocks = myVcs.getSvnConfiguration().isKeepLocks();
    SVNCommitPacket[] commitPackets = null;
    SVNCommitInfo[] results;
    SVNCommitClient committer = myVcs.getSvnKitManager().createCommitClient();
    IdeaCommitHandler handler = new IdeaCommitHandler(ProgressManager.getInstance().getProgressIndicator(), true, true);
    committer.setEventHandler(toEventHandler(handler));
    try {
        commitPackets = committer.doCollectCommitItems(pathsToCommit, keepLocks, true, SVNDepth.EMPTY, true, null);
        results = committer.doCommit(commitPackets, keepLocks, comment);
        commitPackets = null;
    } catch (SVNException e) {
        throw new SvnBindException(e);
    } finally {
        if (commitPackets != null) {
            for (SVNCommitPacket commitPacket : commitPackets) {
                try {
                    commitPacket.dispose();
                } catch (SVNException e) {
                    LOG.info(e);
                }
            }
        }
    }
    // This seems to be necessary only for SVNKit as changes after command line operations should be detected during VFS refresh.
    for (VirtualFile f : handler.getDeletedFiles()) {
        f.putUserData(VirtualFile.REQUESTOR_MARKER, this);
    }
    return convert(results);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SVNCommitPacket(org.tmatesoft.svn.core.wc.SVNCommitPacket) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) SVNCommitClient(org.tmatesoft.svn.core.wc.SVNCommitClient) SVNException(org.tmatesoft.svn.core.SVNException) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1 NotNull (org.jetbrains.annotations.NotNull)1 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)1 SVNCommitInfo (org.tmatesoft.svn.core.SVNCommitInfo)1 SVNException (org.tmatesoft.svn.core.SVNException)1 SVNCommitClient (org.tmatesoft.svn.core.wc.SVNCommitClient)1 SVNCommitPacket (org.tmatesoft.svn.core.wc.SVNCommitPacket)1