Package org.tmatesoft.svn.core

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


        } finally {
            repos.closeSession();
        }
       
        Map availableMergeInfo = SVNMergeInfoUtil.removeMergeInfo(mergeInfo, sourceHistory);
        SVNMergeRangeList rangeList = new SVNMergeRangeList(new SVNMergeRange[0]);
        long youngestRev = SVNRepository.INVALID_REVISION;
        String logTarget = null;
        for (Iterator availableIter = availableMergeInfo.keySet().iterator(); availableIter.hasNext();) {
            String mergeSrc = (String) availableIter.next();
            SVNMergeRangeList availableRangeList = (SVNMergeRangeList) availableMergeInfo.get(mergeSrc);
            SVNMergeRange[] ranges = availableRangeList.getRanges();
            SVNMergeRange range = ranges[ranges.length - 1];
            if (!SVNRevision.isValidRevisionNumber(youngestRev) || range.getEndRevision() > youngestRev) {
                youngestRev = range.getEndRevision();
                logTarget = mergeSrc;
            }
View Full Code Here


        SVNEntry entry = myWCAccess.getEntry(file, false);
        if (entry == null) {
            return null;
        }

        SVNMergeRangeList remainingRangeList = null;
        if (isHonorMergeInfo()) {
            MergePath mergeTarget = new MergePath();
            Map targetMergeInfo;
            Map implicitMergeInfo;
            SVNRepository repository = getRepository(entry.getSVNURL());
View Full Code Here

    private void runMergeTask(SVNMergeTask mergeTask, long revision1, long revision2) throws SVNException {
        boolean rollback = revision1 > revision2;
        SVNURL mergeSource = mergeTask.getMergeSource();
        SVNURL mergeSource2 = mergeTask.getMergeSource2();
        File mergeTarget = mergeTask.getMergeTarget();
        SVNMergeRangeList remainingRanges = mergeTask.getRemainingRanges();
        boolean updateWCMergeInfo = mergeTask.isUpdateWCMergeInfo();
        SVNCopySource copySource = mergeTask.getTargetCopySource();
        if (copySource != null) {
            copy(copySource, mergeTarget, true);
        }
View Full Code Here

    protected SVNMergeTask readTask(BufferedReader reader) throws SVNException {
        SVNURL sourceURL = null;
        SVNURL sourceURL2 = null;
        File target = null;
        SVNMergeRangeList remainingRanges = null;
        boolean updateWCMergeInfo = true;
        SVNCopySource copySource = null;

        try {
            String sourceLine = reader.readLine();

            if (sourceLine == null) {
                return null;
            }
            sourceURL = SVNURL.parseURIEncoded(sourceLine);
            sourceURL2 = SVNURL.parseURIEncoded(reader.readLine());
            target = new File(reader.readLine());

            String mergeRangesRepresentation = reader.readLine();
            if (mergeRangesRepresentation != null && mergeRangesRepresentation.length() != 0) {
                SVNMergeRange[] ranges = SVNMergeInfoUtil.parseRevisionList(new StringBuffer(mergeRangesRepresentation), target.getPath());
                remainingRanges = new SVNMergeRangeList(ranges);
            }

            updateWCMergeInfo = Boolean.TRUE.toString().equals(reader.readLine());

            String path = reader.readLine();
View Full Code Here

   
    public static Map filterMergeInfoByRanges(Map mergeInfo, long youngestRev, long oldestRev) {
        Map filteredMergeInfo = new TreeMap();
        if (mergeInfo != null) {
            SVNMergeRange range = new SVNMergeRange(oldestRev, youngestRev, true);
            SVNMergeRangeList filterRangeList = new SVNMergeRangeList(range);
            for (Iterator mergeInfoIter = mergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) {
                String path = (String) mergeInfoIter.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(path);
                if (!rangeList.isEmpty()) {
                    SVNMergeRangeList newRangeList = filterRangeList.intersect(rangeList, false);
                    if (!newRangeList.isEmpty()) {
                        filteredMergeInfo.put(path, newRangeList);
                    }
                }
            }
        }
View Full Code Here

        long[] rangePoints = { SVNRepository.INVALID_REVISION, SVNRepository.INVALID_REVISION };
       
        if (mergeInfo != null) {
            for (Iterator mergeInfoIter = mergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) {
                String path = (String) mergeInfoIter.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(path);
                if (!rangeList.isEmpty()) {
                    SVNMergeRange[] ranges = rangeList.getRanges();
                    SVNMergeRange range = ranges[ranges.length - 1];
                    if (!SVNRevision.isValidRevisionNumber(rangePoints[0]) || range.getEndRevision() > rangePoints[0]) {
                        rangePoints[0] = range.getEndRevision();
                    }
                   
View Full Code Here

 
    public static Map adjustMergeInfoSourcePaths(Map mergeInfo, String walkPath, Map wcMergeInfo) {
        mergeInfo = mergeInfo == null ? new TreeMap() : mergeInfo;
    for (Iterator paths = wcMergeInfo.keySet().iterator(); paths.hasNext();) {
            String srcMergePath = (String) paths.next();
            SVNMergeRangeList rangeList = (SVNMergeRangeList) wcMergeInfo.get(srcMergePath);
            mergeInfo.put(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcMergePath, walkPath)), rangeList);
        }
    return mergeInfo;
  }
View Full Code Here

  public static boolean removeEmptyRangeLists(Map mergeInfo) {
    boolean removedSomeRanges = false;
    if (mergeInfo != null) {
      for (Iterator mergeInfoIter = mergeInfo.entrySet().iterator(); mergeInfoIter.hasNext();) {
        Map.Entry mergeInfoEntry = (Map.Entry) mergeInfoIter.next();
        SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfoEntry.getValue();
        if (rangeList.isEmpty()) {
          mergeInfoIter.remove();
          removedSomeRanges = true;
        }
      }
    }
View Full Code Here

        while (i < paths1.length && j < paths2.length) {
            String path1 = paths1[i];
            String path2 = paths2[j];
            int res = path1.compareTo(path2);
            if (res == 0) {
                SVNMergeRangeList rangeList1 = (SVNMergeRangeList) originalSrcsToRangeLists.get(path1);
                SVNMergeRangeList rangeList2 = (SVNMergeRangeList) changedSrcsToRangeLists.get(path2);
                rangeList1 = rangeList1.merge(rangeList2);
                originalSrcsToRangeLists.put(path1, rangeList1);
                i++;
                j++;
            } else if (res < 0) {
View Full Code Here

            return null;
        }
        target = target == null ? new TreeMap() : target;
        for (Iterator paths = srcsToRangeLists.keySet().iterator(); paths.hasNext();) {
            String path = (String) paths.next();
            SVNMergeRangeList rangeList = (SVNMergeRangeList) srcsToRangeLists.get(path);
            target.put(path, rangeList.dup());
        }
        return target;
    }
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.