Package org.tmatesoft.svn.core.internal.io.fs

Examples of org.tmatesoft.svn.core.internal.io.fs.FSRevisionNode


       
        if (kind != SVNNodeKind.DIR) {
            return;
        }
       
        FSRevisionNode node = root.getRevisionNode(path);
        Map entries = node.getDirEntries(fsfs);
        for (Iterator names = entries.keySet().iterator(); names.hasNext();) {
            String name = (String) names.next();
            FSEntry entry = (FSEntry) entries.get(name);
            getTree(fsfs, root, SVNPathUtil.concatToAbs(path, entry.getName()), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, handler);
        }
View Full Code Here


            }
            root = fsfs.createTransactionRoot(txn.getTxnId());
        }

        verifyPath(root, path);
        FSRevisionNode node = root.getRevisionNode(path);
        return node.getProperties(fsfs);
    }
View Full Code Here

            }

            String id = null;
            if (includeIDs) {
                FSRevisionRoot revRoot = fsfs.createRevisionRoot(revision);
                FSRevisionNode node = revRoot.getRevisionNode(history.getHistoryEntry().getPath());
                id = node.getId().toString();
            }

            if (handler != null) {
                handler.handlePath(new SVNAdminPath(history.getHistoryEntry().getPath(), id, revision));
            }
View Full Code Here

        } else if (printedHeader) {
            generator.displayHeader(ISVNGNUDiffGenerator.NO_DIFF, path, null, -1, os);
        }
       
        if (node.myHasPropModifications && node.myAction != SVNChangeEntry.TYPE_DELETED) {
            FSRevisionNode localNode = root.getRevisionNode(path);
            Map props = localNode.getProperties(root.getOwner());
            Map baseProps = null;
            if (node.myAction != SVNChangeEntry.TYPE_ADDED) {
                FSRevisionNode baseNode = baseRoot.getRevisionNode(basePath);
                baseProps = baseNode.getProperties(baseRoot.getOwner());
            }
            Map propsDiff = FSRepositoryUtil.getPropsDiffs(baseProps, props);
            if (propsDiff.size() > 0) {
                String displayPath = path.startsWith("/") ? path.substring(1) : path;
                generator.displayPropDiff(displayPath, baseProps, propsDiff, os);
View Full Code Here

    }

    private DiffItem prepareTmpFile(FSRoot root, String path, ISVNDiffGenerator generator) throws SVNException {
        String mimeType = null;
        if (root != null) {
            FSRevisionNode node = root.getRevisionNode(path);
            Map nodeProps = node.getProperties(root.getOwner());
            mimeType = (String) nodeProps.get(SVNProperty.MIME_TYPE);
            if (SVNProperty.isBinaryMimeType(mimeType) && !generator.isForcedBinaryDiff()) {
                return new DiffItem(mimeType, null);
            }
        }
View Full Code Here

            }
           
            long contentLength = 0;
            String propContents = null;
            if (mustDumpProps) {
                FSRevisionNode node = myRoot.getRevisionNode(canonicalPath);
                Map props = node.getProperties(myFSFS);
                Map oldProps = null;
                if (myUseDeltas && compareRoot != null) {
                    FSRevisionNode cmpNode = myRoot.getRevisionNode(comparePath);
                    oldProps = cmpNode.getProperties(myFSFS);
                    writeDumpData(SVNAdminHelper.DUMPFILE_PROP_DELTA + ": true\n");
                }

                ByteArrayOutputStream encodedProps = new ByteArrayOutputStream();
                SVNAdminHelper.writeProperties(props, oldProps, encodedProps);
                propContents = new String(encodedProps.toByteArray(), "UTF-8");
                contentLength += propContents.length();
                writeDumpData(SVNAdminHelper.DUMPFILE_PROP_CONTENT_LENGTH + ": " + propContents.length() + "\n");
            }
           
            File tmpFile = null;
            if (mustDumpText && kind == SVNNodeKind.FILE) {
                long txtLength = 0;
                FSRevisionNode node = myRoot.getRevisionNode(canonicalPath);

                if (myUseDeltas) {
                    tmpFile = SVNFileUtil.createTempFile("dump", ".tmp");
                    tmpFile.deleteOnExit();
                   
                    InputStream sourceStream = null;
                    InputStream targetStream = null;
                    OutputStream tmpStream = null;
                   
                    SVNDeltaCombiner deltaCombiner = getDeltaCombiner();
                    SVNDeltaGenerator deltaGenerator = getDeltaGenerator();
                    try {
                        if (compareRoot != null && comparePath != null) {
                            sourceStream = compareRoot.getFileStreamForPath(deltaCombiner, comparePath);
                        } else {
                            sourceStream = SVNFileUtil.DUMMY_IN;
                        }
                        targetStream = myRoot.getFileStreamForPath(deltaCombiner, canonicalPath);
                        tmpStream = SVNFileUtil.openFileForWriting(tmpFile);
                        final CountingStream countingStream = new CountingStream(tmpStream, 0)
                        ISVNDeltaConsumer consumer = new ISVNDeltaConsumer() {
                            private boolean isHeaderWritten = false;
                           
                            public OutputStream textDeltaChunk(String path, SVNDiffWindow diffWindow) throws SVNException {
                                try {
                                    if (diffWindow != null) {
                                        diffWindow.writeTo(countingStream, !isHeaderWritten, false);
                                    } else {
                                        SVNDiffWindow.EMPTY.writeTo(countingStream, !isHeaderWritten, false);
                                    }
                                } catch (IOException ioe) {
                                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage());
                                    SVNErrorManager.error(err, ioe);
                                }

                                isHeaderWritten = true;
                                return SVNFileUtil.DUMMY_OUT;
                            }

                            public void applyTextDelta(String path, String baseChecksum) throws SVNException {
                            }
                           
                            public void textDeltaEnd(String path) throws SVNException {
                            }
                        };
                       
                        deltaGenerator.sendDelta(null, sourceStream, 0, targetStream, consumer, false);
                        txtLength = countingStream.getPosition();
                    } finally {
                        SVNFileUtil.closeFile(sourceStream);
                        SVNFileUtil.closeFile(targetStream);
                        SVNFileUtil.closeFile(tmpStream);
                    }
                    writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_DELTA + ": true\n");
                } else {
                    txtLength = node.getFileLength();
                }
               
                contentLength += txtLength;
                writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_CONTENT_LENGTH + ": " + txtLength + "\n");
                String checksum = node.getFileChecksum();
                if (checksum != null) {
                    writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_CONTENT_CHECKSUM + ": " + checksum + "\n");
                }
            }
           
View Full Code Here

        }
    }

    public void removeNodeProperties() throws SVNException {
        FSTransactionRoot txnRoot = myCurrentRevisionBaton.myTxnRoot;
        FSRevisionNode node = txnRoot.getRevisionNode(myCurrentNodeBaton.myPath);
        SVNProperties props = node.getProperties(myFSFS);
       
        for (Iterator propNames = props.nameSet().iterator(); propNames.hasNext();) {
            String propName = (String) propNames.next();
            myCurrentRevisionBaton.getCommitter().changeNodeProperty(myCurrentNodeBaton.myPath, propName, null);
        }
View Full Code Here

            SVNErrorManager.error(err, SVNLogType.FSFS);
        }
       
        FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(srcRevision);
        if (nodeBaton.myCopySourceChecksum != null) {
            FSRevisionNode revNode = copyRoot.getRevisionNode(nodeBaton.myCopyFromPath);
            String hexDigest = revNode.getFileChecksum();
            if (hexDigest != null && !hexDigest.equals(nodeBaton.myCopySourceChecksum)) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CHECKSUM_MISMATCH,
                        "Copy source checksum mismatch on copy from ''{0}''@{1}\n" +
                        " to ''{2}'' in rev based on r{3}:\n" +
                        "   expected:  {4}\n" +
View Full Code Here

            editor.closeDir();
            editor.closeEdit();
            return;
        }

        FSRevisionNode srcNode = srcRoot.getRevisionNode(srcFullPath);
        FSRevisionNode tgtNode = tgtRoot.getRevisionNode(tgtFullPath);
        int distance = srcNode.getId().compareTo(tgtNode.getId());
        if (distance == 0) {
            editor.closeEdit();
            return;
        } else if (srcEntry != null) {
            if (srcKind != tgtKind || distance == -1) {
View Full Code Here

            deltifyDirs(fsfs, editor, srcRoot, tgtRoot, null, tgtPath, editPath);
            editor.closeDir();
        } else {
            editor.addFile(editPath, null, -1);
            deltifyFiles(fsfs, editor, srcRoot, tgtRoot, null, tgtPath, editPath);
            FSRevisionNode tgtNode = tgtRoot.getRevisionNode(tgtPath);
            editor.closeFile(editPath, tgtNode.getFileChecksum());
        }
    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.internal.io.fs.FSRevisionNode

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.