Package org.tmatesoft.svn.core.io

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


            } else {
                rest = SVNPathUtil.append(parent.getName(), rest);
                parent = parent.getParentFile();
            }
        }
        return new SVNLocationEntry(rev, url);
    }
View Full Code Here


                    if (handler != null) {
                        long revision = SVNReader.getLong(values, 0);
                        String locationPath = SVNReader.getString(values, 1);
                        if (locationPath != null) {
                            locationPath = ensureAbsolutePath(locationPath);
                            handler.handleLocationEntry(new SVNLocationEntry(revision, locationPath));
                        }
                    }
                }
            }
View Full Code Here

            String revStr = attrs.getValue("rev");
            if (revStr != null) {
                String path = attrs.getValue("path");
                if (path != null && myLocationEntryHandler != null) {
                    path = "/" + path;
                    myLocationEntryHandler.handleLocationEntry(new SVNLocationEntry(Long.parseLong(revStr), path));
                    myCount++;
                }
            }
        }
    }
View Full Code Here

        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

    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

    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

        }

        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

    }

    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

            String path = paths[i];
            if (deletedMergeInfoCatalog.containsKey(path)) {
                continue;
            }
            long[] appearedRevision = new long[] {-1};
            SVNLocationEntry prevLocation = null;
            try {
                prevLocation = myFSFS.getPreviousLocation(path, revision, appearedRevision);               
            } catch (SVNException e) {
                if (e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) {
                    continue;
                }
                throw e;
            }
            String prevPath = null;
            long prevRevision = -1;
            if (!(prevLocation != null && prevLocation.getPath() != null && prevLocation.getRevision() >=0 && appearedRevision[0] == revision)) {
                prevPath = path;
                prevRevision = revision - 1;
            } else if (prevLocation != null) {
                prevPath = prevLocation.getPath();
                prevRevision = prevLocation.getRevision();
            }
           
            FSRevisionRoot prevRoot = myFSFS.createRevisionRoot(prevRevision);
            String[] queryPaths = new String[] {prevPath};
            Map catalog = null;
View Full Code Here

                    basePath = copyFromPath;
                    baseRevision = copyFromRev;
                }
            } else if (changeKind == FSPathChangeKind.FS_PATH_CHANGE_MODIFY) {
                long[] appearedRevision = new long[] {-1};
                SVNLocationEntry prevLocation = myFSFS.getPreviousLocation(changedPath, revision, appearedRevision);
                if (!(prevLocation != null &&
                        prevLocation.getPath() != null && prevLocation.getRevision() >= 0 && appearedRevision[0] == prevLocation.getRevision())) {
                    basePath = changedPath;
                    baseRevision = revision - 1;
                } else {
                    basePath = prevLocation.getPath();
                    baseRevision = prevLocation.getRevision();
                }
            } else {
                continue;
            }
            if (basePath != null && baseRevision >= 0) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.io.SVNLocationEntry

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.