Search in sources :

Example 1 with SVNCopySource

use of org.tmatesoft.svn.core.wc.SVNCopySource 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 2 with SVNCopySource

use of org.tmatesoft.svn.core.wc.SVNCopySource 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)2 SVNCopySource (org.tmatesoft.svn.core.wc.SVNCopySource)2 VcsException (com.intellij.openapi.vcs.VcsException)1 SVNCommitInfo (org.tmatesoft.svn.core.SVNCommitInfo)1 SVNException (org.tmatesoft.svn.core.SVNException)1 SVNProperties (org.tmatesoft.svn.core.SVNProperties)1