repository.setPegRevision(getRevisionNumber(revision2, repository, path2));
    private void doDiffURLWC(SVNURL url1, SVNRevision revision1, SVNRevision pegRevision, File path2, SVNRevision revision2,             boolean reverse, boolean recursive, boolean useAncestry, OutputStream result) throws SVNException {        SVNWCAccess wcAccess = createWCAccess(path2);        wcAccess.open(false, recursive);                File anchorPath = wcAccess.getAnchor().getRoot();        String target = "".equals(wcAccess.getTargetName()) ? null : wcAccess.getTargetName();                SVNEntry anchorEntry = wcAccess.getAnchor().getEntries().getEntry("", false);        if (anchorEntry == null) {            SVNErrorManager.error("svn: '" + anchorPath + "' is not under version control");        } else if (anchorEntry.getURL() == null) {            SVNErrorManager.error("svn: '" + anchorPath + "' has no URL");        }        SVNURL anchorURL = anchorEntry.getSVNURL();        if (pegRevision.isValid()) {            SVNRepositoryLocation[] locations = getLocations(url1, null, pegRevision, revision1, SVNRevision.UNDEFINED);            url1 = locations[0].getURL();            String anchorPath2 = SVNPathUtil.append(anchorURL.toString(), target == null ? "" : target);            getDiffGenerator().init(url1.toString(), anchorPath2);        }        SVNRepository repository = createRepository(anchorURL);        SVNDiffEditor editor = new SVNDiffEditor(wcAccess, getDiffGenerator(),                useAncestry, reverse /* reverse */,                revision2 == SVNRevision.BASE /* compare to base */, result);        SVNReporter reporter = new SVNReporter(wcAccess, false, recursive);        long revNumber = getRevisionNumber(revision1, repository, null);                repository.diff(url1, revNumber, target, !useAncestry, recursive, reporter, editor);                wcAccess.close(false);    }