congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SVNCopyClient.doCopy
Code IndexAdd Tabnine to your IDE (free)

How to use
doCopy
method
in
org.tmatesoft.svn.core.wc.SVNCopyClient

Best Java code snippets using org.tmatesoft.svn.core.wc.SVNCopyClient.doCopy (Showing top 20 results out of 315)

origin: org.tmatesoft/svn

/**
 * Copies/moves a source URL to a destination one immediately committing changes
 * to a repository. Equivalent to <code>doCopy(srcURL, srcRevision, dstURL, isMove, false, commitMessage)</code>.
 * 
 * @param  srcURL         a source repository location URL
 * @param  srcRevision    a revision of <code>srcURL</code>
 * @param  dstURL         a target URL where <code>srcURL</code> is to be
 *                        copied/moved
 * @param  isMove         <span class="javakeyword">true</span> to move the source
 *                        to the target (only URL-to-URL), 
 *                        <span class="javakeyword">false</span> to copy
 * @param  commitMessage  a commit log message
 * @return                information on the committed revision
 * @throws SVNException
 * @see                   #doCopy(SVNURL, SVNRevision, SVNURL, boolean, boolean, String)                       
 */
public SVNCommitInfo doCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, boolean isMove, String commitMessage) throws SVNException {
  return doCopy(srcURL, srcRevision, dstURL, isMove, false, commitMessage);
}
 
origin: org.tmatesoft/svn

/**
 * Copies a source Working Copy path (or its repository location URL) to a destination 
 * URL immediately committing changes to a repository.
 * 
 * <p>
 * Equivalent to <code>doCopy(srcPath, srcRevision, dstURL, false, commitMessage)</code>. 
 * 
 * @param  srcPath        a source Working Copy path
 * @param  srcRevision    a revision of <code>srcPath</code>
 * @param  dstURL         a target URL where <code>srcPath</code> is to be
 *                        copied
 * @param  commitMessage  a commit log message
 * @return                information on the committed revision
 * @throws SVNException   if one of the following is true:
 *                        <ul>
 *                        <li><code>srcPath</code> is not under version control
 *                        <li><code>srcPath</code> has no URL
 *                        <li>the repository location of <code>srcPath</code> was not 
 *                        found in <code>srcRevision</code>
 *                        <li><code>dstURL</code> already exists
 *                        </ul>
 * @see                   #doCopy(File, SVNRevision, SVNURL, boolean, String)
 */
public SVNCommitInfo doCopy(File srcPath, SVNRevision srcRevision, SVNURL dstURL, String commitMessage) throws SVNException {
  return doCopy(srcPath, srcRevision, dstURL, false, commitMessage);
}
 
origin: org.jvnet.hudson.svnkit/svnkit

return doCopy( new SVNCopySource[]{cs}, dstURL, isMove, true, failWhenDstExists, commitMessage, null);
origin: org.tmatesoft/svn

public void copy(String srcPath, String destPath, String message, Revision revision) throws ClientException {
  SVNCopyClient client = getSVNCopyClient();
  SVNRevision srcRevision = JavaHLObjectFactory.getSVNRevision(revision);
  try {
    if(isURL(srcPath) && isURL(destPath)){
      client.doCopy(SVNURL.parseURIEncoded(srcPath), srcRevision, SVNURL.parseURIEncoded(destPath), false, message);
    } else if (isURL(srcPath) && !isURL(destPath)) {
      client.doCopy(SVNURL.parseURIEncoded(srcPath), srcRevision, new File(destPath).getAbsoluteFile());
    } else if (!isURL(srcPath) && isURL(destPath)) {
      client.doCopy(new File(srcPath).getAbsoluteFile(), srcRevision, SVNURL.parseURIEncoded(destPath), message);
    } else if (!isURL(srcPath) && !isURL(destPath)) {
      client.doCopy(new File(srcPath).getAbsoluteFile(), srcRevision, new File(destPath).getAbsoluteFile(), false, false);
    }
  } catch (SVNException e) {
    throwException(e);
  }
}
origin: org.tmatesoft/svn

public void move(String srcPath, String destPath, String message, Revision revision, boolean force) throws ClientException {
  SVNCopyClient client = getSVNCopyClient();
  SVNRevision srcRevision = JavaHLObjectFactory.getSVNRevision(revision);
  try {
    if(isURL(srcPath) && isURL(destPath)){
      client.doCopy(SVNURL.parseURIEncoded(srcPath), srcRevision, SVNURL.parseURIEncoded(destPath), true, message);
    } else if (!isURL(srcPath) && !isURL(destPath)) {
      client.doCopy(new File(srcPath).getAbsoluteFile(), srcRevision, new File(destPath).getAbsoluteFile(), force, true);
    }
  } catch (SVNException e) {
    throwException(e);
  }
}
origin: com.google.code.maven-scm-provider-svnjava/maven-scm-provider-svnjava

public static SVNCommitInfo copy( SVNClientManager clientManager, File srcPath, SVNURL dstURL, boolean isMove,
                 String commitMessage, String revision )
  throws SVNException
{
  SVNRevision svnRevision = null;
  if ( StringUtils.isEmpty( revision ) )
  {
    svnRevision = SVNRevision.WORKING;
  }
  else
  {
    svnRevision = SVNRevision.create( Long.parseLong( revision ) );
  }
  /*
   * SVNRevision.WORKING means working (current) revision.
   * Returns SVNCommitInfo containing information on the new revision committed
   * (revision number, etc.)
   */
  SVNCopySource[] svnCopySources = new SVNCopySource[1];
  svnCopySources[0] = new SVNCopySource( svnRevision, svnRevision, srcPath );
  return clientManager.getCopyClient().doCopy( svnCopySources, dstURL, false, true, true, commitMessage,
                         new SVNProperties() );
}
origin: com.google.code.maven-scm-provider-svnjava/maven-scm-provider-svnjava

public static SVNCommitInfo copy( SVNClientManager clientManager, SVNURL srcURL, SVNURL dstURL, boolean isMove,
                 String commitMessage, String revision )
  throws SVNException
{
  SVNRevision svnRevision = null;
  if ( StringUtils.isEmpty( revision ) )
  {
    svnRevision = SVNRevision.HEAD;
  }
  else
  {
    svnRevision = SVNRevision.create( Long.parseLong( revision ) );
  }
  /*
   * SVNRevision.HEAD means the latest revision.
   * Returns SVNCommitInfo containing information on the new revision committed
   * (revision number, etc.)
   */
  SVNCopySource[] svnCopySources = new SVNCopySource[1];
  svnCopySources[0] = new SVNCopySource( svnRevision, svnRevision, srcURL );
  return clientManager.getCopyClient().doCopy( svnCopySources, dstURL, false, true, true, commitMessage,
                         new SVNProperties() );
  //return clientManager.getCopyClient().doCopy( srcURL, svnRevision, dstURL, isMove, commitMessage, new SVNProperties() );
}
origin: jenkinsci/artifactory-plugin

  public Void invoke(File ws, VirtualChannel channel) throws IOException, InterruptedException {
    File workingCopy = new File(ws, location.getLocalDir()).getCanonicalFile();
    try {
      SVNURL svnUrl = SVNURL.parseURIEncoded(tagUrl);
      SVNCopyClient copyClient;
      try {
        copyClient = SubversionSCM.createClientManager(authProvider).getCopyClient();
      } catch (NoSuchMethodError e) {
        //todo remove when backward compatibility not needed
        //fallback for older versions of org.jenkins-ci.plugins:subversion
        buildListener.getLogger().println(
            "[RELEASE] You are using an old subversion jenkins plugin, please consider upgrading.");
        copyClient = SubversionSCM.createSvnClientManager(authProvider).getCopyClient();
      }
      buildListener.getLogger().println("[RELEASE] Creating subversion tag: " + tagUrl);
      SVNCopySource source = new SVNCopySource(SVNRevision.WORKING, SVNRevision.WORKING, workingCopy);
      SVNCommitInfo commitInfo = copyClient.doCopy(new SVNCopySource[]{source},
          svnUrl, false, true, true, commitMessage, new SVNProperties());
      SVNErrorMessage errorMessage = commitInfo.getErrorMessage();
      if (errorMessage != null) {
        throw new IOException("Failed to create tag: " + errorMessage.getFullMessage());
      }
      return null;
    } catch (SVNException e) {
      debuggingLogger.log(Level.FINE, "Failed to create tag", e);
      throw new IOException("Subversion tag creation failed: " + e.getMessage());
    }
  }
}
origin: org.jvnet.hudson.svnkit/svnkit

private void copyOrMove(SVNCopySource[] sources, String destPath, boolean isMove, String message, boolean copyAsChild, boolean makeParents, Map revprops) throws ClientException {
  SVNCopyClient client = getSVNCopyClient();
  try {
    if (isURL(destPath)) {
      SVNProperties revisionProperties = revprops == null ? null : SVNProperties.wrap(revprops);
      boolean isURLs = sources.length > 0 && sources[0].isURL();
      client.setCommitHandler(createCommitMessageHandler(isURLs));
      client.doCopy(sources, SVNURL.parseURIEncoded(destPath), isMove, makeParents, !copyAsChild, message, revisionProperties);
    } else {
      client.doCopy(sources, new File(destPath).getAbsoluteFile(), isMove, makeParents, !copyAsChild);
    }
  } catch (SVNException e) {
    throwException(e);
  } finally {
    if (client != null) {
      client.setCommitHandler(null);
    }
    resetLog();
  }
}
origin: org.codehaus.jtstand/jtstand-svnkit

private void copyOrMove(SVNCopySource[] sources, String destPath, boolean isMove, String message, boolean copyAsChild, boolean makeParents, Map revprops) throws ClientException {
  SVNCopyClient client = getSVNCopyClient();
  try {
    if (isURL(destPath)) {
      SVNProperties revisionProperties = revprops == null ? null : SVNProperties.wrap(revprops);
      boolean isURLs = sources.length > 0 && sources[0].isURL();
      client.setCommitHandler(createCommitMessageHandler(isURLs));
      client.doCopy(sources, SVNURL.parseURIEncoded(destPath), isMove, makeParents, !copyAsChild, message, revisionProperties);
    } else {
      client.doCopy(sources, new File(destPath).getAbsoluteFile(), isMove, makeParents, !copyAsChild);
    }
  } catch (SVNException e) {
    throwException(e);
  } finally {
    if (client != null) {
      client.setCommitHandler(null);
    }
    resetLog();
  }
}
origin: org.jvnet.hudson.plugins/subversion

SVNRevision sourceRevision = SVNRevision.create(e.getKey().revision);
SVNCopySource csrc = new SVNCopySource(sourceRevision, sourceRevision, src);
svncc.doCopy(
    new SVNCopySource[]{csrc},
    dst, false, true, false, comment, null);
origin: org.tmatesoft.svnkit/svnkit-javahl16

private void copyOrMove(SVNCopySource[] sources, String destPath, boolean isMove, String message, boolean copyAsChild, boolean makeParents, Map revprops) throws ClientException {
  SVNCopyClient client = getSVNCopyClient();
  try {
    if (isURL(destPath)) {
      SVNProperties revisionProperties = revprops == null ? null : SVNProperties.wrap(revprops);
      boolean isURLs = sources.length > 0 && sources[0].isURL();
      client.setCommitHandler(createCommitMessageHandler(isURLs));
      client.doCopy(sources, SVNURL.parseURIEncoded(destPath), isMove, makeParents, !copyAsChild, message, revisionProperties);
    } else {
      client.doCopy(sources, new File(destPath).getAbsoluteFile(), isMove, makeParents, !copyAsChild);
    }
  } catch (SVNException e) {
    throwException(e);
  } finally {
    if (client != null) {
      client.setCommitHandler(null);
    }
    resetLog();
  }
}
origin: org.hudsonci.plugins/subversion

  SVNCopySource csrc = new SVNCopySource(
      sourceRevision, sourceRevision, src);
  svncc.doCopy(new SVNCopySource[] { csrc }, dst,
      false, true, false, comment, null);
} catch (SVNException x) {
origin: jenkinsci/subversion-plugin

SVNRevision sourceRevision = SVNRevision.create(e.getKey().revision);
SVNCopySource csrc = new SVNCopySource(sourceRevision, sourceRevision, src);
svncc.doCopy(
    new SVNCopySource[]{csrc},
    dst, false, true, false, comment, null);
origin: stackoverflow.com

copyClient.doCopy(new SVNCopySource[]{source}, dstURL, false, false, true, "Create new Branch", null);
origin: org.nuiton/scmwebeditor-svn

  copyClient.doCopy(sourceFileTab, destUrl, true, false, true, "From scmwebeditor -- move the file : "
      + sourceUrl.getPath() + " to : " + destUrl.getPath(), null);
} catch (SVNAuthenticationException authexep) {
origin: org.tmatesoft.svnkit/svnkit-cli

try {
  if (dst.isURL()) {
    SVNCommitInfo info = client.doCopy(copySources, dst.getURL(), true, getSVNEnvironment().isParents(), 
        false, getSVNEnvironment().getMessage(), getSVNEnvironment().getRevisionProperties());
    if (!getSVNEnvironment().isQuiet()) {
    client.doCopy(copySources, dst.getFile(), true, getSVNEnvironment().isParents(), false, getSVNEnvironment().isAllowMixedRevisions(), false);
origin: sonia.svnkit/svnkit-cli

try {
  if (dst.isURL()) {
    SVNCommitInfo info = client.doCopy(copySources, dst.getURL(), true, getSVNEnvironment().isParents(), 
        false, getSVNEnvironment().getMessage(), getSVNEnvironment().getRevisionProperties());
    if (!getSVNEnvironment().isQuiet()) {
    client.doCopy(copySources, dst.getFile(), true, getSVNEnvironment().isParents(), false, getSVNEnvironment().isAllowMixedRevisions(), false);
origin: org.tmatesoft.svnkit/svnkit-cli

SVNCopySource[] copySources = (SVNCopySource[]) sources.toArray(new SVNCopySource[sources.size()]);
if (dst.isURL()) {
  SVNCommitInfo info = client.doCopy(copySources, dst.getURL(), false, getSVNEnvironment().isParents(), false,
      getSVNEnvironment().getMessage(), 
      getSVNEnvironment().getRevisionProperties(), getSVNEnvironment().isPinExternals(), null);
  client.doCopy(copySources, dst.getFile(), false, getSVNEnvironment().isParents(), false, getSVNEnvironment().isPinExternals(), null);
origin: sonia.svnkit/svnkit-cli

SVNCopySource[] copySources = (SVNCopySource[]) sources.toArray(new SVNCopySource[sources.size()]);
if (dst.isURL()) {
  SVNCommitInfo info = client.doCopy(copySources, dst.getURL(), false, getSVNEnvironment().isParents(), false,
      getSVNEnvironment().getMessage(), 
      getSVNEnvironment().getRevisionProperties(), getSVNEnvironment().isPinExternals(), null);
  client.doCopy(copySources, dst.getFile(), false, getSVNEnvironment().isParents(), false, getSVNEnvironment().isPinExternals(), null);
org.tmatesoft.svn.core.wcSVNCopyClientdoCopy

Javadoc

Converts a disjoint working copy to a copied one.

Note: this routine does not require repository access. However if it's performed on an old format working copy where repository root urls were not written, the routine will connect to the repository to fetch the repository root url.

Popular methods of SVNCopyClient

  • setCommitHandler
    Sets an implementation of ISVNCommitHandler to the commit handler that will be used during commit op
  • setEventHandler
  • <init>
  • getCommitHandler
    Returns the specified commit handler (if set) being in use or a default one ( DefaultSVNCommitHandle
  • getCommitParameters
    Returns commit parameters. If no user parameters were previously specified, once creates and returns
  • setDebugLog
  • getExternalsHandler
    Returns an externals handler used by this update client. If no user's handler is provided then ISVNE
  • setIgnoreExternals
  • setOptions
  • copyDisjointWCToWC
  • expandCopySources
  • setupCopy
  • expandCopySources,
  • setupCopy,
  • copyDir,
  • copyFile,
  • createRepository,
  • createWCAccess,
  • dispatchEvent,
  • getEventDispatcher,
  • getOperationsFactory

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JComboBox (javax.swing)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now