Search in sources :

Example 1 with SVNCommitInfo

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

the class SvnKitImportClient method doImport.

@Override
public long doImport(@NotNull File path, @NotNull SVNURL url, @Nullable Depth depth, @NotNull String message, boolean noIgnore, @Nullable CommitEventHandler handler, @Nullable ISVNCommitHandler commitHandler) throws VcsException {
    SVNCommitClient client = myVcs.getSvnKitManager().createCommitClient();
    client.setEventHandler(toEventHandler(handler));
    client.setCommitHandler(commitHandler);
    try {
        SVNCommitInfo info = client.doImport(path, url, message, null, !noIgnore, false, toDepth(depth));
        return info.getNewRevision();
    } catch (SVNException e) {
        throw new SvnBindException(e);
    }
}
Also used : 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)

Example 2 with SVNCommitInfo

use of org.tmatesoft.svn.core.SVNCommitInfo in project Gargoyle by callakrsos.

the class CommandTest3 method commitReverseTest.

@Test
public void commitReverseTest() throws SVNException, IOException {
    File[] commitTestFiles = getCommitTestFiles();
    FileInputStream inputStream = null;
    try {
        inputStream = new FileInputStream(commitTestFiles[0]);
        //			thirdPartManager.commit_new("/sql", commitTestFiles[0].getName(), inputStream, "test commit.");
        //			commitTestFiles = new File[] { new File("C:\\logs\\test\\deprecated_pass-batch-core\\sql\\text.txt") };
        SVNCommitInfo commit_modify = localServerManager.commit_modify_reverse("sql", "text.txt", 42);
        System.out.println(commit_modify.getAuthor());
        System.out.println(commit_modify.getNewRevision());
    } finally {
        if (inputStream != null)
            inputStream.close();
    }
}
Also used : SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) File(java.io.File) FileInputStream(java.io.FileInputStream) Test(org.junit.Test)

Example 3 with SVNCommitInfo

use of org.tmatesoft.svn.core.SVNCommitInfo in project Gargoyle by callakrsos.

the class CommandTest3 method addFileTest.

@Test
public void addFileTest() throws Exception {
    if (!localServerManager.isExistsPath("test")) {
        System.out.println("존재하지않음.. 새로 생성함.");
    }
    String newFile = "test_" + System.currentTimeMillis() + ".txt";
    String content = "New File Add Test FileName ::: " + newFile;
    SVNCommitInfo commit_new = localServerManager.commit_new("test", newFile, content.getBytes(), content);
    System.out.printf("New File Revision : %d author : %s \n", commit_new.getNewRevision(), commit_new.getAuthor());
}
Also used : SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) Test(org.junit.Test)

Example 4 with SVNCommitInfo

use of org.tmatesoft.svn.core.SVNCommitInfo 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)

Example 5 with SVNCommitInfo

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

the class SvnKitCopyMoveClient method copy.

@Override
public long copy(@NotNull SvnTarget source, @NotNull SvnTarget destination, @Nullable SVNRevision revision, boolean makeParents, boolean isMove, @NotNull String message, @Nullable CommitEventHandler handler) throws VcsException {
    if (!destination.isURL()) {
        throw new IllegalArgumentException("Only urls are supported as destination " + destination);
    }
    final SVNCopySource copySource = createCopySource(source, revision);
    SVNCopyClient client = myVcs.getSvnKitManager().createCopyClient();
    client.setEventHandler(toEventHandler(handler));
    SVNCommitInfo info;
    try {
        info = client.doCopy(new SVNCopySource[] { copySource }, destination.getURL(), isMove, makeParents, true, message, null);
    } catch (SVNException e) {
        throw new VcsException(e);
    }
    return info != null ? info.getNewRevision() : INVALID_REVISION;
}
Also used : SVNCopyClient(org.tmatesoft.svn.core.wc.SVNCopyClient) SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) VcsException(com.intellij.openapi.vcs.VcsException) SVNException(org.tmatesoft.svn.core.SVNException) SVNCopySource(org.tmatesoft.svn.core.wc.SVNCopySource)

Aggregations

SVNCommitInfo (org.tmatesoft.svn.core.SVNCommitInfo)8 File (java.io.File)3 Test (org.junit.Test)3 SVNException (org.tmatesoft.svn.core.SVNException)3 SVNCommitClient (org.tmatesoft.svn.core.wc.SVNCommitClient)3 FileInputStream (java.io.FileInputStream)2 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)2 VcsException (com.intellij.openapi.vcs.VcsException)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 NotNull (org.jetbrains.annotations.NotNull)1 SVNProperties (org.tmatesoft.svn.core.SVNProperties)1 ISVNEditor (org.tmatesoft.svn.core.io.ISVNEditor)1 SVNCommitPacket (org.tmatesoft.svn.core.wc.SVNCommitPacket)1 SVNCopyClient (org.tmatesoft.svn.core.wc.SVNCopyClient)1 SVNCopySource (org.tmatesoft.svn.core.wc.SVNCopySource)1