}
protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException {
long[] pegRev = { SVNRepository.INVALID_REVISION };
SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev);
SVNLocationEntry copyFromEntry = null;
String targetPath = getPathRelativeToRoot(path, url, null, null, repos);
CopyFromReceiver receiver = new CopyFromReceiver(targetPath);
try {
repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver);
copyFromEntry = receiver.getCopyFromLocation();
} catch (SVNException e) {
SVNErrorCode errCode = e.getErrorMessage().getErrorCode();
if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) {
return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null);
}
throw e;
}
return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null)
: copyFromEntry;
}