Examples of SVNPath


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

    public void run() throws SVNException {
        List targets = getSVNEnvironment().combineTargets(null, true);
        if (targets.size() < 2) {
            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT);
        }
        SVNPath dst = new SVNPath((String) targets.remove(targets.size() - 1));
        if (!dst.isURL()) {
            if (getSVNEnvironment().getMessage() != null || getSVNEnvironment().getFileData() != null || getSVNEnvironment().getRevisionProperties() != null) {
                SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_UNNECESSARY_LOG_MESSAGE,
                "Local, non-commit operations do not take a log message or revision properties"), SVNLogType.CLIENT);
            }
        }

        Collection sources = new ArrayList();       
        boolean sourceIsURL = false;
        for (int i = 0; i < targets.size(); i++) {
            String targetName = (String) targets.get(i);
            SVNPath source = new SVNPath(targetName, true);
            if (i == 0) {
                sourceIsURL = source.isURL();
            }
            if (source.isURL()) {
                sources.add(new SVNCopySource(source.getPegRevision(), getSVNEnvironment().getStartRevision(), source.getURL()));
            } else {
                sources.add(new SVNCopySource(source.getPegRevision(), getSVNEnvironment().getStartRevision(), source.getFile()));
            }
        }

        SVNCopyClient client = getSVNEnvironment().getClientManager().getCopyClient();
        if (!sourceIsURL && !dst.isURL()) {
View Full Code Here

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

        }
        targets = getSVNEnvironment().combineTargets(targets, true);
        if (targets.isEmpty()) {
            targets.add("");
        }
        SVNPath target = new SVNPath((String) targets.get(0), true);
       
        SVNRevision start = getSVNEnvironment().getStartRevision();
        SVNRevision end = getSVNEnvironment().getEndRevision();
        List revisionRanges = getSVNEnvironment().getRevisionRanges();
        List editedRevisionRangesList = revisionRanges;
        if (getSVNEnvironment().isChangeOptionUsed()) {
            editedRevisionRangesList = new LinkedList();
           
            if (getSVNEnvironment().isRevisionOptionUsed() && revisionRanges.size() > 1) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION, "-c and -r are mutually exclusive");
                SVNErrorManager.error(err, SVNLogType.CLIENT);
            }
           
            for (Iterator revisionsIter = revisionRanges.iterator(); revisionsIter.hasNext();) {
                SVNRevisionRange revRange = (SVNRevisionRange) revisionsIter.next();
                SVNRevision startRev = revRange.getStartRevision();
                SVNRevision endRev = revRange.getEndRevision();
                if (startRev.getNumber() < endRev.getNumber()) {
                    revRange = new SVNRevisionRange(endRev, endRev);
                } else {
                    revRange = new SVNRevisionRange(startRev, startRev);
                }
                editedRevisionRangesList.add(revRange);
            }

            if (start.getNumber() < end.getNumber()) {
                start = end;
            } else {
                end = start;
            }
        }
       
        if (start != SVNRevision.UNDEFINED && end == SVNRevision.UNDEFINED) {
            end = start;
        } else if (start == SVNRevision.UNDEFINED) {
            if (target.getPegRevision() == SVNRevision.UNDEFINED) {
                start = target.isURL() ? SVNRevision.HEAD : SVNRevision.BASE;
            } else {
                start = target.getPegRevision();
            }
            if (end == SVNRevision.UNDEFINED) {
                end = SVNRevision.create(0);
            }
        }
       
        if (target.isURL()) {
            for(int i = 1; i < targets.size(); i++) {
                if (SVNCommandUtil.isURL((String) targets.get(i))) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
                        "Only relative paths can be specified after a URL");
                    SVNErrorManager.error(err, SVNLogType.CLIENT);
                }
            }
        } else {
            if (targets.size() > 1) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
                        "When specifying working copy paths, only one target may be given");
                SVNErrorManager.error(err, SVNLogType.CLIENT);
            }
        }

        myAuthorOfInterest = getSVNEnvironment().getAuthorOfInterest();
        myLogRegularExpression = getSVNEnvironment().getRegularExpression();
       
        SVNLogClient client = getSVNEnvironment().getClientManager().getLogClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
        }
       
        String[] revProps = null;
        if (getSVNEnvironment().isXML()) {
            if (!getSVNEnvironment().isIncremental()) {
                printXMLHeader("log");   
            }
           
            if (!getSVNEnvironment().isAllRevisionProperties() &&
                    getSVNEnvironment().getRevisionProperties() != null &&
                    !getSVNEnvironment().getRevisionProperties().isEmpty()) {
                SVNProperties revPropNames = getSVNEnvironment().getRevisionProperties();
                revProps = new String[revPropNames.size()];
                int i = 0;
                for (Iterator propNames = revPropNames.nameSet().iterator(); propNames.hasNext();) {
                    String propName = (String) propNames.next();
                    String propVal = revPropNames.getStringValue(propName);
                    if (propVal.length() > 0) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
                                "cannot assign with 'with-revprop' option (drop the '=')");
                        SVNErrorManager.error(err, SVNLogType.CLIENT);
                    }
                    revProps[i++] = propName;
                }
            } else if (!getSVNEnvironment().isAllRevisionProperties()) {
                if (!getSVNEnvironment().isQuiet()) {
                    revProps = new String[3];
                    revProps[0] = SVNRevisionProperty.AUTHOR;
                    revProps[1] = SVNRevisionProperty.DATE;
                    revProps[2] = SVNRevisionProperty.LOG;
                } else {
                    revProps = new String[2];
                    revProps[0] = SVNRevisionProperty.AUTHOR;
                    revProps[1] = SVNRevisionProperty.DATE;
                }
            }
        } else {
            if (!getSVNEnvironment().isQuiet()) {
                revProps = new String[3];
                revProps[0] = SVNRevisionProperty.AUTHOR;
                revProps[1] = SVNRevisionProperty.DATE;
                revProps[2] = SVNRevisionProperty.LOG;
            } else {
                revProps = new String[2];
                revProps[0] = SVNRevisionProperty.AUTHOR;
                revProps[1] = SVNRevisionProperty.DATE;
            }
        }

        if (target.isFile()) {
            client.doLog(new File[] {target.getFile()}, editedRevisionRangesList, target.getPegRevision(),
                    getSVNEnvironment().isStopOnCopy(), getSVNEnvironment().isVerbose(),
                    getSVNEnvironment().isUseMergeHistory(), getSVNEnvironment().getLimit(),
                    revProps, this);
        } else {
            targets.remove(0);
            String[] paths = (String[]) targets.toArray(new String[targets.size()]);
            client.doLog(target.getURL(), paths, target.getPegRevision(), editedRevisionRangesList,
                    getSVNEnvironment().isStopOnCopy(),
                    getSVNEnvironment().isVerbose(),
                    getSVNEnvironment().isUseMergeHistory(),
                    getSVNEnvironment().getLimit(), revProps, this);
View Full Code Here

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

           
            Collection changeLists = getSVNEnvironment().getChangelistsCollection();
            SVNWCClient client = getSVNEnvironment().getClientManager().getWCClient();
            for (Iterator ts = targets.iterator(); ts.hasNext();) {
                String targetPath = (String) ts.next();
                SVNPath target = new SVNPath(targetPath, true);
                SVNRevision pegRevision = target.getPegRevision();
                try {
                    if (target.isURL()) {
                        client.doGetProperty(target.getURL(), null, pegRevision, getSVNEnvironment().getStartRevision(), depth, this);
                    } else {
                        client.doGetProperty(target.getFile(), null, pegRevision,
                                getSVNEnvironment().getStartRevision(), depth, this, changeLists);
                    }
                } catch (SVNException e) {
                    getSVNEnvironment().handleWarning(e.getErrorMessage(),
                            new SVNErrorCode[] {SVNErrorCode.UNVERSIONED_RESOURCE, SVNErrorCode.ENTRY_NOT_FOUND},
                            getSVNEnvironment().isQuiet());
                }
                if (!getSVNEnvironment().isXML()) {
                    printCollectedProperties(target.isURL());
                } else {
                    printCollectedPropertiesXML(target.isURL());
                }
                clearCollectedProperties();
            }
            if (getSVNEnvironment().isXML()) {
                printXMLFooter("properties");
View Full Code Here

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

                client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
            }
            try {
                for (Iterator ts = targets.iterator(); ts.hasNext();) {
                    String targetName = (String) ts.next();
                    SVNPath target = new SVNPath(targetName);
                    client.doDelete(target.getFile(), getSVNEnvironment().isForce(), !getSVNEnvironment().isKeepLocal(), false);
                }
            } catch (SVNException e) {
                SVNErrorMessage err = e.getErrorMessage();
                if (err != null) {
                    SVNErrorCode code = err.getErrorCode();
View Full Code Here

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

        }

        Collection changeLists = getSVNEnvironment().getChangelistsCollection();
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String target = (String) ts.next();
            SVNPath commandTarget = new SVNPath(target);

            if (getSVNEnvironment().isXML()) {
                StringBuffer xmlBuffer = openXMLTag("target", SVNXMLUtil.XML_STYLE_NORMAL, "path", SVNCommandUtil.getLocalPath(target), null);
                getSVNEnvironment().getOut().print(xmlBuffer);
            }
           
            try {
                long rev = client.doStatus(commandTarget.getFile(), SVNRevision.HEAD,
                        getSVNEnvironment().getDepth(), getSVNEnvironment().isUpdate(),
                        getSVNEnvironment().isVerbose(), getSVNEnvironment().isNoIgnore(),
                        false, this, changeLists);

                if (getSVNEnvironment().isXML()) {
View Full Code Here

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

    public void run() throws SVNException {
        List targets = getEnvironment().combineTargets(null, false);
        if (targets.isEmpty()) {
            targets.add("");
        }
        SVNPath target = new SVNPath((String) targets.get(0));
        if (target.isURL()) {
            target = new SVNPath("");
            targets.add(0, "");
        }
        String trailURL = (String) (targets.size() > 1 ? targets.get(1) : null);
        if (target.isFile()) {
            String id = SVNClientManager.newInstance().getWCClient().doGetWorkingCopyID(target.getFile(), trailURL, getSVNVersionEnvironment().isCommitted());
            if (id != null) {
                getEnvironment().getOut().print(id);
                if (!getSVNVersionEnvironment().isNoNewLine()) {
                    getEnvironment().getOut().println();
                }
View Full Code Here

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

            targets.add("");
        }
        SVNWCClient client = getSVNEnvironment().getClientManager().getWCClient();
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName);
            if (target.isFile()) {
                client.doCleanup(target.getFile());
            }
        }
    }
View Full Code Here

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

                client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
            }
            try {
                for (Iterator ts = targets.iterator(); ts.hasNext();) {
                    String targetName = (String) ts.next();
                    SVNPath target = new SVNPath(targetName);
                    client.doAdd(target.getFile(), false, true, false, SVNDepth.INFINITY, false,
                            getSVNEnvironment().isParents());
                }
            } catch (SVNException e) {
                SVNErrorMessage err = e.getErrorMessage();
                if (err.getErrorCode() == SVNErrorCode.IO_ERROR) {
View Full Code Here

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

            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT);
        }
        SVNWCClient client = getSVNEnvironment().getClientManager().getWCClient();

        for(int i = 0; i < targets.size(); i++) {
            SVNPath target = new SVNPath((String) targets.get(i), true);
            try {
                if (target.isURL()) {
                    client.doGetFileContents(target.getURL(), target.getPegRevision(), getSVNEnvironment().getStartRevision(), true, getSVNEnvironment().getOut());
                } else {
                    client.doGetFileContents(target.getFile(), target.getPegRevision(), getSVNEnvironment().getStartRevision(), true, getSVNEnvironment().getOut());
                }
            } catch (SVNException e) {
                SVNErrorMessage err = e.getErrorMessage();
                getSVNEnvironment().handleWarning(err,
                        new SVNErrorCode[] {SVNErrorCode.UNVERSIONED_RESOURCE, SVNErrorCode.ENTRY_NOT_FOUND, SVNErrorCode.CLIENT_IS_DIRECTORY},
View Full Code Here

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

        sources = expandCopySources(sources);
        if (sources.length == 0) {
            return;
        }
        try {
            setupCopy(sources, new SVNPath(dst.getAbsolutePath()), isMove, makeParents, null, null, getCommitHandler(), getCommitParameters(), getExternalsHandler());
        } catch (SVNException e) {
            SVNErrorCode err = e.getErrorMessage().getErrorCode();
            if (!failWhenDstExists && sources.length == 1 && (err == SVNErrorCode.ENTRY_EXISTS || err == SVNErrorCode.FS_ALREADY_EXISTS)) {
                SVNCopySource source = sources[0];
                String baseName = source.getName();
                if (source.isURL()) {
                    baseName = SVNEncodingUtil.uriDecode(baseName);
                }
                try {
                    setupCopy(sources, new SVNPath(new File(dst, baseName).getAbsolutePath()), isMove,
                            makeParents, null, null, getCommitHandler(), getCommitParameters(), getExternalsHandler());
                } catch (SVNException second) {
                    throw second;
                }
                return;
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.