Package org.tmatesoft.svn.core.io

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


        FSRevisionRoot root = null;
        while (count < revisions.length) {
            long[] appearedRevision = new long[1];
            root = myFSFS.createRevisionRoot(revision);
            SVNLocationEntry previousLocation = root.getPreviousLocation(path, appearedRevision);
            if (previousLocation == null) {
                break;
            }
            String previousPath = previousLocation.getPath();
            long previousRevision = previousLocation.getRevision();
            while ((count < revisions.length) && (locationRevs[count] >= appearedRevision[0])) {
                locationEntries.add(new SVNLocationEntry(locationRevs[count], path));
                ++count;
            }

            while ((count < revisions.length) && locationRevs[count] > previousRevision) {
                ++count;
            }
           
            path = previousPath;
            revision = previousRevision;
        }
       
        if (root != null && revision != root.getRevision()) {
            root = myFSFS.createRevisionRoot(revision);
        }
        FSRevisionNode curNode = root.getRevisionNode(path);

        while (count < revisions.length) {
            root = myFSFS.createRevisionRoot(locationRevs[count]);
            if (root.checkNodeKind(path) == SVNNodeKind.NONE) {
                break;
            }
            FSRevisionNode currentNode = root.getRevisionNode(path);
            if (!curNode.getId().isRelated(currentNode.getId())) {
                break;
            }
            locationEntries.add(new SVNLocationEntry(locationRevs[count], path));
            ++count;
        }
       
        for (count = 0; count < locationEntries.size(); count++) {
            if (handler != null) {
View Full Code Here


        while (currentRevision >= endRevision) {
            long segmentStartRevision = endRevision;
            long segmentEndRevision = currentRevision;
            String segmentPath = currentPath;
            FSRevisionRoot root = myFSFS.createRevisionRoot(currentRevision);
            SVNLocationEntry previousLocation = root.getPreviousLocation(currentPath, appearedRevision);
            if (previousLocation == null) {
                segmentStartRevision = root.getNodeOriginRevision(currentPath);
                if (segmentStartRevision < endRevision) {
                    segmentStartRevision = endRevision;
                }
                currentRevision = SVNRepository.INVALID_REVISION;
            } else {
                segmentStartRevision = appearedRevision[0];
                currentPath = previousLocation.getPath();
                currentRevision = previousLocation.getRevision();
            }
           
            count += maybeCropAndSendSegment(segmentStartRevision, segmentEndRevision, startRevision, endRevision,
                    segmentPath, handler);
        
View Full Code Here

    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

                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

        }
        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

        sb.myLastProps = new SVNProperties();
        int mainLinePos = mainLinePathRevisions.size() - 1;
        int mergedPos = mergedPathRevisions.size() - 1;
        int i = 0;
        while (mainLinePos >= 0 && mergedPos >= 0) {
            SVNLocationEntry mainPathRev = (SVNLocationEntry) mainLinePathRevisions.get(mainLinePos);
            SVNLocationEntry mergedPathRev = (SVNLocationEntry) mergedPathRevisions.get(mergedPos);
            if (mainPathRev.getRevision() <= mergedPathRev.getRevision()) {
                sendPathRevision(mainPathRev, sb, handler);
                mainLinePos--;
            } else {
                sendPathRevision(mergedPathRev, sb, handler);
                mergedPos--;
            }
            i++;
        }
       
        for (; mainLinePos >= 0; mainLinePos--) {
            SVNLocationEntry mainPathRev = (SVNLocationEntry) mainLinePathRevisions.get(mainLinePos);
            sendPathRevision(mainPathRev, sb, handler);
            i++;
        }
       
        return i;
View Full Code Here

        LinkedList oldPathRevisions = mainLinePathRevisions;
        LinkedList newPathRevisions = null;
        do {
            newPathRevisions = new LinkedList();
            for (Iterator oldPathRevsIter = oldPathRevisions.iterator(); oldPathRevsIter.hasNext();) {
                SVNLocationEntry oldPathRevision = (SVNLocationEntry) oldPathRevsIter.next();
                Map mergedMergeInfo = oldPathRevision.getMergedMergeInfo();
                if (mergedMergeInfo == null) {
                    continue;
                }
                for (Iterator mergeInfoIter = mergedMergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) {
                    String path = (String) mergeInfoIter.next();
                    SVNMergeRangeList rangeList = (SVNMergeRangeList) mergedMergeInfo.get(path);
                    SVNMergeRange[] ranges = rangeList.getRanges();
                    for (int j = 0; j < ranges.length; j++) {
                        SVNMergeRange range = ranges[j];
                        FSRevisionRoot root = myFSFS.createRevisionRoot(range.getEndRevision());
                        SVNNodeKind kind = root.checkNodeKind(path);
                        if (kind != SVNNodeKind.FILE) {
                            continue;
                        }
                       
                        newPathRevisions = findInterestingRevisions(newPathRevisions, path,
                                range.getStartRevision(), range.getEndRevision(), true, true, duplicatePathRevs);
                    }
                }
            }
            mergedPathRevisions.addAll(newPathRevisions);
            oldPathRevisions = newPathRevisions;
        } while (!newPathRevisions.isEmpty());
       
        Collections.sort(mergedPathRevisions, new Comparator() {
            public int compare(Object arg0, Object arg1) {
                SVNLocationEntry pathRevision1 = (SVNLocationEntry) arg0;
                SVNLocationEntry pathRevision2 = (SVNLocationEntry) arg1;
                if (pathRevision1.getRevision() == pathRevision2.getRevision()) {
                    return 0;
                }
                return pathRevision1.getRevision() < pathRevision2.getRevision() ? 1 : -1;
            }
        });
        return mergedPathRevisions;
    }
View Full Code Here

           
            if (includeMergedRevisions && duplicatePathRevs.containsKey(histPath + ":" + histRev)) {
                break;
            }
           
            SVNLocationEntry pathRev = null;
            Map mergedMergeInfo = null;
            if (includeMergedRevisions) {
                mergedMergeInfo = getMergedMergeInfo(histPath, histRev);
                pathRev = new SVNLocationEntry(histRev, histPath, markAsMerged, mergedMergeInfo);
                duplicatePathRevs.put(histPath + ":" + histRev, pathRev);
            } else {
                pathRev = new SVNLocationEntry(histRev, histPath, markAsMerged, null);
            }
             
            pathRevisions.addLast(pathRev);

            if (histRev <= startRevision) {
View Full Code Here

        } else {
            if (related) {
                getEditor().openFile(editPath, sourceRevision);
                diffFiles(sourceRevision, sourcePath, targetPath, editPath, pathInfo != null ? pathInfo.getLockToken() : null);
            } else {
                SVNLocationEntry copyFromFile = addFileSmartly(editPath, targetPath);
                String copyFromPath = copyFromFile.getPath();
                long copyFromRevision = copyFromFile.getRevision();
                if (copyFromPath == null) {
                    diffFiles(sourceRevision, sourcePath, targetPath, editPath,
                            pathInfo != null ? pathInfo.getLockToken() : null);
                } else {
                    diffFiles(copyFromRevision, copyFromPath, targetPath, editPath,
View Full Code Here

                    copyFromRevision = closestCopyFromNode.getCopyFromRevision();
                }
            }
        }
        myEditor.addFile(editPath, copyFromPath, copyFromRevision);
        return new SVNLocationEntry(copyFromRevision, copyFromPath);
    }
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.