Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNPropertyValue


    private void setWCFormat(SVNAdminAreaInfo info, SVNAdminArea area, int format) throws SVNException {
        if (!isIgnoreExternals()) {
            SVNVersionedProperties props = area.getProperties(area.getThisDirName());
            SVNVersionedProperties baseProps = area.getBaseProperties(area.getThisDirName());
            SVNPropertyValue property = props.getPropertyValue(SVNProperty.EXTERNALS);
            SVNPropertyValue baseProperty = baseProps.getPropertyValue(SVNProperty.EXTERNALS);
            if (property != null || baseProperty != null) {
                String areaPath = area.getRelativePath(info.getAnchor());
                info.addExternal(areaPath, property != null ? property.getString() : null, baseProperty != null ? baseProperty.getString() : null);
            }
        }
        // re-open this area for writing now!
        area.getWCAccess().closeAdminArea(area.getRoot());
        area = area.getWCAccess().open(area.getRoot(), true, false, false, 0, Level.FINE);
View Full Code Here


        SVNProperties props = new SVNProperties();
        if (kind == SVNNodeKind.DIR) {
            Collection children = repos.getDir(path, revNumber, props, SVNDirEntry.DIRENT_KIND,
                    SVNDepth.FILES.compareTo(depth) <= 0 ? new ArrayList() : null);
            if (propName != null) {
                SVNPropertyValue value = props.getSVNPropertyValue(propName);
                if (value != null) {
                    handler.handleProperty(url, new SVNPropertyData(propName, value, getOptions()));
                }
            } else {
                for (Iterator names = props.nameSet().iterator(); names.hasNext();) {
                    String name = (String) names.next();
                    if (name.startsWith(SVNProperty.SVN_ENTRY_PREFIX)
                            || name.startsWith(SVNProperty.SVN_WC_PREFIX)) {
                        continue;
                    }
                    SVNPropertyValue value = props.getSVNPropertyValue(name);
                    handler.handleProperty(url, new SVNPropertyData(name, value, getOptions()));
                }
            }
            if (SVNDepth.FILES.compareTo(depth) <= 0) {
                checkCancelled();
                for (Iterator entries = children.iterator(); entries.hasNext();) {
                    SVNDirEntry child = (SVNDirEntry) entries.next();
                    SVNURL childURL = url.appendPath(child.getName(), false);
                    String childPath = "".equals(path) ? child.getName() : SVNPathUtil.append(path, child.getName());
                    SVNDepth depthBelowHere = depth;
                    if (child.getKind() == SVNNodeKind.DIR && depth == SVNDepth.FILES) {
                        continue;
                    }
                    if (depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) {
                        depthBelowHere = SVNDepth.EMPTY;
                    }
                    doGetRemoteProperty(childURL, childPath, repos, propName, rev, depthBelowHere, handler);
                }
            }
        } else if (kind == SVNNodeKind.FILE) {
            repos.getFile(path, revNumber, props, null);
            if (propName != null) {
                SVNPropertyValue value = props.getSVNPropertyValue(propName);
                if (value != null) {
                    handler.handleProperty(url, new SVNPropertyData(propName, value, getOptions()));
                }
            } else {
                for (Iterator names = props.nameSet().iterator(); names.hasNext();) {
                    String name = (String) names.next();
                    if (name.startsWith(SVNProperty.SVN_ENTRY_PREFIX)
                            || name.startsWith(SVNProperty.SVN_WC_PREFIX)) {
                        continue;
                    }
                    SVNPropertyValue value = props.getSVNPropertyValue(name);
                    handler.handleProperty(url, new SVNPropertyData(name, value, getOptions()));
                }
            }
        } else if (kind == SVNNodeKind.NONE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,
View Full Code Here

            wcAccess.walkEntries(target, propGetHandler, false, depth);
        } else if (SVNWCAccess.matchesChangeList(changeLists, entry)) {
            if (propName == null) {//proplist hack for compatibility with subvsersion
                SVNVersionedProperties properties = base ? area.getBaseProperties(entry.getName()) : area.getProperties(entry.getName());
                if (propName != null) {
                    SVNPropertyValue propValue = properties.getPropertyValue(propName);
                    if (propValue != null) {
                        handler.handleProperty(target, new SVNPropertyData(propName, propValue, getOptions()));
                    }
                } else {
                    SVNProperties allProps = properties.asMap();
                    for (Iterator names = allProps.nameSet().iterator(); names.hasNext();) {
                        String name = (String) names.next();
                        SVNPropertyValue val = allProps.getSVNPropertyValue(name);
                        handler.handleProperty(area.getFile(entry.getName()), new SVNPropertyData(name, val, getOptions()));
                    }
                }
            } else {
                propGetHandler.handleEntry(target, entry);
View Full Code Here

        SVNProperties changedProperties = propertyValueProvider.providePropertyValues(path, unmodifiableProperties);
        SVNProperties propDiff = properties.compareTo(changedProperties);

        for (Iterator iterator = propDiff.nameSet().iterator(); iterator.hasNext();) {
            String propName = (String) iterator.next();
            SVNPropertyValue propValue = propDiff.getSVNPropertyValue(propName);

            if (propValue != null && !SVNPropertiesManager.isValidPropertyName(propName)) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_PROPERTY_NAME,
                        "Bad property name ''{0}''", propName);
                SVNErrorManager.error(err, SVNLogType.WC);
View Full Code Here

        SVNAdminArea srcArea = srcEntry.getAdminArea();
        SVNVersionedProperties srcProps = srcArea.getProperties(srcEntry.getName());
        Collection propNames = srcProps.getPropertyNames(null);
        for (Iterator propNamesIter = propNames.iterator(); propNamesIter.hasNext();) {
            String propName = (String) propNamesIter.next();
            SVNPropertyValue propValue = srcProps.getPropertyValue(propName);
            SVNPropertiesManager.setProperty(dstAccess, dst, propName, propValue, false);
        }
    }
View Full Code Here

       
    }

    private void doGetRevisionProperty(SVNRepository repos, String propName, long revNumber, ISVNPropertyHandler handler) throws SVNException {
        if (propName != null) {
            SVNPropertyValue value = repos.getRevisionPropertyValue(revNumber, propName);
            if (value != null) {
                handler.handleProperty(revNumber, new SVNPropertyData(propName, value, getOptions()));
            }
        } else {
            SVNProperties props = new SVNProperties();
            repos.getRevisionProperties(revNumber, props);
            for (Iterator names = props.nameSet().iterator(); names.hasNext();) {
                String name = (String) names.next();
                SVNPropertyValue value = props.getSVNPropertyValue(name);
                handler.handleProperty(revNumber, new SVNPropertyData(name, value, getOptions()));
            }
        }
    }
View Full Code Here

            SVNStatusType status = SVNPropertiesManager.mergeProperties(getWCAccess(), file, originalProperties, regularProps,
                    false, myIsDryRun);
            if (!myIsDryRun) {
                for (Iterator propsIter = regularProps.nameSet().iterator(); propsIter.hasNext();) {
                    String propName = (String) propsIter.next();
                    SVNPropertyValue propValue = regularProps.getSVNPropertyValue(propName);
                    if (SVNProperty.MERGE_INFO.equals(propName)) {
                        SVNPropertyValue mergeInfoProp = originalProperties.getSVNPropertyValue(SVNProperty.MERGE_INFO);
                        if (mergeInfoProp == null && propValue != null) {
                            myMergeDriver.addPathWithNewMergeInfo(file);
                        } else if (mergeInfoProp != null && propValue == null) {
                            myMergeDriver.addPathWithDeletedMergeInfo(file);
                        }
View Full Code Here

                continue;
            }
            if (!myMergeDriver.isSameRepository() && SVNProperty.MERGE_INFO.equals(propName)) {
                continue;
            }
            SVNPropertyValue propValue = diff.getSVNPropertyValue(propName);
            newProps.put(propName, propValue);
        }
        File mergedFile = getFile(path);
        SVNAdminArea dir = retrieve(mergedFile.getParentFile(), true);
        if (dir == null) {
View Full Code Here

        List conflict = new LinkedList();
        SVNStatusType status = SVNStatusType.UNCHANGED;

        for (Iterator propEntries = propDiff.nameSet().iterator(); propEntries.hasNext();) {
            String propName = (String) propEntries.next();
            SVNPropertyValue toValue = propDiff.getSVNPropertyValue(propName);
            SVNPropertyValue fromValue = serverBaseProps.getSVNPropertyValue(propName);
            SVNPropertyValue workingValue = workingProperties.getSVNPropertyValue(propName);
            SVNPropertyValue baseValue = baseProperties.getSVNPropertyValue(propName);
            boolean isNormal = SVNProperty.isRegularProperty(propName);
            if (baseMerge) {
                changeProperty(baseProperties, propName, toValue);
            }           
View Full Code Here

                }
            }

            if ((baseValue != null && oldValue == null) ||
                    (baseValue == null && oldValue != null)) {
                SVNPropertyValue theValue = baseValue != null ? baseValue : oldValue;
                baseFile = SVNFileUtil.createUniqueFile(path.getParentFile(), path.getName(), ".tmp", false);
                OutputStream os = SVNFileUtil.openFileForWriting(baseFile);
                try {
                    os.write(SVNPropertyValue.getPropertyAsBytes(theValue));
                } catch (IOException e) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR,
                            "Cannot write a base property value file: {1}", e.getLocalizedMessage());
                    SVNErrorManager.error(err, e, SVNLogType.WC);
                } finally {
                    SVNFileUtil.closeFile(os);
                }
            } else if (baseValue != null && oldValue != null) {
                SVNPropertyValue theValue = baseValue;
                if (!baseValue.equals(oldValue)) {
                    if (workingValue != null && baseValue.equals(workingValue)) {
                        theValue = oldValue;
                    }
                }
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.