targetWCPath = targetWCPath.getAbsoluteFile();
try {
SVNAdminArea adminArea = myWCAccess.probeOpen(targetWCPath, !dryRun, SVNWCAccess.INFINITE_DEPTH);
SVNEntry entry = myWCAccess.getVersionedEntry(targetWCPath, false);
SVNURL wcReposRoot = getReposRoot(targetWCPath, null, SVNRevision.WORKING, adminArea, myWCAccess);
long[] latestRev = new long[1];
latestRev[0] = SVNRepository.INVALID_REVISION;
repository1 = createRepository(url1, null, null, false);
SVNURL sourceReposRoot = repository1.getRepositoryRoot(true);
long rev1 = getRevisionNumber(revision1, latestRev, repository1, null);
repository2 = createRepository(url2, null, null, false);
long rev2 = getRevisionNumber(revision2, latestRev, repository2, null);
boolean sameRepos = sourceReposRoot.equals(wcReposRoot);
String youngestCommonPath = null;
long youngestCommonRevision = SVNRepository.INVALID_REVISION;
if (!ignoreAncestry) {
SVNLocationEntry youngestLocation = getYoungestCommonAncestor(null, url1, rev1, null, url2,
rev2);
youngestCommonPath = youngestLocation.getPath();
youngestCommonRevision = youngestLocation.getRevision();
}
boolean related = false;
boolean ancestral = false;
List mergeSources = null;
if (youngestCommonPath != null && SVNRevision.isValidRevisionNumber(youngestCommonRevision)) {
SVNRevisionRange range = null;
List ranges = new LinkedList();
related = true;
SVNURL youngestCommonURL = sourceReposRoot.appendPath(youngestCommonPath, false);
if (youngestCommonURL.equals(url2) && youngestCommonRevision == rev2) {
ancestral = true;
SVNRevision sRev = SVNRevision.create(rev1);
SVNRevision eRev = SVNRevision.create(youngestCommonRevision);
range = new SVNRevisionRange(sRev, eRev);
ranges.add(range);
mergeSources = normalizeMergeSources(null, url1, sourceReposRoot, sRev,
ranges, repository1);
} else if (youngestCommonURL.equals(url1) && youngestCommonRevision == rev1) {
ancestral = true;
SVNRevision sRev = SVNRevision.create(youngestCommonRevision);
SVNRevision eRev = SVNRevision.create(rev2);
range = new SVNRevisionRange(sRev, eRev);
ranges.add(range);