Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNProperties


                }
                if (nestLevel == 0) {
                    count++;
                }
                long revision = 0;
                SVNProperties revisionProperties = null;
                SVNProperties logEntryProperties = new SVNProperties();
                boolean hasChildren = false;
                if (handler != null && !(limit > 0 && count > limit && nestLevel == 0)) {
                    revision = SVNReader.getLong(items, 1);
                    String author = SVNReader.getString(items, 2);
                    Date date = SVNReader.getDate(items, 3);
                    if (date == SVNDate.NULL) {
                        date = null;
                    }
                    String message = SVNReader.getString(items, 4);
                    hasChildren = SVNReader.getBoolean(items, 5);
                    boolean invalidRevision = SVNReader.getBoolean(items, 6);
                    revisionProperties = SVNReader.getProperties(items, 8, null);
                    if (invalidRevision) {
                        revision = SVNRepository.INVALID_REVISION;
                    }
                    if (wantCustomRevProps && (revisionProperties == null)) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "Server does not support custom revprops via log");
                        SVNErrorManager.error(err, SVNLogType.NETWORK);
                    }

                    if (revisionProperties != null) {
                        for (Iterator iterator = revisionProperties.nameSet().iterator(); iterator.hasNext();) {
                            String name = (String) iterator.next();
                            logEntryProperties.put(name, revisionProperties.getSVNPropertyValue(name));
                        }
                    }

                    if (revisionPropertyNames == null || revisionPropertyNames.length == 0) {
                        if (author != null) {
                            logEntryProperties.put(SVNRevisionProperty.AUTHOR, author);
                        }
                        if (date != null) {
                            logEntryProperties.put(SVNRevisionProperty.DATE, SVNDate.formatDate(date));
                        }
                        if (message != null) {
                            logEntryProperties.put(SVNRevisionProperty.LOG, message);
                        }
                    } else {
                        for (int i = 0; i < revisionPropertyNames.length; i++) {
                            String revPropName = revisionPropertyNames[i];
                            if (author != null && SVNRevisionProperty.AUTHOR.equals(revPropName)) {
                                logEntryProperties.put(SVNRevisionProperty.AUTHOR, author);
                            }
                            if (date != null && SVNRevisionProperty.DATE.equals(revPropName)) {
                                logEntryProperties.put(SVNRevisionProperty.DATE, SVNDate.formatDate(date));
                            }
                            if (message != null && SVNRevisionProperty.LOG.equals(revPropName)) {
                                logEntryProperties.put(SVNRevisionProperty.LOG, message);
                            }
                        }
                    }
                }
                if (handler != null && !(limit > 0 && count > limit && nestLevel == 0)) {
View Full Code Here


                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA,
                            "Expected ''revprops'', found ''{0}''", word);
                    SVNErrorManager.error(err, SVNLogType.NETWORK);
                }
               
                SVNProperties revProps = SVNReader.getProperties(items, 1, null);
                ISVNEditor editor = handler.handleStartRevision(rev, revProps);
                SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true);
                editReader.driveEditor();
                handler.handleEndRevision(rev, revProps, editor);
            }
View Full Code Here

    private SVNFileInfoExt getFileInfo(String path, long revision, SVNEditorAction action, SVNNodeKind kind) throws SVNException {
        if (myCurrentFile == null) {
            myCurrentFile = createFileInfo(path, action, kind);
            if (action == SVNEditorAction.ADD) {
                myCurrentFile.myBaseProperties = new SVNProperties();
                myCurrentFile.myBaseFile = SVNFileUtil.createUniqueFile(getTempDirectory(), ".diff", ".tmp", false);
            } else if (action == SVNEditorAction.MODIFY) {
                myCurrentFile.loadFromRepository(revision);
            }
        }
View Full Code Here

    }

    private static void deltifyProperties(FSFS fsfs, ISVNEditor editor, FSRevisionRoot srcRoot, FSRevisionRoot tgtRoot, String srcPath, String tgtPath, String editPath, boolean isDir) throws SVNException {
        FSRevisionNode targetNode = tgtRoot.getRevisionNode(tgtPath);

        SVNProperties sourceProps = null;
        if (srcPath != null) {
            FSRevisionNode sourceNode = srcRoot.getRevisionNode(srcPath);
            boolean propsChanged = !FSRepositoryUtil.arePropertiesEqual(sourceNode, targetNode);
            if (!propsChanged) {
                return;
            }
            sourceProps = sourceNode.getProperties(fsfs);
        } else {
            sourceProps = new SVNProperties();
        }

        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

        if (message == null) {
            return SVNCommitInfo.NULL;
        }
        message = SVNCommitUtil.validateCommitMessage(message);

        revprops = commitHandler.getRevisionProperties(message, commitables, revprops == null ? new SVNProperties() : revprops);
        if (revprops == null) {
            return SVNCommitInfo.NULL;
        }

        // now do real commit.
View Full Code Here

            SVNCommitItem[] commitables = (SVNCommitItem[]) commitItems.toArray(new SVNCommitItem[commitItems.size()]);
            message = commitHandler.getCommitMessage(message, commitables);
            if (message == null) {
                return SVNCommitInfo.NULL;
            }
            revprops = commitHandler.getRevisionProperties(message, commitables, revprops == null ? new SVNProperties() : revprops);
            if (revprops == null) {
                return SVNCommitInfo.NULL;
            }

            Map allCommitables = new TreeMap(SVNCommitUtil.FILE_COMPARATOR);
View Full Code Here

            File dst = new File(pair.myDst);
            SVNAdminArea dir = dstAccess.getAdminArea(dst.getParentFile());
            File tmpFile = SVNAdminUtil.createTmpFile(dir);
            String path = getPathRelativeToRoot(null, url, null, null, topSrcRepos);
            SVNProperties props = new SVNProperties();
            OutputStream os = null;
            long revision = -1;
            try {
                os = SVNFileUtil.openFileForWriting(tmpFile);
                revision = topSrcRepos.getFile(path, srcRevNum, props, new SVNCancellableOutputStream(os, this));
View Full Code Here

        String date = null;
        String txnName = null;
        long rev = 0;
        if (root != null) {
            FSFS fsfs = root.getOwner();
            SVNProperties props = null;
            if (root instanceof FSRevisionRoot) {
                FSRevisionRoot revisionRoot = (FSRevisionRoot) root;
                rev = revisionRoot.getRevision();
                props = fsfs.getRevisionProperties(rev);
            } else {
                FSTransactionRoot txnRoot = (FSTransactionRoot) root;
                txnName = txnRoot.getTxnID();
                props = fsfs.getTransactionProperties(txnName);
            }
            date = props.getStringValue(SVNRevisionProperty.DATE);
        }
       
        String dateString = null;
        if (date != null) {
            int tInd = date.indexOf('T');
View Full Code Here

        }
        return kind;
    }
   
    public SVNProperties getRevisionProperties(long revision, SVNProperties properties) throws SVNException {
        properties = properties == null ? new SVNProperties() : properties;
        try {
            openConnection();
            String path = getLocation().getPath();
            path = SVNEncodingUtil.uriEncode(path);
            DAVConnection connection = getConnection();
View Full Code Here

        }
        return properties;
    }
   
    public SVNPropertyValue getRevisionPropertyValue(long revision, String propertyName) throws SVNException {
        SVNProperties properties = getRevisionProperties(revision, null);
        return properties.getSVNPropertyValue(propertyName);
    }
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.