Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNProperties


        }
        return SVNStatusType.UNKNOWN;
    }

    public SVNStatusType propertiesChanged(String path, SVNProperties originalProperties, SVNProperties diff, boolean[] isTreeConflicted) throws SVNException {
        originalProperties = originalProperties == null ? new SVNProperties() : originalProperties;
        diff = diff == null ? new SVNProperties() : diff;
        SVNProperties regularDiff = new SVNProperties();
        categorizeProperties(diff, regularDiff, null, null);
        if (diff.isEmpty()) {
            return SVNStatusType.UNKNOWN;
        }
        myGenerator.displayPropDiff(getDisplayPath(path), originalProperties, regularDiff, myResult);
View Full Code Here


        for (Iterator entriesIter = entries.values().iterator(); entriesIter.hasNext();) {
            FSEntry entry = (FSEntry) entriesIter.next();
            String kidPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName()));
            FSRevisionNode kidNode = root.getRevisionNode(kidPath);
            if (kidNode.hasMergeInfo()) {
                SVNProperties propList = kidNode.getProperties(fsfs);
                String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO);
                if (mergeInfoString == null) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT,
                            "Node-revision #''{0}'' claims to have mergeinfo but doesn''t", entry.getId());
                    SVNErrorManager.error(err, SVNLogType.FSFS);
                }
View Full Code Here

            if (nearestAncestor == null) {
                return mergeInfo;
            }
        }
       
        SVNProperties propList = nearestAncestor.getRevNode().getProperties(fsfs);
        String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO);
        if (mergeInfoString == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT,
                    "Node-revision ''{0}@{1}'' claims to have mergeinfo but doesn''t",
                    new Object[] { nearestAncestor.getAbsPath(), new Long(revRoot.getRevision()) });
            SVNErrorManager.error(err, SVNLogType.FSFS);
View Full Code Here

            if (myLogEntryHandler != null) {
                if (myPaths == null) {
                    myPaths = new SVNHashMap();
                }
                if (myRevProps == null) {
                    myRevProps = new SVNProperties();
                }
                if (myAuthor != null) {
                    myRevProps.put(SVNRevisionProperty.AUTHOR, myAuthor);
                }
                if (myComment != null) {
                    myRevProps.put(SVNRevisionProperty.LOG, myComment);
                }
                if (myDate != null) {
                    myRevProps.put(SVNRevisionProperty.DATE, SVNDate.formatDate(myDate));
                }
                SVNLogEntry logEntry = new SVNLogEntry(myPaths, myRevision, myRevProps, myHasChildren);
                myLogEntryHandler.handleLogEntry(logEntry);
                if (logEntry.hasChildren()) {
                    myNestLevel++;
                }
                if (logEntry.getRevision() < 0) {
                    myNestLevel = myNestLevel <= 0 ? 0 : myNestLevel -1;
                }
            }
            myPaths = null;
            myRevProps = null;
            myRevision = -1;
            myAuthor = null;
            myDate = null;
            myComment = null;
            myRevPropName = null;
            myHasChildren = false;
        } else if (element == DAVElement.VERSION_NAME && cdata != null) {
            try {
                myRevision = Long.parseLong(cdata.toString());
            } catch (NumberFormatException nfe) {
                SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, nfe), SVNLogType.NETWORK);
            }
        } else if (element == REVPROP) {
            if (myRevProps == null) {
                myRevProps = new SVNProperties();
            }
            if (myRevPropName != null && cdata != null) {
                myRevProps.put(myRevPropName, cdata.toString());
            }
        } else if (element == DAVElement.CREATOR_DISPLAY_NAME && cdata != null) {
View Full Code Here

    public static void addProperties(SVNAdminArea dir, String fileName, SVNProperties properties, boolean base, SVNLog log) throws SVNException {
        if (properties == null || properties.isEmpty()) {
            return;
        }
        SVNProperties regularProps = new SVNProperties();
        SVNProperties entryProps = new SVNProperties();
        SVNProperties wcProps = new SVNProperties();

        for (Iterator names = properties.nameSet().iterator(); names.hasNext();) {
            String propName = (String) names.next();
            SVNPropertyValue propValue = properties.getSVNPropertyValue(propName);
            if (SVNProperty.isEntryProperty(propName)) {
                entryProps.put(SVNProperty.shortPropertyName(propName), propValue);
            } else if (SVNProperty.isWorkingCopyProperty(propName)) {
                wcProps.put(propName, propValue);
            } else {
                regularProps.put(propName, propValue);
            }
        }
        SVNVersionedProperties props = base ? dir.getBaseProperties(fileName) : dir.getProperties(fileName);
View Full Code Here

        String revertPropPath = SVNAdminUtil.getPropRevertPath(entryName, entry.getKind(), false);
        String basePropPath = SVNAdminUtil.getPropBasePath(entryName, entry.getKind(), false);
       
        File basePropFile = area.getFile(basePropPath);
        if (basePropFile.isFile()) {
            SVNProperties command = new SVNProperties();
            command.put(SVNLog.NAME_ATTR, basePropPath);
            command.put(SVNLog.DEST_ATTR, revertPropPath);
            if (removeBase) {
                log.addCommand(SVNLog.MOVE, command, false);
            } else {
                log.addCommand(SVNLog.COPY, command, false);
            }
        } else {
            // create empty props file and move it to revert props.
            String tmpPath = SVNAdminUtil.getPropRevertPath(entryName, entry.getKind(), true);
            File tmpFile = area.getFile(tmpPath);
            SVNWCProperties.setProperties(new SVNProperties(), tmpFile, null, SVNWCProperties.SVN_HASH_TERMINATOR);
            SVNProperties command = new SVNProperties();
            command.put(SVNLog.NAME_ATTR, tmpPath);
            command.put(SVNLog.DEST_ATTR, revertPropPath);
            log.addCommand(SVNLog.MOVE, command, false);
        }
    }
View Full Code Here

        }
    }

    private SVNLogEntry fillLogEntry(long revision) throws SVNException {
        Map changedPaths = null;
        SVNProperties entryRevProps = null;
        boolean getRevProps = true;
        boolean censorRevProps = false;
        if (revision > 0 && myIsDiscoverChangedPaths) {
            FSRevisionRoot root = myFSFS.createRevisionRoot(revision);
            changedPaths = root.detectChanged();
        }

        //TODO: add autz check code later
        if (getRevProps) {
            SVNProperties revisionProps = myFSFS.getRevisionProperties(revision);

            if (revisionProps != null) {
                String author = revisionProps.getStringValue(SVNRevisionProperty.AUTHOR);
                String datestamp = revisionProps.getStringValue(SVNRevisionProperty.DATE);
                Date date = datestamp != null ? SVNDate.parseDateString(datestamp) : null;

                if (myRevPropNames == null || myRevPropNames.length == 0) {
                    if (censorRevProps) {
                        entryRevProps = new SVNProperties();
                        if (author != null) {
                            entryRevProps.put(SVNRevisionProperty.AUTHOR, author);
                        }
                        if (date != null) {
                            entryRevProps.put(SVNRevisionProperty.DATE, SVNDate.formatDate(date));
                        }
                    } else {
                        entryRevProps = revisionProps;
                        if (date != null) {
                            entryRevProps.put(SVNRevisionProperty.DATE, SVNDate.formatDate(date));
                        }
                    }
                } else {
                    for (int i = 0; i < myRevPropNames.length; i++) {
                        String propName = myRevPropNames[i];
                        SVNPropertyValue propVal = revisionProps.getSVNPropertyValue(propName);
                        if (censorRevProps && !SVNRevisionProperty.AUTHOR.equals(propName) &&
                                !SVNRevisionProperty.DATE.equals(propName)) {
                            continue;
                        }
                        if (entryRevProps == null) {
                            entryRevProps = new SVNProperties();
                        }
                        if (SVNRevisionProperty.DATE.equals(propName) && date != null) {
                            entryRevProps.put(propName, SVNDate.formatDate(date));
                        } else if (propVal != null) {
                            entryRevProps.put(propName, propVal);
                        }
                    }
                }
            }
        }
       
        if (changedPaths == null) {
            changedPaths = new SVNHashMap();
        }
        if (entryRevProps == null) {
            entryRevProps = new SVNProperties();
        }
        SVNLogEntry entry = new SVNLogEntry(changedPaths, revision, entryRevProps, false);
        return entry;
    }
View Full Code Here

            }
           
            FSRevisionRoot baseRoot = null;
            if (basePath != null && baseRevision >= 0) {
                baseRoot = myFSFS.createRevisionRoot(baseRevision);
                SVNProperties props = myFSFS.getProperties(baseRoot.getRevisionNode(basePath));
                previousMergeInfoValue = props.getStringValue(SVNProperty.MERGE_INFO);
            }

            SVNProperties props = myFSFS.getProperties(root.getRevisionNode(changedPath));
            if (props != null) {
                mergeInfoValue = props.getStringValue(SVNProperty.MERGE_INFO);
            }
 
            if (mergeInfoValue == null && previousMergeInfoValue == null) {
                continue;
            }
View Full Code Here

                    "ASSERTION FAILURE in FSFileRevisionsFinder: mainLinePathRevisions is empty");
            SVNErrorManager.error(err, SVNLogType.FSFS);
        }

        SendBaton sb = new SendBaton();
        sb.myLastProps = new SVNProperties();
        int mainLinePos = mainLinePathRevisions.size() - 1;
        int mergedPos = mergedPathRevisions.size() - 1;
        int i = 0;
        while (mainLinePos >= 0 && mergedPos >= 0) {
            SVNLocationEntry mainPathRev = (SVNLocationEntry) mainLinePathRevisions.get(mainLinePos);
View Full Code Here

        return i;
    }
   
    private void sendPathRevision(SVNLocationEntry pathRevision, SendBaton sendBaton,
            ISVNFileRevisionHandler handler) throws SVNException {
        SVNProperties revProps = myFSFS.getRevisionProperties(pathRevision.getRevision());
        FSRevisionRoot root = myFSFS.createRevisionRoot(pathRevision.getRevision());
        FSRevisionNode fileNode = root.getRevisionNode(pathRevision.getPath());
        SVNProperties props = fileNode.getProperties(myFSFS);
        SVNProperties propDiffs = FSRepositoryUtil.getPropsDiffs(sendBaton.myLastProps, props);
        boolean contentsChanged = false;
        if (sendBaton.myLastRoot != null) {
            contentsChanged = FSRepositoryUtil.areFileContentsChanged(sendBaton.myLastRoot,
                    sendBaton.myLastPath, root, pathRevision.getPath());
        } else {
View Full Code Here

TOP

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

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.