Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNMergeRangeList


        Mergeinfo result = new Mergeinfo();
        for (Iterator iterator = mergeInfo.entrySet().iterator(); iterator.hasNext();) {
            Map.Entry entry = (Map.Entry) iterator.next();
            SVNURL mergeSrcURL = (SVNURL) entry.getKey();
            String url = mergeSrcURL.toString();
            SVNMergeRangeList rangeList = (SVNMergeRangeList) entry.getValue();
            SVNMergeRange[] ranges = rangeList.getRanges();
            for (int i = 0; i < ranges.length; i++) {
                SVNMergeRange range = ranges[i];
                result.addRevisionRange(url, createRevisionRange(range));
            }
        }
View Full Code Here


      SVNURL repositoryRoot = reposRoot[0];
      if (mergeInfo != null) {
        Map fullPathMergeInfo = new SVNHashMap();
            for (Iterator paths = mergeInfo.keySet().iterator(); paths.hasNext();) {
                String mergeSrcPath = (String) paths.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(mergeSrcPath);
                if (mergeSrcPath.startsWith("/")) {
                    mergeSrcPath = mergeSrcPath.substring(1);
                }
                SVNURL url = repositoryRoot.appendPath(mergeSrcPath, false);
                fullPathMergeInfo.put(url, rangeList);
View Full Code Here

      SVNURL repositoryRoot = reposRoot[0];
      if (mergeInfo != null) {
        Map fullPathMergeInfo = new SVNHashMap();
            for (Iterator paths = mergeInfo.keySet().iterator(); paths.hasNext();) {
                String mergeSrcPath = (String) paths.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(mergeSrcPath);
                if (mergeSrcPath.startsWith("/")) {
                    mergeSrcPath = mergeSrcPath.substring(1);
                }
                SVNURL nextURL = repositoryRoot.appendPath(mergeSrcPath, false);
                fullPathMergeInfo.put(nextURL, rangeList);
View Full Code Here

    private Map adjustMergeInfo(SVNPropertyValue initialValue) throws SVNException {
        Map finalMergeInfo = new TreeMap();
        Map mergeInfo = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(initialValue.getString()), null);
        for (Iterator mergeInfoIter = mergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) {
            String mergeSource = (String) mergeInfoIter.next();
            SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(mergeSource);
            if (skipPath(mergeSource)) {
                if (myIsSkipMissingMergeSources) {
                    continue;
                }

                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.INCOMPLETE_DATA,
                        "Missing merge source path ''{0}''; try with --skip-missing-merge-sources",
                        mergeSource);
                SVNErrorManager.error(err, SVNLogType.FSFS);
            }
           
            if (myIsDoRenumberRevisions) {
                SVNMergeRange[] ranges = rangeList.getRanges();
                for (int i = 0; i < rangeList.getSize(); i++) {
                    SVNMergeRange range = ranges[i];
                   
                    RevisionItem revItemStart = (RevisionItem) myRenumberHistory.get(new Long(range.getStartRevision()));
                    if (revItemStart == null || !SVNRevision.isValidRevisionNumber(revItemStart.myRevision)) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND,
View Full Code Here

   
    private Map appendToMergedFroms(Map mergeInfo, String pathComponent) {
        Map result = new TreeMap();
        for (Iterator pathsIter = mergeInfo.keySet().iterator(); pathsIter.hasNext();) {
            String path = (String) pathsIter.next();
            SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(path);
            result.put(SVNPathUtil.append(path, pathComponent), rangeList.dup());
        }
        return result;
    }
View Full Code Here

    private LinkedList combineMergeInfoPathLists(Map mergeInfo) {
        List rangeListPaths = new LinkedList();
        for (Iterator pathsIter = mergeInfo.keySet().iterator(); pathsIter.hasNext();) {
            String path = (String) pathsIter.next();
            SVNMergeRangeList changes = (SVNMergeRangeList) mergeInfo.get(path);
            RangeListPath rangeListPath = new RangeListPath();
            rangeListPath.myPath = path;
            rangeListPath.myRangeList = changes.dup();
            SVNMergeRange[] rangesArray = rangeListPath.myRangeList.getRanges();
            for (int i = 0; i < rangesArray.length; i++) {
                SVNMergeRange range = rangesArray[i];
                range.setStartRevision(range.getStartRevision() + 1);
            }
            rangeListPaths.add(rangeListPath);
        }
       
        LinkedList combinedList = new LinkedList();
        Comparator rangeListPathsComparator = new Comparator() {
            public int compare(Object arg1, Object arg2) {
                RangeListPath rangeListPath1 = (RangeListPath) arg1;
                RangeListPath rangeListPath2 = (RangeListPath) arg2;
                SVNMergeRange[] ranges1 = rangeListPath1.myRangeList.getRanges();
                SVNMergeRange[] ranges2 = rangeListPath2.myRangeList.getRanges();
                SVNMergeRange range1 = ranges1[0];
                SVNMergeRange range2 = ranges2[0];
                if (range1.getStartRevision() < range2.getStartRevision()) {
                    return -1;
                }
                if (range1.getStartRevision() > range2.getStartRevision()) {
                    return 1;
                }
                if (range1.getEndRevision() < range2.getEndRevision()) {
                    return -1;
                }
                if (range1.getEndRevision() > range2.getEndRevision()) {
                    return 1;
                }
                return 0;
            }
        };
       
        while (rangeListPaths.size() > 1) {
            Collections.sort(rangeListPaths, rangeListPathsComparator);
            RangeListPath rangeListPath = (RangeListPath) rangeListPaths.get(0);
            RangeListPath firstRLP = rangeListPath;
            long youngest = rangeListPath.myRangeList.getRanges()[0].getStartRevision();
            long nextYoungest = youngest;
            int numRevs = 1;
            for (; nextYoungest == youngest; numRevs++) {
                if (numRevs == rangeListPaths.size()) {
                    numRevs++;
                    break;
                }
                rangeListPath = (RangeListPath) rangeListPaths.get(numRevs);
                nextYoungest = rangeListPath.myRangeList.getRanges()[0].getStartRevision();
            }
            numRevs--;
            long youngestEnd = firstRLP.myRangeList.getRanges()[0].getEndRevision();
            long tail = nextYoungest - 1;
            if (nextYoungest == youngest || youngestEnd < nextYoungest) {
                tail = youngestEnd;
            }

            PathListRange pathListRange = new PathListRange();
            pathListRange.myRange = new SVNMergeRange(youngest, tail, false);
            List paths = new LinkedList();
            for (int i = 0; i < numRevs; i++) {
                RangeListPath rp = (RangeListPath) rangeListPaths.get(i);
                paths.add(rp.myPath);
            }
            pathListRange.myPaths = (String[]) paths.toArray(new String[paths.size()]);
       
            combinedList.add(pathListRange);
           
            for (int i = 0; i < numRevs; i++) {
                RangeListPath rp = (RangeListPath) rangeListPaths.get(i);
                SVNMergeRange range = rp.myRangeList.getRanges()[0];
                range.setStartRevision(tail + 1);
                if (range.getStartRevision() > range.getEndRevision()) {
                    if (rp.myRangeList.getSize() == 1) {
                        rangeListPaths.remove(0);
                        i--;
                        numRevs--;
                    } else {
                        SVNMergeRange[] ranges = new SVNMergeRange[rp.myRangeList.getSize() - 1];
                        System.arraycopy(rp.myRangeList.getRanges(), 1, ranges, 0, ranges.length);
                        rp.myRangeList = new SVNMergeRangeList(ranges);
                    }
                }
            }
        }
       
        if (!rangeListPaths.isEmpty()) {
            RangeListPath firstRangeListPath = (RangeListPath) rangeListPaths.get(0);
            while (!firstRangeListPath.myRangeList.isEmpty()) {
                PathListRange pathListRange = new PathListRange();
                pathListRange.myPaths = new String[] { firstRangeListPath.myPath };
                pathListRange.myRange = firstRangeListPath.myRangeList.getRanges()[0];
                SVNMergeRange[] ranges = new SVNMergeRange[firstRangeListPath.myRangeList.getSize() - 1];
                System.arraycopy(firstRangeListPath.myRangeList.getRanges(), 1, ranges, 0, ranges.length);
                firstRangeListPath.myRangeList = new SVNMergeRangeList(ranges);
                combinedList.add(pathListRange);
            }
        }
       
        return combinedList;
View Full Code Here

                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) {
View Full Code Here

                    continue;
                }
            }

            SVNURL[] mergeSources = new SVNURL[2];
            SVNMergeRangeList remainingRanges = getMergeDriver().calculateRemainingRanges(target, url, mergeSources);
            boolean mergeInfoConflicts = getMergeDriver().mergeInfoConflicts(remainingRanges, target);
            SVNCopyTask copyTask = getMergeCallback().getTargetCopySource(url, Math.max(myRevision1, myRevision2), myRevision1, myRevision2, targetURL, targetRevision);
            SVNCopySource copySource = copyTask == null ? null : copyTask.getCopySource();
            copySource = processCopySource(copySource, targetRevision);
            boolean deleteSource = copyTask != null && copyTask.isMove();
View Full Code Here

                    continue;
                }
            }

            SVNURL[] mergeSources = new SVNURL[2];
            SVNMergeRangeList remainingRanges = getMergeDriver().calculateRemainingRanges(target, url, mergeSources);
            boolean mergeInfoConflicts = getMergeDriver().mergeInfoConflicts(remainingRanges, target);
            SVNCopyTask copyTask = getMergeCallback().getTargetCopySource(url, Math.max(myRevision1, myRevision2), myRevision1, myRevision2, targetURL, targetRevision);
            SVNCopySource copySource = copyTask == null ? null : copyTask.getCopySource();
            copySource = processCopySource(copySource, targetRevision);
            boolean deleteSource = copyTask != null && copyTask.isMove();
View Full Code Here

        }
       
        Map srcHistory = getHistoryAsMergeInfo(realMergeSrcURL, null, realSrcPegRevision, SVNRepository.INVALID_REVISION,
                SVNRepository.INVALID_REVISION, null, null);
        Map mergeInfo = SVNMergeInfoUtil.intersectMergeInfo(targetMergeInfo, srcHistory);
        SVNMergeRangeList rangeList = new SVNMergeRangeList(new SVNMergeRange[0]);
        long youngestRev = SVNRepository.INVALID_REVISION;
        String logTarget = null;
        for (Iterator mergeInfoIter = mergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) {
            String mergeSrc = (String) mergeInfoIter.next();
            SVNMergeRangeList list = (SVNMergeRangeList) mergeInfo.get(mergeSrc);
            SVNMergeRange[] listRanges = list.getRanges();
            SVNMergeRange range = listRanges[listRanges.length - 1];
            if (!SVNRevision.isValidRevisionNumber(youngestRev) || range.getEndRevision() > youngestRev) {
                youngestRev = range.getEndRevision();
                logTarget = mergeSrc;
            }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNMergeRangeList

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.