protected void doDirectoryMerge(SVNURL url1, long revision1, SVNURL url2, long revision2,
SVNEntry parentEntry, SVNAdminArea adminArea, SVNDepth depth) throws SVNException {
File targetWCPath = adminArea.getRoot();
boolean isRollBack = revision1 > revision2;
SVNURL primaryURL = isRollBack ? url1 : url2;
boolean honorMergeInfo = isHonorMergeInfo();
boolean recordMergeInfo = isRecordMergeInfo();
boolean sameURLs = url1.equals(url2);
SVNMergeCallback mergeCallback = getMergeCallback(adminArea);
myChildrenWithMergeInfo = new LinkedList();
if (!(myAreSourcesAncestral && myIsSameRepository)) {
if (myAreSourcesAncestral) {
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, mergeCallback, null);
return;
}
SVNRepository repository = isRollBack ? myRepository1 : myRepository2;
SVNURL sourceRootURL = repository.getRepositoryRoot(true);
String mergeInfoPath = getPathRelativeToRoot(null, primaryURL, sourceRootURL, null, null);
myChildrenWithMergeInfo = getMergeInfoPaths(myChildrenWithMergeInfo, mergeInfoPath, parentEntry,
sourceRootURL, revision1, revision2, honorMergeInfo, repository, depth);
MergePath targetMergePath = (MergePath) myChildrenWithMergeInfo.get(0);
myIsTargetMissingChild = targetMergePath.myHasMissingChildren;
boolean inheritable = !myIsTargetMissingChild && (depth == SVNDepth.INFINITY || depth == SVNDepth.IMMEDIATES);
populateRemainingRanges(myChildrenWithMergeInfo, sourceRootURL, url1, revision1, url2, revision2,
inheritable, honorMergeInfo, repository);
SVNMergeRange range = new SVNMergeRange(revision1, revision2, inheritable);
SVNRemoteDiffEditor editor = null;
SVNErrorMessage err = null;
if (honorMergeInfo && !myIsRecordOnly) {
long startRev = getMostInclusiveStartRevision(myChildrenWithMergeInfo, isRollBack);
if (SVNRevision.isValidRevisionNumber(startRev)) {
range.setStartRevision(startRev);
long endRev = getMostInclusiveEndRevision(myChildrenWithMergeInfo, isRollBack);
while (SVNRevision.isValidRevisionNumber(endRev)) {
SVNURL realURL1 = url1;
SVNURL realURL2 = url2;
SVNURL oldURL1 = null;
SVNURL oldURL2 = null;
long nextEndRev = SVNRepository.INVALID_REVISION;
sliceRemainingRanges(myChildrenWithMergeInfo, isRollBack, endRev);
myCurrentAncestorIndex = -1;
if (!sameURLs) {