Search in sources :

Example 1 with SVNCopyClient

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

the class SvnKitCopyMoveClient method copy.

@Override
public void copy(@NotNull SvnTarget source, @NotNull File destination, @Nullable SVNRevision revision, boolean makeParents, @Nullable ProgressTracker handler) throws VcsException {
    SVNCopyClient client = myVcs.getSvnKitManager().createCopyClient();
    client.setEventHandler(toEventHandler(handler));
    try {
        client.doCopy(new SVNCopySource[] { createCopySource(source, revision) }, destination, false, makeParents, true);
    } catch (SVNException e) {
        throw new SvnBindException(e);
    }
}
Also used : SVNCopyClient(org.tmatesoft.svn.core.wc.SVNCopyClient) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNException(org.tmatesoft.svn.core.SVNException)

Example 2 with SVNCopyClient

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

Example 3 with SVNCopyClient

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

the class SVNCopy method copy.

public void copy(SVNURL targetURL, SVNURL[] paths) throws SVNException {
    SVNCopySource[] convert = convert(paths);
    /*
			doCopy(   SVNCopySource[] sources,
			              SVNURL dst,
			              boolean isMove,
			              boolean makeParents,
			              boolean failWhenDstExists,
			              java.lang.String commitMessage,
			              SVNProperties revisionProperties  )
			Copies each source in sources to dst.
		*/
    SVNCopyClient copyClient = getSvnManager().getCopyClient();
    copyClient.doCopy(convert, targetURL, false, false, false, "copy by O-PERA", new SVNProperties());
}
Also used : SVNCopyClient(org.tmatesoft.svn.core.wc.SVNCopyClient) SVNProperties(org.tmatesoft.svn.core.SVNProperties) SVNCopySource(org.tmatesoft.svn.core.wc.SVNCopySource)

Aggregations

SVNCopyClient (org.tmatesoft.svn.core.wc.SVNCopyClient)3 SVNException (org.tmatesoft.svn.core.SVNException)2 SVNCopySource (org.tmatesoft.svn.core.wc.SVNCopySource)2 VcsException (com.intellij.openapi.vcs.VcsException)1 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)1 SVNCommitInfo (org.tmatesoft.svn.core.SVNCommitInfo)1 SVNProperties (org.tmatesoft.svn.core.SVNProperties)1