Examples of FSRevisionNode


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

        FSFS fsfs = root.getOwner();
        Map entries = node.getDirEntries(fsfs);
        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);
                }
                Map kidMergeInfo = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(mergeInfoString), null);
                result.put(kidPath, kidMergeInfo);
            }
            if (kidNode.hasDescendantsWithMergeInfo()) {
                crawlDirectoryForMergeInfo(root, kidPath, kidNode, result);
            }
        }
        return result;
    }
View Full Code Here

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

    public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException {
    }

    public void closeDir() throws SVNException {
        if (myIsVerify) {
            FSRevisionNode node = myRoot.getRevisionNode(myCurrentDirInfo.myFullPath);
            Map entries = node.getDirEntries(myFSFS);
            for (Iterator entriesIter = entries.keySet().iterator(); entriesIter.hasNext();) {
                String entryName = (String) entriesIter.next();
                String entryPath = SVNPathUtil.append(myCurrentDirInfo.myFullPath, entryName);
                SVNNodeKind kind = myRoot.checkNodeKind(entryPath);
                FSRevisionNode entryNode = myRoot.getRevisionNode(entryPath);
                if (kind == SVNNodeKind.DIR) {
                    entryNode.getDirEntries(myFSFS);
                } else if (kind == SVNNodeKind.FILE) {
                    entryNode.getFileLength();
                } else {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND,
                            "Unexpected node kind {0} for ''{1}''", new Object[] { kind, entryPath });
                    SVNErrorManager.error(err, SVNLogType.FSFS);
                }
View Full Code Here

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

                        mustDumpProps = FSRepositoryUtil.arePropertiesChanged(compareRoot, comparePath, myRoot,
                                canonicalPath);
                        if (kind == SVNNodeKind.FILE) {
                            mustDumpText = FSRepositoryUtil.areFileContentsChanged(compareRoot, comparePath,
                                    myRoot, canonicalPath);
                            FSRevisionNode revNode = compareRoot.getRevisionNode(comparePath);
                            String checkSum = revNode.getFileMD5Checksum();
                            if (checkSum != null && checkSum.length() > 0) {
                                writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_COPY_SOURCE_MD5 + ": " + checkSum + "\n");
                            }
                           
                            checkSum = revNode.getFileSHA1Checksum();
                            if (checkSum != null && checkSum.length() > 0) {
                                writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_COPY_SOURCE_SHA1 + ": " + checkSum + "\n");
                            }
                        }
                    }
                    break;
            }
           
            if (!mustDumpProps && !mustDumpText) {
                writeDumpData("\n\n");
                return;
            }
           
            long contentLength = 0;
            String propContents = null;
            if (mustDumpProps) {
                FSRevisionNode node = myRoot.getRevisionNode(canonicalPath);
                SVNProperties props = node.getProperties(myFSFS);
                SVNProperties oldProps = null;
                if (myUseDeltas && compareRoot != null) {
                    FSRevisionNode cmpNode = compareRoot.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");
            }
            if (mustDumpText && kind == SVNNodeKind.FILE) {
                long txtLength = 0;
                FSRevisionNode node = myRoot.getRevisionNode(canonicalPath);

                if (myUseDeltas) {
                    tmpFile = SVNFileUtil.createTempFile("dump", ".tmp");
                   
                    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 CountingOutputStream countingStream = new CountingOutputStream(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, SVNLogType.FSFS);
                                }

                                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();
                       
                        if (compareRoot != null) {
                            FSRevisionNode revNode = compareRoot.getRevisionNode(comparePath);
                            String hexDigest = revNode.getFileMD5Checksum();
                            if (hexDigest != null && hexDigest.length() > 0) {
                                writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_DELTA_BASE_MD5 + ": " + hexDigest + "\n");
                            }
                           
                            hexDigest = revNode.getFileSHA1Checksum();
                            if (hexDigest == null) {
                                hexDigest = computeSHA1Checksum(compareRoot, comparePath);
                            }
                            if (hexDigest != null && hexDigest.length() > 0) {
                                writeDumpData(SVNAdminHelper.DUMPFILE_TEXT_DELTA_BASE_SHA1 + ": " + hexDigest + "\n");
View Full Code Here

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

        } 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);
            SVNProperties props = localNode.getProperties(root.getOwner());
            SVNProperties baseProps = null;
            if (node.myAction != SVNChangeEntry.TYPE_ADDED) {
                FSRevisionNode baseNode = baseRoot.getRevisionNode(basePath);
                baseProps = baseNode.getProperties(baseRoot.getOwner());
            }
            SVNProperties 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

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

    }

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

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

            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

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

            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.getFileMD5Checksum());
        }
    }
View Full Code Here

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

            deltifyDirs(fsfs, editor, srcRoot, tgtRoot, srcPath, tgtPath, editPath);
            editor.closeDir();
        } else {
            editor.openFile(editPath, baseRevision);
            deltifyFiles(fsfs, editor, srcRoot, tgtRoot, srcPath, tgtPath, editPath);
            FSRevisionNode tgtNode = tgtRoot.getRevisionNode(tgtPath);
            editor.closeFile(editPath, tgtNode.getFileMD5Checksum());
        }
    }
View Full Code Here

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

        }
       
        if (changed) {
            String srcHexDigest = null;
            if (srcPath != null) {
                FSRevisionNode srcNode = srcRoot.getRevisionNode(srcPath);
                srcHexDigest = srcNode.getFileMD5Checksum();
            }
            editor.applyTextDelta(editPath, srcHexDigest);
            editor.textDeltaChunk(editPath, SVNDiffWindow.EMPTY);
        }
    }
View Full Code Here

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

    }
   
    private static void deltifyDirs(FSFS fsfs, ISVNEditor editor, FSRevisionRoot srcRoot, FSRevisionRoot tgtRoot, String srcPath, String tgtPath, String editPath) throws SVNException {
        deltifyProperties(fsfs, editor, srcRoot, tgtRoot, srcPath, tgtPath, editPath, true);

        FSRevisionNode targetNode = tgtRoot.getRevisionNode(tgtPath);
        Map targetEntries = targetNode.getDirEntries(fsfs);
       
        Map sourceEntries = null;
        if (srcPath != null) {
            FSRevisionNode sourceNode = srcRoot.getRevisionNode(srcPath);
            sourceEntries = sourceNode.getDirEntries(fsfs);
        }

        for (Iterator tgtEntries = targetEntries.keySet().iterator(); tgtEntries.hasNext();) {
            String name = (String) tgtEntries.next();
            FSEntry tgtEntry = (FSEntry) targetEntries.get(name);
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.