Examples of SVNLocationEntry


Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

    public SVNLocationEntry getHistoryEntry() {
        return myHistoryEntry;
    }

    public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException {
        SVNLocationEntry parentEntry = null;
        if (parPath.getParent() != null) {
            parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent());
        }

        SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath());
        if (parentEntry != null) {
            if (myEntry.getRevision() >= parentEntry.getRevision()) {
                return myEntry;
            }
            return parentEntry;
        }
        return myEntry;
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

    public static boolean checkAncestryOfPegPath(String fsPath, long pegRev, long futureRev, FSFS owner) throws SVNException {
        FSRevisionRoot root = owner.createRevisionRoot(futureRev);
        FSNodeHistory history = root.getNodeHistory(fsPath);//getNodeHistory(root, fsPath);
        fsPath = null;
        SVNLocationEntry currentHistory = null;
        while (true) {
            history = history.getPreviousHistory(true);
            if (history == null) {
                break;
            }
            currentHistory = new SVNLocationEntry(history.getHistoryEntry().getRevision(), history.getHistoryEntry().getPath());
            if (fsPath == null) {
                fsPath = currentHistory.getPath();
            }
            if (currentHistory.getRevision() <= pegRev) {
                break;
            }
        }

        if (fsPath == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error occurred while checking ancestry of peg path");
            SVNErrorManager.error(err, SVNLogType.FSFS);
        }
        return (history != null && (fsPath.equals(currentHistory.getPath())));
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        }

        FSRevisionRoot root = myFSFS.createRevisionRoot(revision);
        FSParentPath parentPath = root.openPath(path, true, true);
        FSRevisionNode revNode = parentPath.getRevNode();
        SVNLocationEntry commitEntry = new SVNLocationEntry(revNode.getCreatedRevision(),
                                                            revNode.getCreatedPath());

        FSNodeHistory prevHist = null;
        if (revision == commitEntry.getRevision()) {
            if (!reported) {
                prevHist = new FSNodeHistory(commitEntry, true,
                                             new SVNLocationEntry(SVNRepository.INVALID_REVISION, null),
                                             myFSFS);
                return prevHist;
            }
            FSID predId = revNode.getPredecessorId();
            if (predId == null) {
                return prevHist;
            }
            revNode = myFSFS.getRevisionNode(predId);
            commitEntry = new SVNLocationEntry(revNode.getCreatedRevision(), revNode.getCreatedPath());
        }

        SVNLocationEntry copyrootEntry = findYoungestCopyroot(myFSFS.getRepositoryRoot(),
                                                              parentPath);
        SVNLocationEntry srcEntry = new SVNLocationEntry(SVNRepository.INVALID_REVISION, null);
        long dstRev = SVNRepository.INVALID_REVISION;
        if (copyrootEntry.getRevision() > commitEntry.getRevision()) {
            FSRevisionRoot copyrootRoot = myFSFS.createRevisionRoot(copyrootEntry.getRevision());
            revNode = copyrootRoot.getRevisionNode(copyrootEntry.getPath());
            String copyDst = revNode.getCreatedPath();
            String reminder = null;
            if (path.equals(copyDst)) {
                reminder = "";
            } else {
                reminder = SVNPathUtil.getPathAsChild(copyDst, path);
            }
            if (reminder != null) {
                String copySrc = revNode.getCopyFromPath();
                srcEntry = new SVNLocationEntry(revNode.getCopyFromRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(copySrc, reminder)));
                dstRev = copyrootEntry.getRevision();
            }
        }
        if (srcEntry.getPath() != null && FSRepository.isValidRevision(srcEntry.getRevision())) {
            boolean retry = false;
            if ((dstRev == revision) && reported) {
                retry = true;
            }
            return new FSNodeHistory(new SVNLocationEntry(dstRev, path),
                                     retry ? false : true,
                                     new SVNLocationEntry(srcEntry.getRevision(), srcEntry.getPath()),
                                     myFSFS);
        }
        return new FSNodeHistory(commitEntry, true,
                                 new SVNLocationEntry(SVNRepository.INVALID_REVISION, null),
                                 myFSFS);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

    }

    public FSNodeHistory getPreviousHistory(boolean crossCopies) throws SVNException {
        if ("/".equals(myHistoryEntry.getPath())) {
            if (!myIsInteresting) {
                return new FSNodeHistory(new SVNLocationEntry(myHistoryEntry.getRevision(), "/"),
                                         true,
                                         new SVNLocationEntry(SVNRepository.INVALID_REVISION, null),
                                         myFSFS);
            } else if (myHistoryEntry.getRevision() > 0) {
                return new FSNodeHistory(new SVNLocationEntry(myHistoryEntry.getRevision() - 1, "/"),
                                         true,
                                         new SVNLocationEntry(SVNRepository.INVALID_REVISION, null),
                                         myFSFS);
            }
        } else {
            FSNodeHistory prevHist = this;
            while (true) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

    public FSNodeHistory getNodeHistory(String path) throws SVNException {
        SVNNodeKind kind = checkNodeKind(path);
        if (kind == SVNNodeKind.NONE) {
            SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS);
        }
        return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)),
                false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner());
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

                false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner());
    }

    public FSClosestCopy getClosestCopy(String path) throws SVNException {
        FSParentPath parentPath = openPath(path, true, true);
        SVNLocationEntry copyDstEntry = FSNodeHistory.findYoungestCopyroot(getOwner().getRepositoryRoot(),
                parentPath);
        if (copyDstEntry == null || copyDstEntry.getRevision() == 0) {
            return null;
        }

        FSRevisionRoot copyDstRoot = getOwner().createRevisionRoot(copyDstEntry.getRevision());
        if (copyDstRoot.checkNodeKind(path) == SVNNodeKind.NONE) {
            return null;
        }
        FSParentPath copyDstParentPath = copyDstRoot.openPath(path, true, true);
        FSRevisionNode copyDstNode = copyDstParentPath.getRevNode();
        if (!copyDstNode.getId().isRelated(parentPath.getRevNode().getId())) {
            return null;
        }

        long createdRev = copyDstNode.getCreatedRevision();
        if (createdRev == copyDstEntry.getRevision()) {
            if (copyDstNode.getPredecessorId() == null) {
                return null;
            }
        }
        return new FSClosestCopy(copyDstRoot, copyDstEntry.getPath());
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        }
        String previousPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(copyFromPath, remainder));
        if (appearedRevision != null && appearedRevision.length > 0) {
            appearedRevision[0] = copyTargetRoot.getRevision();
        }
        return new SVNLocationEntry(copyFromRevision, previousPath);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        while (true) {
            if (FSRepository.isValidRevision(lastRev)) {
                curRoot = fsfs.createRevisionRoot(lastRev);
            }
           
            SVNLocationEntry previousLocation = curRoot.getPreviousLocation(lastPath, null);
            if (previousLocation == null) {
                break;
            }
            lastPath = previousLocation.getPath();
            lastRev = previousLocation.getRevision();
        }
       
        node = curRoot.getRevisionNode(lastPath);
        FSID predID = node.getId();
        while (predID != null) {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        String copyFromURL;
        long copyFromRevision;
        SVNAdminArea srcDir = srcAccess.getAdminArea(src.getParentFile());
        if (srcEntry.isCopied()) {
            // get cf info - one of the parents has to keep that.
            SVNLocationEntry location = determineCopyFromInfo(src, srcAccess, srcEntry, dstEntry);
            copyFromURL = location.getPath();
            copyFromRevision = location.getRevision();
        } else {
            copyFromURL = srcEntry.getURL();
            copyFromRevision = srcEntry.getRevision();
        }
        // copy base file.
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        try {
            dir = open(tgtAccess, dst, true, false, -1);
            postCopyCleanup(dir);
            if (srcEntry.isCopied()) {
                SVNEntry dstEntry = dstAccess.getEntry(dst, false);
                SVNLocationEntry info = determineCopyFromInfo(src, srcAccess, srcEntry, dstEntry);
                copyFromURL = info.getPath();
                copyFromRevision = info.getRevision();

                Map attributes = new SVNHashMap();
                attributes.put(SVNProperty.URL, copyFromURL);
                dir.modifyEntry(dir.getThisDirName(), attributes, true, false);
            } else {
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.