Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNMergeInfo


          }
      }
     
      Map targetMergeInfo = null;
      if (reposMergeInfo != null) {
        SVNMergeInfo mergeInfo = (SVNMergeInfo) reposMergeInfo.get(path);
        if (mergeInfo != null) {
          targetMergeInfo = mergeInfo.getMergeSourcesToMergeLists();
        }
      }
      return targetMergeInfo;
    }
View Full Code Here


        } else if (element == DAVElement.MERGE_INFO_INFO) {
            myCurrentInfo = cdata;
        } else if (element == DAVElement.MERGE_INFO_ITEM) {
            if (myPath != null && myCurrentInfo != null) {
                Map srcPathsToRangeLists = SVNMergeInfoUtil.parseMergeInfo(myCurrentInfo, null);
                myPathsToMergeInfos.put(myPath, new SVNMergeInfo(myPath, srcPathsToRangeLists));
            }
        }
    }
View Full Code Here

        Map mergeInfoAsHashes = getMergeInfoForPaths(root, paths, inherit, includeDescendants);
        Map mergeInfo = new TreeMap();
        for (Iterator mergeInfoIter = mergeInfoAsHashes.keySet().iterator(); mergeInfoIter.hasNext();) {
            String path = (String) mergeInfoIter.next();
            Map pathMergeInfo = (Map) mergeInfoAsHashes.get(path);
            mergeInfo.put(path, new SVNMergeInfo(path, pathMergeInfo));
        }
        return mergeInfo;
    }
View Full Code Here

                if (e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) {
                    continue;
                }
                throw e;
            }
            SVNMergeInfo prevMergeinfo = (SVNMergeInfo) catalog.get(prevPath);
            queryPaths = new String[] {path};
            catalog = getMergeInfoManager().getMergeInfo(queryPaths, root, SVNMergeInfoInheritance.INHERITED, false);
            SVNMergeInfo mergeInfo = (SVNMergeInfo) catalog.get(path);
           
            Map deleted = new SVNHashMap();
            Map added = new SVNHashMap();
           
            SVNMergeInfoUtil.diffMergeInfo(deleted, added,
                    prevMergeinfo != null ? prevMergeinfo.getMergeSourcesToMergeLists() : null, mergeInfo != null ? mergeInfo.getMergeSourcesToMergeLists() : null, false);
           
            result = SVNMergeInfoUtil.mergeMergeInfos(result, SVNMergeInfoUtil.mergeMergeInfos(deleted, added));           
        }
        for(Iterator ps = addedMergeInfoCatalog.keySet().iterator(); ps.hasNext();) {
            String changedPath = (String) ps.next();
View Full Code Here

            }
           
            if (previousMergeInfoValue != null && mergeInfoValue == null) {
              String[] queryPaths = new String[] { changedPath };
              Map tmpCatalog = getMergeInfoManager().getMergeInfo(queryPaths, root, SVNMergeInfoInheritance.INHERITED, false);
              SVNMergeInfo tmpMergeInfo = (SVNMergeInfo) tmpCatalog.get(changedPath);
              if (tmpMergeInfo != null) {
                  mergeInfoValue = SVNMergeInfoUtil.formatMergeInfoToString(tmpMergeInfo.getMergeSourcesToMergeLists(), null);
              }
            } else if (mergeInfoValue != null && previousMergeInfoValue == null && basePath != null &&
                    SVNRevision.isValidRevisionNumber(baseRevision)) {
                String[] queryPaths = new String[] { basePath };
                Map tmpCatalog = getMergeInfoManager().getMergeInfo(queryPaths, baseRoot, SVNMergeInfoInheritance.INHERITED, false);
                SVNMergeInfo tmpMergeInfo = (SVNMergeInfo) tmpCatalog.get(basePath);
                if (tmpMergeInfo != null) {
                    previousMergeInfoValue = SVNMergeInfoUtil.formatMergeInfoToString(tmpMergeInfo.getMergeSourcesToMergeLists(), null);
                }
            }
       
            if ((previousMergeInfoValue != null && mergeInfoValue == null) ||
                    (previousMergeInfoValue == null && mergeInfoValue != null) ||
View Full Code Here

    public Map getPathMergeInfo(String path, long revision) throws SVNException {
        SVNMergeInfoManager mergeInfoManager = new SVNMergeInfoManager();
        FSRevisionRoot root = myFSFS.createRevisionRoot(revision);
        Map tmpMergeInfo = mergeInfoManager.getMergeInfo(new String[] { path }, root,
                SVNMergeInfoInheritance.INHERITED, false);
        SVNMergeInfo mergeInfo = (SVNMergeInfo) tmpMergeInfo.get(path);
        if (mergeInfo != null) {
            return mergeInfo.getMergeSourcesToMergeLists();
        }
        return new TreeMap();
    }
View Full Code Here

                String path = SVNReader.getString(values, 0);
                path = path.startsWith("/") ? path.substring(1) : path;
                path = getRepositoryPath(path);
                String mergeInfoToParse = SVNReader.getString(values, 1);
                Map srcsToRangeLists = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(mergeInfoToParse), null);
                SVNMergeInfo mergeInfo = new SVNMergeInfo(path, srcsToRangeLists);
                pathsToMergeInfos.put(path, mergeInfo);
            }
            return pathsToMergeInfos;
        } catch (SVNException e) {
            closeSession();
View Full Code Here

                srcPath = "/" + srcPath;
            }
           
            Map targetHistoryAsMergeInfo = getMergeInfoFromSegments(segments);
           
            SVNMergeInfo sourceMergeInfoObject = (SVNMergeInfo) srcCatalog.get(srcPath);
           
            Map srcMergeInfo = sourceMergeInfoObject != null ? sourceMergeInfoObject.getMergeSourcesToMergeLists() : null;
            if (srcMergeInfo != null) {
                srcCatalog.remove(srcPath);
                Map explicitSrcTgtHistoryIntersection = SVNMergeInfoUtil.intersectMergeInfo(srcMergeInfo, targetHistoryAsMergeInfo);
                if (!explicitSrcTgtHistoryIntersection.isEmpty()) {
                    neverSynched[0] = false;
                    long[] endPoints = SVNMergeInfoUtil.getRangeEndPoints(explicitSrcTgtHistoryIntersection);
                    long youngRev = endPoints[0];

                    if (!SVNRevision.isValidRevisionNumber(youngestMergedRev[0]) || (youngRev > youngestMergedRev[0])) {
                        youngestMergedRev[0] = youngRev;
                    }
                }
            } else {
                SVNNodeKind kind = repos.checkPath(srcPath, srcRev);
                if (kind == SVNNodeKind.NONE) {
                    continue;
                }
               
                Map subTreeCatalog = repos.getMergeInfo(new String[] { srcPath }, srcRev, SVNMergeInfoInheritance.INHERITED, false);
                if (subTreeCatalog != null) {
                    SVNMergeInfo sourceMergeInfo = (SVNMergeInfo) subTreeCatalog.get(srcPath);
                    srcMergeInfo = sourceMergeInfo != null ? sourceMergeInfo.getMergeSourcesToMergeLists() : null;
                }
                if (srcMergeInfo == null) {
                    srcMergeInfo = new TreeMap();
                }
            }
           
            segments = repos.getLocationSegments(srcPath, srcRev, srcRev, SVNRepository.INVALID_REVISION);
            Map srcHistoryAsMergeInfo = getMergeInfoFromSegments(segments);
            srcMergeInfo = SVNMergeInfoUtil.mergeMergeInfos(srcMergeInfo, srcHistoryAsMergeInfo);
            Map commonMergeInfo = SVNMergeInfoUtil.intersectMergeInfo(srcMergeInfo, targetHistoryAsMergeInfo);
            Map filteredMergeInfo = SVNMergeInfoUtil.removeMergeInfo(commonMergeInfo, targetHistoryAsMergeInfo);
            newCatalog.put(srcPath, filteredMergeInfo);
        }
       
        if (!srcCatalog.isEmpty()) {
            for (Iterator srcCatalogIter = srcCatalog.keySet().iterator(); srcCatalogIter.hasNext();) {
                String srcPath = (String) srcCatalogIter.next();
                SVNMergeInfo sourceMergeInfoObject = (SVNMergeInfo) srcCatalog.get(srcPath);
                Map srcMergeInfo = sourceMergeInfoObject.getMergeSourcesToMergeLists();
                String targetPath = srcPath.substring(sourceReposPath.length());
                if (targetPath.startsWith("/")) {
                    targetPath = targetPath.substring(1);
                }
                targetPath = SVNPathUtil.append(targetReposPath, targetPath);
View Full Code Here

        Map mergeInfoAsHashes = getMergeInfoForPaths(root, paths, inherit, includeDescendants);
        Map mergeInfo = new TreeMap();
        for (Iterator mergeInfoIter = mergeInfoAsHashes.keySet().iterator(); mergeInfoIter.hasNext();) {
            String path = (String) mergeInfoIter.next();
            Map pathMergeInfo = (Map) mergeInfoAsHashes.get(path);
            mergeInfo.put(path, new SVNMergeInfo(path, pathMergeInfo));
        }
        return mergeInfo;
    }
View Full Code Here

                srcPath = "/" + srcPath;
            }
           
            Map targetHistoryAsMergeInfo = getMergeInfoFromSegments(segments);
            targetHistoryAsMergeInfo = SVNMergeInfoUtil.filterMergeInfoByRanges(targetHistoryAsMergeInfo, srcRev, ycAncestorRev[0]);
            SVNMergeInfo sourceMergeInfoObject = (SVNMergeInfo) srcCatalog.get(srcPath);
           
            Map srcMergeInfo = sourceMergeInfoObject != null ? sourceMergeInfoObject.getMergeSourcesToMergeLists() : null;
            if (srcMergeInfo != null) {
                srcCatalog.remove(srcPath);
                Map explicitSrcTgtHistoryIntersection = SVNMergeInfoUtil.intersectMergeInfo(srcMergeInfo, targetHistoryAsMergeInfo);
                if (!explicitSrcTgtHistoryIntersection.isEmpty()) {
                    neverSynched[0] = false;
                    long[] endPoints = SVNMergeInfoUtil.getRangeEndPoints(explicitSrcTgtHistoryIntersection);
                    long youngRev = endPoints[0];

                    if (!SVNRevision.isValidRevisionNumber(youngestMergedRev[0]) || (youngRev > youngestMergedRev[0])) {
                        youngestMergedRev[0] = youngRev;
                    }
                }
            } else {
                SVNNodeKind kind = repos.checkPath(srcPath, srcRev);
                if (kind == SVNNodeKind.NONE) {
                    continue;
                }
               
                Map subTreeCatalog = repos.getMergeInfo(new String[] { srcPath }, srcRev, SVNMergeInfoInheritance.INHERITED, false);
                if (subTreeCatalog != null) {
                    SVNMergeInfo sourceMergeInfo = (SVNMergeInfo) subTreeCatalog.get(srcPath);
                    srcMergeInfo = sourceMergeInfo != null ? sourceMergeInfo.getMergeSourcesToMergeLists() : null;
                }
                if (srcMergeInfo == null) {
                    srcMergeInfo = new TreeMap();
                }
            }
           
            segments = repos.getLocationSegments(srcPath, srcRev, srcRev, SVNRepository.INVALID_REVISION);
            Map srcHistoryAsMergeInfo = getMergeInfoFromSegments(segments);
            srcMergeInfo = SVNMergeInfoUtil.mergeMergeInfos(srcMergeInfo, srcHistoryAsMergeInfo);
            Map commonMergeInfo = SVNMergeInfoUtil.intersectMergeInfo(srcMergeInfo, targetHistoryAsMergeInfo);
            Map filteredMergeInfo = SVNMergeInfoUtil.removeMergeInfo(commonMergeInfo, targetHistoryAsMergeInfo);
            newCatalog.put(srcPath, filteredMergeInfo);
        }
       
        if (!srcCatalog.isEmpty()) {
            for (Iterator srcCatalogIter = srcCatalog.keySet().iterator(); srcCatalogIter.hasNext();) {
                String srcPath = (String) srcCatalogIter.next();
                SVNMergeInfo sourceMergeInfoObject = (SVNMergeInfo) srcCatalog.get(srcPath);
                Map srcMergeInfo = sourceMergeInfoObject.getMergeSourcesToMergeLists();
                String targetPath = srcPath.substring(sourceReposPath.length());
                if (targetPath.startsWith("/")) {
                    targetPath = targetPath.substring(1);
                }
                targetPath = SVNPathUtil.append(targetReposPath, targetPath);
View Full Code Here

TOP

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

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.