Package org.tmatesoft.svn.core.wc

Examples of org.tmatesoft.svn.core.wc.SVNCopyClient$CopyPathInfo


                        try {
                            SVNURL src = SVNURL.parseURIDecoded(e.getKey().url);
                            SVNURL dst = SVNURL.parseURIDecoded(e.getValue());

                            SVNCopyClient svncc = cm.getCopyClient();
                            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);
                        } catch (SVNException x) {
                            x.printStackTrace(listener.error("Failed to tag"));
                            return;
View Full Code Here


        }
        return sources;
    }

    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();
        }
    }
View Full Code Here

        info = clientManager.getCommitClient( ).doImport( oldDemoTree , demoURL , msg , true);
        logger.info("Imported oldDemo tree: "+ info);
        //final long revOldDemo = info.getNewRevision();
           
        msg= "Copy demo to custom";
        SVNCopyClient copyClient = clientManager.getCopyClient();
        SVNURL customURL = reposURL.appendPath("custom", true);
        SVNCopySource copySource = new SVNCopySource(SVNRevision.UNDEFINED, SVNRevision.HEAD, demoURL);
        info = copyClient.doCopy(new SVNCopySource[] { copySource }, customURL, false, false, true,
                msg, null);
        final long revAfterCopyToCustom = info.getNewRevision();
        logger.info(msg + ": " + info);
               
        File  demoDir = new File(wcRoot, "demo"),
View Full Code Here

            } else {
                sources.add(new SVNCopySource(source.getPegRevision(), getSVNEnvironment().getStartRevision(), source.getFile()));
            }
        }

        SVNCopyClient client = getSVNEnvironment().getClientManager().getCopyClient();
        if (!sourceIsURL && !dst.isURL()) {
            if (!getSVNEnvironment().isQuiet()) {
                client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
            }
        } else if (!sourceIsURL && dst.isURL()){
            // skip
        } else if (sourceIsURL && !dst.isURL()) {
            if (!getSVNEnvironment().isQuiet()) {
                client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment(), true, false, false));
            }
        }        
        client.setCommitHandler(getSVNEnvironment());
        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());
                   
            if (!getSVNEnvironment().isQuiet()) {
                getSVNEnvironment().printCommitInfo(info);
            }
        } else {
            client.doCopy(copySources, dst.getFile(), false, getSVNEnvironment().isParents(), false);
        }
    }
View Full Code Here

                SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_UNNECESSARY_LOG_MESSAGE,
                "Local, non-commit operations do not take a log message or revision properties"), SVNLogType.CLIENT);
            }
        }

        SVNCopyClient client = getSVNEnvironment().getClientManager().getCopyClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
        }
        client.setCommitHandler(getSVNEnvironment());
        Collection sources = new ArrayList();
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath source = new SVNPath(targetName);
            if (source.isURL()) {
                sources.add(new SVNCopySource(SVNRevision.HEAD, SVNRevision.UNDEFINED, source.getURL()));
            } else {
                sources.add(new SVNCopySource(getSVNEnvironment().getStartRevision(), SVNRevision.UNDEFINED, source.getFile()));
            }
        }
        SVNCopySource[] copySources = (SVNCopySource[]) sources.toArray(new SVNCopySource[sources.size()]);
        try {
            if (dst.isURL()) {
                SVNCommitInfo info = client.doCopy(copySources, dst.getURL(), true, getSVNEnvironment().isParents(),
                        false, getSVNEnvironment().getMessage(), getSVNEnvironment().getRevisionProperties());
                if (!getSVNEnvironment().isQuiet()) {
                    getSVNEnvironment().printCommitInfo(info);
                }
            } else {
                client.doCopy(copySources, dst.getFile(), true, getSVNEnvironment().isParents(), false);
            }
        } catch (SVNException e) {
            SVNErrorMessage err = e.getErrorMessage();
            SVNErrorCode code = err.getErrorCode();
            if (code == SVNErrorCode.UNVERSIONED_RESOURCE || code == SVNErrorCode.CLIENT_MODIFIED) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.wc.SVNCopyClient$CopyPathInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.