Examples of SVNVersionedProperties


Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

        SVNStatusType propStatus = SVNStatusType.UNKNOWN;
        SVNAdminArea adminArea = myCurrentDirectory.getAdminArea();

        if (myCurrentDirectory.wasIncomplete) {
            // delete all props.
            SVNVersionedProperties oldBaseProps = adminArea.getBaseProperties(adminArea.getThisDirName());
            SVNProperties baseMap = oldBaseProps.asMap();
            if (modifiedProps == null) {
                modifiedProps = new SVNProperties();
            }
            for(Iterator names = baseMap.nameSet().iterator(); names.hasNext();) {
                String name = (String) names.next();
                if (!modifiedProps.containsName(name)) {
                    modifiedProps.put(name, SVNPropertyValue.create(null));
                }
            }
        }

        if (modifiedWCProps != null || modifiedEntryProps != null || modifiedProps != null) {
            SVNLog log = myCurrentDirectory.getLog();
            if (modifiedProps != null && !modifiedProps.isEmpty()) {
                if (modifiedProps.containsName(SVNProperty.EXTERNALS)) {
                    String oldExternal = adminArea.getProperties(adminArea.getThisDirName()).getStringPropertyValue(SVNProperty.EXTERNALS);
                    String newExternal = modifiedProps.getStringValue(SVNProperty.EXTERNALS);
                    String path = myCurrentDirectory.getPath();
                    if (oldExternal == null && newExternal != null) {
                        myAdminInfo.addExternal(path, oldExternal, newExternal);
                        myAdminInfo.addDepth(path, myCurrentDirectory.myAmbientDepth);
                    } else if (oldExternal != null && newExternal == null) {
                        myAdminInfo.addExternal(path, oldExternal, newExternal);
                        myAdminInfo.addDepth(path, myCurrentDirectory.myAmbientDepth);
                    } else if (oldExternal != null && !oldExternal.equals(newExternal)) {
                        myAdminInfo.addExternal(path, oldExternal, newExternal);
                        myAdminInfo.addDepth(path, myCurrentDirectory.myAmbientDepth);
                    }
                }
                SVNVersionedProperties oldBaseProps = adminArea.getBaseProperties(adminArea.getThisDirName());
                try {
                    propStatus = adminArea.mergeProperties(adminArea.getThisDirName(), oldBaseProps.asMap(),
                        modifiedProps, null, null, true, false, log);
                } catch (SVNException svne) {
                    SVNErrorMessage err = svne.getErrorMessage().wrap("Couldn't do property merge");
                    SVNErrorManager.error(err, svne, SVNLogType.WC);
                }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

        SVNStatusType textStatus = SVNStatusType.UNCHANGED;
        SVNStatusType lockStatus = SVNStatusType.LOCK_UNCHANGED;

        if (myAdminInfo.isIncomplete(fileInfo.getPath()) && fileEntry != null) {
            // delete all props.
            SVNVersionedProperties oldBaseProps = adminArea.getBaseProperties(fileEntry.getName());
            SVNProperties baseMap = oldBaseProps.asMap();
            if (modifiedProps == null) {
                modifiedProps = new SVNProperties();
            }
            for(Iterator names = baseMap.nameSet().iterator(); names.hasNext();) {
                String propName = (String) names.next();
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

        if (!files.isBinary() && status != SVNStatusType.CONFLICTED) {
            if (files.getCopyFromFile() != null) {
                status = SVNStatusType.MERGED;
            } else {
                SVNAdminArea adminArea = files.getAdminArea();
                SVNVersionedProperties props = adminArea.getProperties(files.getWCPath());
                boolean isSpecial = props.getPropertyValue(SVNProperty.SPECIAL) != null;
                 // compare merge result with 'wcFile' (in case of text and no conflict).
                boolean isSameContents = SVNFileUtil.compareFiles(isSpecial ? files.getLocalFile() :
                    files.getWCFile(), files.getResultFile(), null);
                status = isSameContents ? SVNStatusType.UNCHANGED : status;
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

            if (addedFileType == SVNFileType.NONE) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_PATH_NOT_FOUND,
                        "''{0}'' is scheduled for addition, but is missing", path);
                SVNErrorManager.error(err, SVNLogType.WC);
            }
            SVNVersionedProperties props = dir.getProperties(entry.getName());
            SVNVersionedProperties baseProps = dir.getBaseProperties(entry.getName());           
            SVNProperties propDiff = null;
            if (entry.isScheduledForReplacement()) {
                propDiff = props.asMap();
            } else {
                propDiff = baseProps.compareTo(props).asMap();
            }
            boolean eolChanged = textModified = propDiff != null && propDiff.containsName(SVNProperty.EOL_STYLE);
            boolean charsetChanged = propDiff != null && propDiff.containsName(SVNProperty.CHARSET);
            textModified = eolChanged || charsetChanged;
            if (entry.getKind() == SVNNodeKind.FILE) {
                if (commitCopy) {
                    textModified = propDiff != null && (propDiff.containsName(SVNProperty.EOL_STYLE) || propDiff.containsName(SVNProperty.CHARSET));
                    if (!textModified) {
                        textModified = dir.hasTextModifications(entry.getName(), eolChanged);
                    }
                } else {
                    textModified = true;
                }
            }
            propsModified = propDiff != null && !propDiff.isEmpty();
        } else if (!commitDeletion) {
            SVNVersionedProperties props = dir.getProperties(entry.getName());
            SVNVersionedProperties baseProps = dir.getBaseProperties(entry.getName());
            SVNProperties propDiff = baseProps.compareTo(props).asMap();
            boolean forceComparison = textModified = propDiff != null && (propDiff.containsName(SVNProperty.EOL_STYLE) || propDiff.containsName(SVNProperty.CHARSET));
            propsModified = propDiff != null && !propDiff.isEmpty();
            if (entry.getKind() == SVNNodeKind.FILE) {
                textModified = dir.hasTextModifications(entry.getName(),  forceComparison);
            }
        }

        commitLock = entry.getLockToken() != null && (justLocked || textModified || propsModified
                        || commitDeletion || commitAddition || commitCopy);

        if (commitAddition || commitDeletion || textModified || propsModified
                || commitCopy || commitLock) {
            if (SVNWCAccess.matchesChangeList(changelists, entry)) {
                SVNCommitItem item = new SVNCommitItem(path,
                        SVNURL.parseURIEncoded(url), cfURL != null ? SVNURL.parseURIEncoded(cfURL) : null, entry.getKind(),
                        SVNRevision.create(entry.getRevision()), SVNRevision.create(cfRevision),
                        commitAddition, commitDeletion, propsModified, textModified, commitCopy,
                        commitLock);
                String itemPath = dir.getRelativePath(dir.getWCAccess().retrieve(dir.getWCAccess().getAnchor()));
                if ("".equals(itemPath)) {
                    itemPath += entry.getName();
                } else if (!"".equals(entry.getName())) {
                    itemPath += "/" + entry.getName();
                }
                item.setPath(itemPath);
                commitables.put(path, item);
                if (lockTokens != null && entry.getLockToken() != null) {
                    lockTokens.put(url, entry.getLockToken());
                }
            }
        }

        //collect externals properties
        if (pathsToExternalsProperties != null && SVNWCAccess.matchesChangeList(changelists, entry)) {
            SVNVersionedProperties props = dir.getProperties(entry.getName());
            String externalsProperty = props.getStringPropertyValue(SVNProperty.EXTERNALS);
            if (externalsProperty != null) {
                pathsToExternalsProperties.put(dir.getFile(entry.getName()), externalsProperty);
            }
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

        SVNEntry entry = dir.getEntry(name, false);
        boolean replaced = false;
        if (entry != null) {
            replaced = entry.isScheduledForReplacement();
        }
        SVNVersionedProperties props = dir.getProperties(name);
        SVNVersionedProperties baseProps = replaced ? null : dir.getBaseProperties(name);
        SVNProperties diff = replaced ? props.asMap() : baseProps.compareTo(props).asMap();
        if (diff != null && !diff.isEmpty()) {
            File tmpPropsFile = dir.getPropertiesFile(name, true);
            SVNWCProperties tmpProps = new SVNWCProperties(tmpPropsFile, null);
            for(Iterator propNames = props.getPropertyNames(null).iterator(); propNames.hasNext();) {
                String propName = (String) propNames.next();
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

    public static boolean setWCProperty(SVNWCAccess access, File path, String propName, SVNPropertyValue propValue,
                                        boolean write) throws SVNException {
        SVNEntry entry = access.getVersionedEntry(path, false);
        SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile());
        SVNVersionedProperties wcProps = dir.getWCProperties(entry.getName());
        SVNPropertyValue oldValue = wcProps.getPropertyValue(propName);
        wcProps.setPropertyValue(propName, propValue);
        if (write) {
            dir.saveWCProperties(false);
        }
        return oldValue == null ? propValue != null : !oldValue.equals(propValue);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

        return dir.getWCProperties(entry.getName()).getPropertyValue(propName);
    }

    public static void deleteWCProperties(SVNAdminArea dir, String name, boolean recursive) throws SVNException {
        if (name != null) {
            SVNVersionedProperties props = dir.getWCProperties(name);
            if (props != null) {
                props.removeAll();
            }
        }
        if (recursive || name == null) {
            for (Iterator entries = dir.entries(false); entries.hasNext();) {
                SVNEntry entry = (SVNEntry) entries.next();
                SVNVersionedProperties props = dir.getWCProperties(entry.getName());
                if (props != null) {
                    props.removeAll();
                }
                if (entry.isFile() || dir.getThisDirName().equals(entry.getName())) {
                    continue;
                }
                if (recursive) {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

                SVNFileUtil.setReadonly(path, false);
            } else {
                propValue = SVNProperty.getValueOfBooleanProperty(propName);
            }
        }
        SVNVersionedProperties properties = dir.getProperties(entry.getName());
        SVNPropertyValue oldValue = properties.getPropertyValue(propName);
        SVNEventAction action;
        if (oldValue == null) {
            if (propValue == null) {
                action = SVNEventAction.PROPERTY_DELETE_NONEXISTENT;
            } else {
                action = SVNEventAction.PROPERTY_ADD;
            }
        } else {
            if (propValue == null) {
                action = SVNEventAction.PROPERTY_DELETE;
            } else {
                action = SVNEventAction.PROPERTY_MODIFY;
            }
          
        }
        if (!updateTimeStamp && (entry.getKind() == SVNNodeKind.FILE && SVNProperty.KEYWORDS.equals(propName))) {
            Collection oldKeywords = getKeywords(oldValue == null ? null : oldValue.getString());
            Collection newKeywords = getKeywords(propValue == null ? null : propValue.getString());
            updateTimeStamp = !oldKeywords.equals(newKeywords);
        }
        SVNLog log = dir.getLog();
        if (updateTimeStamp) {
            SVNProperties command = new SVNProperties();
            command.put(SVNLog.NAME_ATTR, entry.getName());
            command.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), (String) null);
            log.addCommand(SVNLog.MODIFY_ENTRY, command, false);
        }
        properties.setPropertyValue(propName, propValue);
        dir.saveVersionedProperties(log, false);
        log.save();
        dir.runLogs();
        final boolean modified = oldValue == null ? propValue != null : !oldValue.equals(propValue);
        if (modified || action == SVNEventAction.PROPERTY_DELETE_NONEXISTENT) {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

                SVNWCAccess access = adminArea.getWCAccess();
                if (base) {
                    SVNEntry pathEntry = access.getEntry(itemPath, false);
                    if (pathEntry != null) {
                        SVNAdminArea pathArea = pathEntry.getAdminArea();
                        SVNVersionedProperties baseProps = pathArea.getBaseProperties(pathEntry.getName());
                        propValue = baseProps.getPropertyValue(propName);
                    }
                } else {
                    SVNEntry pathEntry = access.getEntry(itemPath, true);
                    if (pathEntry != null) {
                        SVNAdminArea pathArea = pathEntry.getAdminArea();
                        SVNVersionedProperties workingProps = pathArea.getProperties(pathEntry.getName());
                        propValue = workingProps.getPropertyValue(propName);
                    }
                }

                if (propValue != null) {
                    pathsToPropValues.put(itemPath, propValue);
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.wc.admin.SVNVersionedProperties

            SVNAdminArea adminArea = entry.getAdminArea();
            if (entry.getKind() == SVNNodeKind.DIR && !adminArea.getThisDirName().equals(entry.getName()) && !entry.isAbsent()) {
                return;
            }
           
            SVNVersionedProperties props = adminArea.getProperties(entry.getName());
            String mergeInfoProp = props.getStringPropertyValue(SVNProperty.MERGE_INFO);
            if (mergeInfoProp != null || path.equals(myTargetPath)) {
                String storedPath = getPathRelativeToRoot(path, null, myTargetReposRoot, adminArea.getWCAccess(), null);
                mySubTreesWithMergeInfoPaths.add(storedPath);
            }
        }
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.