SVNRepository repository = createRepository(sourceURL, file, SVNRevision.UNDEFINED, revision);
SVNRepository repository = createRepository(sourceURL, wcAccess.getAnchor().getRoot(), SVNRevision.UNDEFINED, revision);
    public long doSwitch(File file, SVNURL url, SVNRevision revision, boolean recursive) throws SVNException {        SVNWCAccess wcAccess = createWCAccess(file);        final SVNReporter reporter = new SVNReporter(wcAccess, true, recursive);        try {            wcAccess.open(true, recursive);            SVNEntry entry = wcAccess.getAnchor().getEntries().getEntry("", false);            if (entry == null) {                SVNErrorManager.error("svn: '" + file + "' is not under version control");            }            SVNURL sourceURL = entry.getSVNURL();            if (url == null) {                SVNErrorManager.error("svn: '" + file + "' has no URL");            }            SVNRepository repository = createRepository(sourceURL, file, SVNRevision.UNDEFINED, revision);            long revNumber = getRevisionNumber(revision, repository, file);            SVNUpdateEditor editor = new SVNUpdateEditor(wcAccess, url.toString(), recursive, isLeaveConflictsUnresolved());                        String target = "".equals(wcAccess.getTargetName()) ? null : wcAccess.getTargetName();            repository.update(url, revNumber, target, recursive, reporter, editor);            if (editor.getTargetRevision() >= 0 && recursive && !isIgnoreExternals()) {                handleExternals(wcAccess);                dispatchEvent(SVNEventFactory.createUpdateCompletedEvent(wcAccess, editor.getTargetRevision()));            }            return editor.getTargetRevision();        } finally {            wcAccess.close(true);            if (!isDoNotSleepForTimeStamp()) {                SVNFileUtil.sleepForTimestamp();            }        }    }