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);