Examples of SVNPropertyData


Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

        return myRevisionProperties;
    }

    protected void printProplist(List props) {
        for (Iterator plist = props.iterator(); plist.hasNext();) {
            SVNPropertyData property = (SVNPropertyData) plist.next();
            getSVNEnvironment().getOut().println("  " + property.getName());
            if (getSVNEnvironment().isVerbose()) {
                printProperty(property.getValue(), true);
                getSVNEnvironment().getOut().println();
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

        }

        if (props != null) {
            for (Iterator propNamesIter = props.nameSet().iterator(); propNamesIter.hasNext();) {
                String propName = (String) propNamesIter.next();
                SVNPropertyData propData = new SVNPropertyData(propName, props.getSVNPropertyValue(propName),
                        client.getOptions());
                SVNPropertyValue propValue = propData.getValue();
                if (environment.isVerbose()) {
                    environment.getOut().print("  " + propName + " : ");
                    if (propValue.isString()) {
                        environment.getOut().println(propValue.getString());
                    } else {
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

            }
            if (getSVNEnvironment().isXML()) {
                printXMLHeader("properties");
                StringBuffer buffer = openXMLTag("revprops", SVNXMLUtil.XML_STYLE_NORMAL, "rev", Long.toString(rev), null);
                for (Iterator props = revisionProperties.iterator(); props.hasNext();) {
                    SVNPropertyData property = (SVNPropertyData) props.next();
                    buffer = addXMLProp(property, buffer);
                }
                buffer = closeXMLTag("revprops", buffer);
                getSVNEnvironment().getOut().print(buffer);
                printXMLFooter("properties");
            } else {
                getSVNEnvironment().getOut().println("Unversioned properties on revision " + rev + ":");
                for (Iterator props = revisionProperties.iterator(); props.hasNext();) {
                    SVNPropertyData property = (SVNPropertyData) props.next();
                    getSVNEnvironment().getOut().print("  " + property.getName());
                    if (getSVNEnvironment().isVerbose()) {
                        getSVNEnvironment().getOut().print(" : ");
                        if (property.getValue().isString()){
                            getSVNEnvironment().getOut().print(property.getValue().getString());
                        } else {
                            try {
                                getSVNEnvironment().getOut().write(property.getValue().getBytes());
                            } catch (IOException e) {

                            }
                        }
                    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

            if (!isURL) {
                target = SVNCommandUtil.getLocalPath(getSVNEnvironment().getRelativePath((File) key));
            }
            StringBuffer buffer = openXMLTag("target", SVNXMLUtil.XML_STYLE_NORMAL, "path", target, null);
            for (Iterator plist = props.iterator(); plist.hasNext();) {
                SVNPropertyData property = (SVNPropertyData) plist.next();
                buffer = addXMLProp(property, buffer);
            }
            buffer = closeXMLTag("target", buffer);
            getSVNEnvironment().getOut().print(buffer);
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

                String propName = (String) propNames.next();
                SVNPropertyValue propVal = propHash.getSVNPropertyValue(propName);
                if (namesOnly) {
                    buffer = openXMLTag("property", SVNXMLUtil.XML_STYLE_SELF_CLOSING, "name", propName, buffer);
                } else {
                    buffer = addXMLProp(new SVNPropertyData(propName, propVal, null), buffer);                   
                }
            }
        }
        return buffer;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

                targets.add("");
            }
            SVNURL revPropURL = getRevpropURL(getSVNEnvironment().getStartRevision(), targets);
            SVNWCClient client = getSVNEnvironment().getClientManager().getWCClient();
            long rev = client.doGetRevisionProperty(revPropURL, propertyName, getSVNEnvironment().getStartRevision(), this);
            SVNPropertyData property = getRevisionProperty(rev);
            SVNPropertyValue propertyValue = property != null ? property.getValue() : SVNPropertyValue.create("");
            byte[] propBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue);           
            byte[] bytes = SVNCommandUtil.runEditor(getSVNEnvironment(), getSVNEnvironment().getEditorCommand(), propBytes, "svn-prop");
            SVNPropertyValue newPropertyValue = SVNPropertyValue.create(propertyName, bytes);
            if (newPropertyValue != null && !newPropertyValue.equals(propertyValue)) {
                clearCollectedProperties();
                client.doSetRevisionProperty(revPropURL, SVNRevision.create(rev), propertyName, newPropertyValue, getSVNEnvironment().isForce(), this);
                String message = "Set new value for property ''{0}'' on revision {1}";
                message = MessageFormat.format(message, new Object[]{propertyName, new Long(rev)});
                getSVNEnvironment().getOut().println(message);
            } else {
                String message = "No changes to property ''{0}'' on revision {1}";
                message = MessageFormat.format(message, new Object[]{propertyName, new Long(rev)});
                getSVNEnvironment().getOut().println(message);
            }
        } else if (getSVNEnvironment().getStartRevision() != SVNRevision.UNDEFINED) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
                    "Cannot specify revision for editing versioned property ''{0}''", propertyName);
            SVNErrorManager.error(err, SVNLogType.CLIENT);
        } else {
            if (targets.isEmpty()) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS,
                        "Explicit target argument required", propertyName);
                SVNErrorManager.error(err, SVNLogType.CLIENT);
            }
            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()) {
                    if (getSVNEnvironment().getMessage() != null || getSVNEnvironment().getFileData() != null || getSVNEnvironment().getRevisionProperties() != null) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_UNNECESSARY_LOG_MESSAGE,
                                "Local, non-commit operations do not take a log message or revision properties");
                        SVNErrorManager.error(err, SVNLogType.CLIENT);
                    }
                    SVNPropertyData property = client.doGetProperty(target.getFile(), propertyName,
                            SVNRevision.UNDEFINED, SVNRevision.WORKING);
                    SVNPropertyValue propertyValue = property != null ? property.getValue() : SVNPropertyValue.create("");
                    byte[] propBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue);                  
                    byte[] bytes = SVNCommandUtil.runEditor(getSVNEnvironment(), getSVNEnvironment().getEditorCommand(), propBytes, "svn-prop");
                    SVNPropertyValue newPropertyValue = SVNPropertyValue.create(propertyName, bytes);
                    if (newPropertyValue != null && !newPropertyValue.equals(propertyValue)) {
                        checkBooleanProperty(propertyName, newPropertyValue);
                        client.doSetProperty(target.getFile(), propertyName, newPropertyValue,
                                getSVNEnvironment().isForce(), SVNDepth.EMPTY, this, null);
                        String message = "Set new value for property ''{0}'' on ''{1}''";
                        String path = SVNCommandUtil.getLocalPath(targetName);
                        message = MessageFormat.format(message, new Object[]{propertyName, path});
                        getSVNEnvironment().getOut().println(message);
                    } else {
                        String message = "No changes to property ''{0}'' on ''{1}''";
                        String path = SVNCommandUtil.getLocalPath(targetName);
                        message = MessageFormat.format(message, new Object[]{propertyName, path});
                        getSVNEnvironment().getOut().println(message);
                    }
                } else {
                    SVNPropertyData property = client.doGetProperty(target.getURL(), propertyName,
                            SVNRevision.UNDEFINED, SVNRevision.HEAD);
                    SVNPropertyValue propertyValue = property != null ? property.getValue() : SVNPropertyValue.create("");
                    byte[] propBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue);                                      
                    byte[] bytes = SVNCommandUtil.runEditor(getSVNEnvironment(), getSVNEnvironment().getEditorCommand(), propBytes, "svn-prop");
                    SVNPropertyValue newPropertyValue = SVNPropertyValue.create(propertyName, bytes);
                    if (newPropertyValue != null && !newPropertyValue.equals(propertyValue)) {
                        checkBooleanProperty(propertyName, newPropertyValue);
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

        if (getSVNEnvironment().isRevprop()) {
            SVNURL url = getRevpropURL(getSVNEnvironment().getStartRevision(), targets);
            SVNWCClient wcClient = getSVNEnvironment().getClientManager().getWCClient();
            long rev = wcClient.doGetRevisionProperty(url, propertyName, getSVNEnvironment().getStartRevision(), this);
            SVNPropertyData propertyValue = getRevisionProperty(rev);
            if (propertyValue != null) {
                if (getSVNEnvironment().isXML()) {
                    printXMLHeader("properties");
                    StringBuffer buffer = openXMLTag("revprops", SVNXMLUtil.XML_STYLE_NORMAL, "rev", Long.toString(rev), null);
                    buffer = addXMLProp(propertyValue, buffer);
                    buffer = closeXMLTag("revprops", buffer);
                    getSVNEnvironment().getOut().print(buffer);
                    printXMLFooter("properties");
                } else {
                    if (propertyValue.getValue().isString()){
                        getSVNEnvironment().getOut().print(propertyValue.getValue());
                    } else {
                        try {
                            getSVNEnvironment().getOut().write(propertyValue.getValue().getBytes());
                        } catch (IOException e) {
                            //
                        }
                    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

                }
            }
            if (likePropList) {
                printProplist(props);
            } else {
                SVNPropertyData property = (SVNPropertyData) props.get(0);
                printProperty(property.getValue(), likePropList);
                if (!getSVNEnvironment().isStrict()) {
                    getSVNEnvironment().getOut().println();
                }
            }
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNPropertyData

            List props = (List) map.get(key);
            String target = key.toString();
            if (!isURL) {
                target = SVNCommandUtil.getLocalPath(getSVNEnvironment().getRelativePath((File) key));
            }
            SVNPropertyData property = (SVNPropertyData) props.get(0);
            StringBuffer buffer = openXMLTag("target", SVNXMLUtil.XML_STYLE_NORMAL, "path", target, null);
            buffer = addXMLProp(property, buffer);
            buffer = closeXMLTag("target", buffer);
            getSVNEnvironment().getOut().print(buffer);
        }
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.