Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNProperties


        props.put(name, value);
        return generatePropertyRequest(buffer, props);
    }

    public static StringBuffer generatePropertyRequest(StringBuffer buffer, String name, byte[] value) {
        SVNProperties props = new SVNProperties();
        props.put(name, value);
        return generatePropertyRequest(buffer, props);
    }
View Full Code Here


        }
    }

    public void openRevision(Map headers) throws SVNException {
        RevisionBaton revisionBaton = new RevisionBaton();
        revisionBaton.myProperties = new SVNProperties();
        revisionBaton.myOriginalRevision = getLongFromHeaders(SVNAdminHelper.DUMPFILE_REVISION_NUMBER, headers);
        if (myIsDoRenumberRevisions) {
            revisionBaton.myActualRevision = revisionBaton.myOriginalRevision - myDroppedRevisionsCount;
        } else {
            revisionBaton.myActualRevision = revisionBaton.myOriginalRevision;
View Full Code Here

    private void outputRevision(RevisionBaton revisionBaton) throws SVNException {
        revisionBaton.myHasWritingBegun = true;
        if (!myIsPreserveRevisionProps && !revisionBaton.myHasNodes && revisionBaton.myHadDroppedNodes &&
                !myIsDropEmptyRevisions) {
            SVNProperties oldProps = revisionBaton.myProperties;
            revisionBaton.myHasProps = true;
            revisionBaton.myProperties = new SVNProperties();
            revisionBaton.myProperties.put(SVNRevisionProperty.DATE,
                    oldProps.getSVNPropertyValue(SVNRevisionProperty.DATE));
            revisionBaton.myProperties.put(SVNRevisionProperty.LOG, "This is an empty revision for padding.");
        }
       
        ByteArrayOutputStream propsBuffer = new ByteArrayOutputStream();
        if (revisionBaton.myHasProps) {
View Full Code Here

    private SVNProperties myRevProps;
    private String myAuthor;
   
    public FSCommitEditor(String path, String logMessage, String userName, Map lockTokens, boolean keepLocks, FSTransactionInfo txn, FSFS owner, FSRepository repository) {
        this(path, lockTokens, keepLocks, txn, owner, repository, null);
        myRevProps = new SVNProperties();
        if (userName != null) {
            myAuthor = userName;
            myRevProps.put(SVNRevisionProperty.AUTHOR, userName);
        }
        if (logMessage != null) {
View Full Code Here

        myTxn = txn;
        isTxnOwner = txn == null;
        myRepository = repository;
        myFSFS = owner;
        myDirsStack = new Stack();
        myRevProps = revProps != null ? revProps : new SVNProperties();
    }
View Full Code Here

    }

    private void changeNodeProperties(String path, SVNProperties propNamesToValues) throws SVNException {
        FSParentPath parentPath = null;
        SVNNodeKind kind = null;
        SVNProperties properties = null;
        boolean done = false;
        boolean haveRealChanges = false;
        for (Iterator propNames = propNamesToValues.nameSet().iterator(); propNames.hasNext();) {
            String propName = (String)propNames.next();
            SVNPropertyValue propValue = propNamesToValues.getSVNPropertyValue(propName);

            FSRepositoryUtil.validateProperty(propName, propValue);

            if (!done) {
                parentPath = myTxnRoot.openPath(path, true, true);
                kind = parentPath.getRevNode().getType();

                if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) {
                    FSCommitter.allowLockedOperation(myFSFS, path, getAuthor(), myLockTokens, false, false);
                }

                myCommitter.makePathMutable(parentPath, path);
                properties = parentPath.getRevNode().getProperties(myFSFS);
               
                done = true;
            }

            if (properties.isEmpty() && propValue == null) {
                continue;
            }

            if (myFSFS.supportsMergeInfo() && propName.equals(SVNProperty.MERGE_INFO)) {
                long increment = 0;
                boolean hadMergeInfo = parentPath.getRevNode().hasMergeInfo();
                if (propValue != null && !hadMergeInfo) {
                    increment = 1;
                } else if (propValue == null && hadMergeInfo) {
                    increment = -1;
                }
                if (increment != 0) {
                    parentPath.getRevNode().setHasMergeInfo(propValue != null);
                    myCommitter.incrementMergeInfoUpTree(parentPath, increment);
                }
            }

            if (propValue == null) {
                properties.remove(propName);
            } else {
                properties.put(propName, propValue);
            }
           
            if (!haveRealChanges) {
                haveRealChanges = true;
            }
View Full Code Here

        return myDeltaConsumer;
    }

    public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException {
        String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path));
        SVNProperties props = getFilePropertiesStorage();
        if (!fullPath.equals(myCurrentFilePath)) {
            if (myCurrentFilePath != null) {
                changeNodeProperties(myCurrentFilePath, props);
                props.clear();
            }
            myCurrentFilePath = fullPath;
        }
        props.put(name, value);
    }
View Full Code Here

        props.put(name, value);
    }

    private SVNProperties getFilePropertiesStorage() {
        if (myCurrentFileProps == null) {
            myCurrentFileProps = new SVNProperties();
        }
        return myCurrentFileProps;
    }
View Full Code Here

        return myCurrentFileProps;
    }
   
    private void flushPendingProperties() throws SVNException {
        if (myCurrentFilePath != null) {
            SVNProperties props = getFilePropertiesStorage();
            changeNodeProperties(myCurrentFilePath, props);
            props.clear();
            myCurrentFilePath = null;
        }
    }
View Full Code Here

            }
           
            SVNErrorMessage[] errorMessage = new SVNErrorMessage[1];
            committedRev = myCommitter.commitTxn(true, true, errorMessage, null);
               
            SVNProperties revProps = myFSFS.getRevisionProperties(committedRev);
            String dateProp = revProps.getStringValue(SVNRevisionProperty.DATE);
            Date datestamp = dateProp != null ? SVNDate.parseDateString(dateProp) : null;
           
            SVNCommitInfo info = new SVNCommitInfo(committedRev, getAuthor(), datestamp, errorMessage[0]);
            releaseLocks();
            return info;
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.