Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNPropertyValue


        return this;
    }

    private void handleCharsetProperty(SVNAdminArea adminArea, SVNLog log, SVNEntry entry, SVNVersionedProperties baseProps) throws SVNException {
        SVNProperties command = new SVNProperties();
        SVNPropertyValue charsetProp = baseProps.getPropertyValue(SVNProperty.CHARSET);
        String currentCharset = charsetProp == null ? null : charsetProp.getString();
        currentCharset = SVNTranslator.getCharset(currentCharset, getAdminFile(entry.getName()).toString(), getWCAccess().getOptions());
        if (currentCharset != null && !SVNProperty.isUTF8(currentCharset)) {
            File detranslatedFile = SVNAdminUtil.createTmpFile(this, "detranslated", ".tmp", true);
            String detranslatedPath = SVNPathUtil.getRelativePath(getRoot().getAbsolutePath(), detranslatedFile.getAbsolutePath());
            File tmpCharsetPropFile = SVNAdminUtil.createTmpFile(this, "props", ".tmp", true);
View Full Code Here


        if (modifiedEntryProps != null) {
            SVNProperties command = new SVNProperties();
            command.put(SVNLog.NAME_ATTR, name);
            for (Iterator names = modifiedEntryProps.nameSet().iterator(); names.hasNext();) {
                String propName = (String) names.next();
                SVNPropertyValue propValue = modifiedEntryProps.getSVNPropertyValue(propName);
                String longPropName = !propName.startsWith(SVNProperty.SVN_ENTRY_PREFIX) ? SVNProperty.SVN_ENTRY_PREFIX + propName : propName;

                if (SVNProperty.LOCK_TOKEN.equals(longPropName)) {
                    SVNProperties deleteLockCommand = new SVNProperties();
                    deleteLockCommand.put(SVNLog.NAME_ATTR, name);
View Full Code Here

        if (modifiedWCProps != null) {
            SVNProperties command = new SVNProperties();
            command.put(SVNLog.NAME_ATTR, name);
            for (Iterator names = modifiedWCProps.nameSet().iterator(); names.hasNext();) {
                String propName = (String) names.next();
                SVNPropertyValue propValue = modifiedWCProps.getSVNPropertyValue(propName);
                command.put(SVNLog.PROPERTY_NAME_ATTR, propName);
                if (propValue != null) {
                    command.put(SVNLog.PROPERTY_VALUE_ATTR, propValue);
                } else {
                    command.remove(SVNLog.PROPERTY_VALUE_ATTR);
View Full Code Here

        } catch (SVNException e) {
            // save failed command and unexecuted commands back to the log file.
            myCache = null;
            for (Iterator cmds = commands.iterator(); cmds.hasNext();) {
                SVNProperties command = (SVNProperties) cmds.next();
                SVNPropertyValue name = command.remove("");
                addCommand(name.getString(), command, false);
            }
            save();
            throw e;
        }
    }
View Full Code Here

    public abstract boolean containsProperty(String name) throws SVNException;
   
    public abstract SVNPropertyValue getPropertyValue(String name) throws SVNException;

    public String getStringPropertyValue(String name) throws SVNException {
        SVNPropertyValue value = getPropertyValue(name);
        return value == null ? null : value.getString();
    }
View Full Code Here

   
    public static int writeRevisionProperties(SVNRepository toRepository, long revision, SVNProperties revProps) throws SVNException {
        int filteredCount = 0;
        for (Iterator propNamesIter = revProps.nameSet().iterator(); propNamesIter.hasNext();) {
            String propName = (String) propNamesIter.next();
            SVNPropertyValue propValue = revProps.getSVNPropertyValue(propName);
            if (propName.startsWith(SVNProperty.SVN_SYNC_PREFIX)) {
                filteredCount++;
            } else {
                toRepository.setRevisionPropertyValue(revision, propName, propValue);
            }
View Full Code Here

            }
        }
       
        for(Iterator names = propNames.iterator(); names.hasNext();) {
            String propName = (String) names.next();
            SVNPropertyValue propValue = props.getSVNPropertyValue(propName);
            if (oldProps != null) {
                SVNPropertyValue oldValue = oldProps.getSVNPropertyValue(propName);
                if (oldValue != null && oldValue.equals(propValue)) {
                    continue;
                }
            }
           
            SVNWCProperties.appendProperty(propName, propValue, dumpStream);
View Full Code Here

        SVNProperties targetProps = targetNode.getProperties(fsfs);
        SVNProperties propsDiffs = FSRepositoryUtil.getPropsDiffs(sourceProps, targetProps);
        Object[] names = propsDiffs.nameSet().toArray();
        for (int i = 0; i < names.length; i++) {
            String propName = (String) names[i];
            SVNPropertyValue propValue = propsDiffs.getSVNPropertyValue(propName);
            if (isDir) {
                editor.changeDirProperty(propName, propValue);
            } else {
                editor.changeFileProperty(editPath, propName, propValue);
            }
View Full Code Here

    public void displayPropDiff(String path, SVNProperties baseProps, SVNProperties diff, OutputStream result) throws SVNException {
        baseProps = baseProps != null ? baseProps : new SVNProperties();
        diff = diff != null ? diff : new SVNProperties();
        for (Iterator changedPropNames = diff.nameSet().iterator(); changedPropNames.hasNext();) {
            String name = (String) changedPropNames.next();
            SVNPropertyValue originalValue = baseProps.getSVNPropertyValue(name);
            SVNPropertyValue newValue = diff.getSVNPropertyValue(name);
            if ((originalValue != null && originalValue.equals(newValue)) || (originalValue == null && newValue == null)) {
                changedPropNames.remove();
            }
        }
        if (diff.isEmpty()) {
            return;
        }
        path = getDisplayPath(path);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        diff = new SVNProperties(diff);
        try {
            bos.write(getEOL());
            bos.write(("Property changes on: " + (useLocalFileSeparatorChar() ? path.replace('/', File.separatorChar) : path)).getBytes(getEncoding()));
            bos.write(getEOL());
            bos.write(PROPERTIES_SEPARATOR);
            bos.write(getEOL());
            for (Iterator changedPropNames = diff.nameSet().iterator(); changedPropNames.hasNext();) {
                String name = (String) changedPropNames.next();
                SVNPropertyValue originalValue = baseProps != null ? baseProps.getSVNPropertyValue(name) : null;
                SVNPropertyValue newValue = diff.getSVNPropertyValue(name);
                String headerFormat = null;
               
                if (originalValue == null) {
                    headerFormat = "Added: ";
                } else if (newValue == null) {
                    headerFormat = "Deleted: ";
                } else {
                    headerFormat = "Modified: ";
                }
               
                bos.write((headerFormat + name).getBytes(getEncoding()));
                bos.write(getEOL());
                if (SVNProperty.MERGE_INFO.equals(name)) {
                    displayMergeInfoDiff(bos, originalValue == null ? null : originalValue.getString(), newValue == null ? null : newValue.getString());
                    continue;
                }
                if (originalValue != null) {
                    bos.write("   - ".getBytes(getEncoding()));
                    bos.write(getPropertyAsBytes(originalValue, getEncoding()));
View Full Code Here

    private SVNProperties applyPropChanges(SVNProperties props, SVNProperties propChanges) {
        SVNProperties result = new SVNProperties(props);
        if (propChanges != null) {
            for(Iterator names = propChanges.nameSet().iterator(); names.hasNext();) {
                String name = (String) names.next();
                SVNPropertyValue value = propChanges.getSVNPropertyValue(name);
                if (value == null) {
                    result.remove(name);
                } else {
                    result.put(name, value);
                }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNPropertyValue

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.