Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNMergeRangeList$RangeComparator2


        File targetWCPath = adminArea.getRoot();
        boolean isRollBack = revision1 > revision2;

        MergePath item = new MergePath(targetWCPath);
        SVNMergeRange itemRange = new SVNMergeRange(revision1, revision2, true);
        item.myRemainingRanges = new SVNMergeRangeList(itemRange);
        myChildrenWithMergeInfo.add(item);

        driveMergeReportEditor(targetWCPath, url1, revision1, url2, revision2, null, isRollBack,
                depth, adminArea, getMergeCallback(adminArea), null);
       
View Full Code Here


           
            SVNEntry childEntry = myWCAccess.getVersionedEntry(child.myPath, false);
            String childMergeSourcePath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(mergeInfoPath,
                    childReposPath));
           
            SVNMergeRangeList childMergeRangeList = filterNaturalHistoryFromMergeInfo(childMergeSourcePath,
                    child.myImplicitMergeInfo, range);
            if (childMergeRangeList.isEmpty()) {
                continue;
            }
            if (i == 0) {
                recordSkips(mergeInfoPath, targetEntry, isRollBack);
            }
            calculateMergeInheritance(childMergeRangeList, childEntry, i == 0, child.myHasMissingChildren, depth);
            if (child.myIsIndirectMergeInfo) {
                SVNPropertiesManager.recordWCMergeInfo(child.myPath, child.myPreMergeMergeInfo,
                        myWCAccess);
            }
            if (myImplicitSrcGap != null) {
                if (isRollBack) {
                    childMergeRangeList.reverse();
                }
                childMergeRangeList = childMergeRangeList.diff(myImplicitSrcGap, false);
                if (isRollBack) {
                    childMergeRangeList.reverse();
                }
            }
            Map childMerges = new TreeMap();
            childMerges.put(child.myPath, childMergeRangeList);
            updateWCMergeInfo(child.myPath, childMergeSourcePath, childEntry, childMerges, isRollBack);
View Full Code Here

                    String relativeAddedPath = SVNPathUtil.getRelativePath(commonAncestorPath, addedPathStr);
                    if (relativeAddedPath.startsWith("/")) {
                        relativeAddedPath = relativeAddedPath.substring(1);
                    }
                   
                    SVNMergeRangeList rangeList = new SVNMergeRangeList(rng);
                    mergeMergeInfo.put(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(mergeInfoPath,
                            relativeAddedPath)), rangeList);
                    boolean[] inherited = { false };
                    Map addedPathMergeInfo = getWCMergeInfo(addedPath, entry, null,
                            SVNMergeInfoInheritance.EXPLICIT, false, inherited);
View Full Code Here

                mergeInfo = mergeInfoArr[0];
               
                if (youngerMergeInfo != null) {
                    for (Iterator youngerMergeInfoIter = youngerMergeInfo.keySet().iterator(); youngerMergeInfoIter.hasNext();) {
                        String sourcePath = (String) youngerMergeInfoIter.next();
                        SVNMergeRangeList rangeList = (SVNMergeRangeList) youngerMergeInfo.get(sourcePath);
                        SVNMergeRange ranges[] = rangeList.getRanges();
                        LinkedList adjustedRanges = new LinkedList();
                        SVNURL mergeSourceURL = mergeSourceRootURL.appendPath(sourcePath, false);
                        for (int i = 0; i < ranges.length; i++) {
                            SVNMergeRange range = ranges[i];
                            SVNRepositoryLocation[] locations = null;
                            try {
                                locations = getLocations(targetURL, null, myRepository2,
                                        SVNRevision.create(targetEntry.getRevision()),
                                        SVNRevision.create(range.getStartRevision() + 1), SVNRevision.UNDEFINED);
                                SVNURL startURL = locations[0].getURL();
                                if (!mergeSourceURL.equals(startURL)) {
                                    adjustedRanges.add(range);
                                }
                            } catch (SVNException svne) {
                                SVNErrorCode code = svne.getErrorMessage().getErrorCode();
                                if (code == SVNErrorCode.CLIENT_UNRELATED_RESOURCES ||
                                        code == SVNErrorCode.RA_DAV_PATH_NOT_FOUND ||
                                        code == SVNErrorCode.FS_NOT_FOUND ||
                                        code == SVNErrorCode.FS_NO_SUCH_REVISION) {
                                    adjustedRanges.add(range);
                                } else {
                                    throw svne;
                                }
                            }
                        }

                        if (!adjustedRanges.isEmpty()) {
                            if (filteredYoungerMergeInfo == null) {
                                filteredYoungerMergeInfo = new TreeMap();
                            }
                            SVNMergeRangeList adjustedRangeList = SVNMergeRangeList.fromCollection(adjustedRanges);
                            filteredYoungerMergeInfo.put(sourcePath, adjustedRangeList);
                        }
                    }
                }
               
View Full Code Here

   
    private Map splitMergeInfoOnRevision(Map[] mergeInfo, long revision) {
        Map youngerMergeInfo = null;
        for (Iterator mergeInfoIter = mergeInfo[0].keySet().iterator(); mergeInfoIter.hasNext();) {
            String mergeSourcePath = (String) mergeInfoIter.next();
            SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo[0].get(mergeSourcePath);
            SVNMergeRange[] ranges = rangeList.getRanges();
            for (int i = 0; i < ranges.length; i++) {
                SVNMergeRange range = ranges[i];
                if (range.getEndRevision() < revision) {
                    continue;
                }
View Full Code Here

        for (Iterator unmergedHistoryIter = unmergedHistory.keySet().iterator(); unmergedHistoryIter.hasNext();) {
            String catalogPath = (String) unmergedHistoryIter.next();
            Map historyAsMergeInfo = (Map) unmergedHistory.get(catalogPath);
            for (Iterator pathsIter = historyAsMergeInfo.keySet().iterator(); pathsIter.hasNext();) {
                String path = (String) pathsIter.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) historyAsMergeInfo.get(path);
                SVNMergeRange[] ranges = rangeList.getRanges();
                for (int i = 0; i < ranges.length; i++) {
                    SVNMergeRange mergeRange = ranges[i];
                    if (mergeRange.getStartRevision() >= mergeRange.getEndRevision()) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "range start >= end");
                        SVNErrorManager.error(err, SVNLogType.DEFAULT);
View Full Code Here

        SVNMergeRange range = new SVNMergeRange(rangeStartRev, rangeEndRev, true);
        mergeRanges.add(range);
      }
      }
     
      SVNMergeRangeList mergeRangesList = SVNMergeRangeList.fromCollection(mergeRanges);
      mergeRanges = mergeRangesList.getRangesAsList();
      if (mergeRanges.isEmpty()) {
        return mergeRanges;
      }
     
      long oldestRequestedRev = SVNRepository.INVALID_REVISION;
View Full Code Here

      long youngestCommonRevision = SVNRepository.INVALID_REVISION;
      String youngestCommonPath = null;
      for (Iterator historyIter = history1.entrySet().iterator(); historyIter.hasNext();) {
        Map.Entry historyEntry = (Map.Entry) historyIter.next();
        String path = (String) historyEntry.getKey();
        SVNMergeRangeList ranges1 = (SVNMergeRangeList) historyEntry.getValue();
        SVNMergeRangeList ranges2 = (SVNMergeRangeList) history2.get(path);
        if (ranges2 != null) {
          SVNMergeRangeList commonList = ranges2.intersect(ranges1, true);
          if (!commonList.isEmpty()) {
            SVNMergeRange commonRanges[] = commonList.getRanges();
            SVNMergeRange youngestCommonRange = commonRanges[commonRanges.length - 1];
            if (!SVNRevision.isValidRevisionNumber(youngestCommonRevision) ||
                youngestCommonRange.getEndRevision() > youngestCommonRevision) {
              youngestCommonRevision = youngestCommonRange.getEndRevision();
              youngestCommonPath = path;
View Full Code Here

                SVNMergeRange firstRange = originalRemainingRanges[0];
                if (firstRange.getEndRevision() == endRevision) {
                    SVNMergeRange[] remainingRanges = new SVNMergeRange[originalRemainingRanges.length - 1];
                    System.arraycopy(originalRemainingRanges, 1, remainingRanges, 0,
                            originalRemainingRanges.length - 1);
                    child.myRemainingRanges = new SVNMergeRangeList(remainingRanges);
                }
            }
        }
    }
View Full Code Here

        return SVNMergeRangeList.fromCollection(operativeRanges);
    }

    private SVNMergeRangeList filterNaturalHistoryFromMergeInfo(String srcPath, Map implicitMergeInfo,
            SVNMergeRange requestedRange) {
        SVNMergeRangeList requestedRangeList = new SVNMergeRangeList(requestedRange.dup());
        SVNMergeRangeList filteredRangeList = null;
        if (implicitMergeInfo != null && requestedRange.getStartRevision() < requestedRange.getEndRevision()) {
            SVNMergeRangeList impliedRangeList = (SVNMergeRangeList) implicitMergeInfo.get(srcPath);
            if (impliedRangeList != null) {
                filteredRangeList = requestedRangeList.diff(impliedRangeList, false);
            }
        }
        if (filteredRangeList == null) {
View Full Code Here

TOP

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

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.