Examples of SVNPath


Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
                    "Too many arguments given");
            SVNErrorManager.error(err, SVNLogType.CLIENT);
        }
       
        SVNPath source = new SVNPath((String) targets.get(0), true);
        SVNRevision srcPegRevision = source.getPegRevision();
        if (srcPegRevision == SVNRevision.UNDEFINED) {
            srcPegRevision = SVNRevision.HEAD;
        }
       
        SVNPath target = null;
        SVNRevision tgtPegRevision = null;
        if (targets.size() == 2) {
            target = new SVNPath((String) targets.get(1), true);
            tgtPegRevision = target.getPegRevision();
        } else {
            target = new SVNPath("");
            tgtPegRevision = SVNRevision.UNDEFINED;
        }
       
        if (tgtPegRevision == SVNRevision.UNDEFINED) {
            if (target.isURL()) {
                tgtPegRevision = SVNRevision.HEAD;
            } else {
                tgtPegRevision = SVNRevision.BASE;
            }
        }
       
       
        SVNDiffClient client = getSVNEnvironment().getClientManager().getDiffClient();
        if (getSVNEnvironment().getShowRevisionType() == SVNShowRevisionType.MERGED) {
            if (target.isURL()) {
                if (source.isURL()) {
                    client.doGetLogMergedMergeInfo(target.getURL(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogMergedMergeInfo(target.getURL(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            } else {
                if (source.isURL()) {
                    client.doGetLogMergedMergeInfo(target.getFile(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogMergedMergeInfo(target.getFile(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            }
        } else if (getSVNEnvironment().getShowRevisionType() == SVNShowRevisionType.ELIGIBLE) {
            if (target.isURL()) {
                if (source.isURL()) {
                    client.doGetLogEligibleMergeInfo(target.getURL(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogEligibleMergeInfo(target.getURL(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            } else {
                if (source.isURL()) {
                    client.doGetLogEligibleMergeInfo(target.getFile(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogEligibleMergeInfo(target.getFile(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT);
        }
        if (targets.size() > 2) {
            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR), SVNLogType.CLIENT);
        }
        SVNPath from = new SVNPath((String) targets.get(0), true);
        SVNRevision pegRevision = from.getPegRevision();
        String to;
        if (targets.size() == 1) {
            to = SVNPathUtil.tail(from.getTarget());
            if (from.isURL()) {
                to = SVNEncodingUtil.uriDecode(to);
            }
        } else {
            to = (String) targets.get(1);
        }
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment(), false, true, false));
        }
        SVNDepth depth = getSVNEnvironment().getDepth();
        if (depth == SVNDepth.UNKNOWN) {
            depth = SVNDepth.INFINITY;
        }
        try {
            SVNPath dst = new SVNPath(to);
            String eol = getSVNEnvironment().getNativeEOL();
            SVNRevision revision = getSVNEnvironment().getStartRevision();
            if (from.isFile()) {
                client.doExport(from.getFile(), dst.getFile(), pegRevision, revision, eol, getSVNEnvironment().isForce(), depth);
            } else {
                client.doExport(from.getURL(), dst.getFile(), pegRevision, revision, eol, getSVNEnvironment().isForce(), depth);
            }
        } catch (SVNException e) {
            SVNErrorMessage err = e.getErrorMessage();
            if (err != null && err.getErrorCode() == SVNErrorCode.WC_OBSTRUCTED_UPDATE) {
                err = err.wrap("Destination directory exists; please remove the directory or use --force to overwrite");
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        if (targets.size() > 1) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR);
            SVNErrorManager.error(err, SVNLogType.CLIENT);
        }
       
        SVNPath toURL = new SVNPath((String) targets.get(0));
        if (!toURL.isURL()) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
                    "Path ''{0}'' is not a URL", toURL.getTarget());
            SVNErrorManager.error(err, SVNLogType.CLIENT);
        }
       
        SVNAdminClient client = getEnvironment().getClientManager().getAdminClient();
        client.setEventHandler(this);
        client.setReplayHandler(new ISVNLogEntryHandler() {
           public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
               getEnvironment().getOut().println("Committed revision " + logEntry.getRevision() + ".");
           }
        });
        client.doSynchronize(toURL.getURL());
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        String message = getLockMessage();
        Collection paths = new ArrayList();
        Collection urls = new ArrayList();
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName);
            if (target.isURL()) {
                urls.add(target.getURL());
            } else {
                paths.add(target.getFile());
            }
        }
        if (!paths.isEmpty()) {
            File[] filesArray = (File[]) paths.toArray(new File[paths.size()]);
            client.doLock(filesArray, getSVNEnvironment().isForce(), message);
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        myBuffer = new StringBuffer();
        SVNLogClient client = getSVNEnvironment().getClientManager().getLogClient();
        client.setDiffOptions(getSVNEnvironment().getDiffOptions());
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName, true);
            SVNRevision endRev = end;
            if (endRev == SVNRevision.UNDEFINED) {
                if (target.getPegRevision() != SVNRevision.UNDEFINED) {
                    endRev = target.getPegRevision();
                } else if (target.isURL()) {
                    endRev = SVNRevision.HEAD;
                } else {
                    endRev = SVNRevision.BASE;
                }
            }
            if (getSVNEnvironment().isXML()) {
                myBuffer = openXMLTag("target", SVNXMLUtil.XML_STYLE_NORMAL, "path", SVNCommandUtil.getLocalPath(target.getTarget()), myBuffer);
            }
            try {
                if (target.isFile()) {
                    client.doAnnotate(target.getFile(), target.getPegRevision(),
                                      start, endRev, getSVNEnvironment().isForce(),
                                      getSVNEnvironment().isUseMergeHistory(),
                                      this, null);
                } else {
                    client.doAnnotate(target.getURL(), target.getPegRevision(),
                                      start, endRev, getSVNEnvironment().isForce(),
                                      getSVNEnvironment().isUseMergeHistory(),
                                      this, null);
                }
                if (getSVNEnvironment().isXML()) {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        if (depth == SVNDepth.UNKNOWN) {
            depth = SVNDepth.EMPTY;
        }
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName);
            if (target.isFile()) {
                try {
                    client.doResolve(target.getFile(), depth, SVNConflictChoice.MERGED);
                } catch (SVNException e) {
                    SVNErrorMessage err = e.getErrorMessage();
                    getSVNEnvironment().handleWarning(err, new SVNErrorCode[] {err.getErrorCode()}, getSVNEnvironment().isQuiet());
                }
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        }
       
        Collection paths = new ArrayList();
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName);
            paths.add(target.getFile());
        }
        File[] files = (File[]) paths.toArray(new File[paths.size()]);
       
        SVNDepth depth = getSVNEnvironment().getDepth();
        if (depth == SVNDepth.UNKNOWN) {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
        }
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName);
            if (target.isURL()) {
                continue;
            }
            try {
                client.doAdd(target.getFile(), getSVNEnvironment().isForce(), false,
                        getSVNEnvironment().isParents(), depth, getSVNEnvironment().isNoIgnore(),
                        getSVNEnvironment().isParents());
            } catch (SVNException e) {
                getSVNEnvironment().handleWarning(e.getErrorMessage(),
                        new SVNErrorCode[] {SVNErrorCode.ENTRY_EXISTS, SVNErrorCode.WC_PATH_NOT_FOUND}, getSVNEnvironment().isQuiet());
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

        if (!(myIsHelp || myIsVersion || "help".equals(commandLine.getCommandName()))) {
            if (getArguments().isEmpty()) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS, "Repository argument required");
                SVNErrorManager.error(err, SVNLogType.CLIENT);
            }
            SVNPath path = new SVNPath((String) getArguments().get(0), false);
            if (path.isURL()) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "''{0}'' is URL when it should be a path", path.getTarget());
                SVNErrorManager.error(err, SVNLogType.CLIENT);
            }
            myRepositoryFile = path.getFile();
            myRepository = (FSRepository) SVNRepositoryFactory.create(SVNURL.fromFile(myRepositoryFile));
            myRepository.setCanceller(this);
            myRepository.testConnection();
            if (getTransaction() != null) {
                myTransactionInfo = myRepository.getFSFS().openTxn(getTransaction());
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.SVNPath

            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT);
        }
        String lastTarget = (String) targets.get(targets.size() - 1);
        if (SVNCommandUtil.isURL(lastTarget)) {
            if (targets.size() == 1) {
                SVNPath target = new SVNPath(lastTarget, true);
                lastTarget = target.getURL().getPath();
                lastTarget = SVNPathUtil.tail(lastTarget);
            } else {
                lastTarget = "";
            }
            targets.add(lastTarget);
        } else if (targets.size() == 1){
            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT);
        }
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment(), true, false, false));
        }

        SVNRevision revision = getSVNEnvironment().getStartRevision();
        for (int i = 0; i < targets.size() - 1; i++) {
            String targetName = (String) targets.get(i);
            SVNPath target = new SVNPath(targetName, true);
            if (!target.isURL()) {
                SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "''{0}'' doesn not appear to be a URL", targetName), SVNLogType.CLIENT);
            }
            String targetDir;
            SVNPath dstTarget;
            if (targets.size() == 2) {
                // url + path
                targetDir = lastTarget;
                dstTarget = new SVNPath(targetDir);
            } else {
                // all urls + base dst.
                targetDir = target.getURL().getPath();
                targetDir = SVNPathUtil.tail(targetDir);
                targetDir = SVNPathUtil.append(lastTarget, targetDir);
                dstTarget = new SVNPath(targetDir);
            }
            SVNRevision pegRevision = target.getPegRevision();
            if (revision == SVNRevision.UNDEFINED) {
                revision = pegRevision != SVNRevision.UNDEFINED ? pegRevision : SVNRevision.HEAD;
            }
            client.doCheckout(target.getURL(), dstTarget.getFile(), pegRevision, revision, getSVNEnvironment().getDepth(), getSVNEnvironment().isForce());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.