DebugLog.log("checkout from: " + wcAccess2);
    public void doCopy(String srcURL, File dstPath, SVNRevision revision) throws SVNException {        srcURL = validateURL(srcURL);        long revNumber = getRevisionNumber(srcURL, revision);        SVNRepository repos = createRepository(srcURL);        SVNNodeKind srcKind = repos.checkPath("", revision.getNumber());        if (srcKind == SVNNodeKind.NONE) {            if (revision == SVNRevision.HEAD) {                SVNErrorManager.error(0, null);            }            SVNErrorManager.error(0, null);        }        String srcUUID = repos.getRepositoryUUID();        if (dstPath.isDirectory()) {            dstPath = new File(dstPath, PathUtil.decode(PathUtil.tail(srcURL)));            if (dstPath.exists()) {                SVNErrorManager.error(0, null);            }        } else if (dstPath.exists()) {            SVNErrorManager.error(0, null);        }                boolean sameRepositories = false;        SVNWCAccess wcAccess = createWCAccess(dstPath);         try {            wcAccess.open(true, false);            // check for missing entry.            SVNEntry entry = wcAccess.getAnchor().getEntries().getEntry(wcAccess.getTargetName());            if (entry != null && !entry.isDirectory()) {                SVNErrorManager.error(0, null);            }            DebugLog.log("wc access: " + wcAccess);            String uuid = wcAccess.getTargetEntryProperty(SVNProperty.UUID);            sameRepositories = uuid.equals(srcUUID);            if (srcKind == SVNNodeKind.DIR) {                String dstURL = wcAccess.getAnchor().getEntries().getPropertyValue("", SVNProperty.URL);                dstURL = PathUtil.append(dstURL, PathUtil.encode(dstPath.getName()));                createVersionedDirectory(dstPath, dstURL, uuid, revNumber);                                SVNDirectory targetDir = new SVNDirectory(null, "", dstPath);                SVNWCAccess wcAccess2 = new SVNWCAccess(targetDir, targetDir, "");                DebugLog.log("wc access2: " + wcAccess2);                wcAccess2.open(true, true);                myIsDoNotSleepForTimeStamp = true;                try {                    SVNReporter reporter = new SVNReporter(wcAccess2, true);                    SVNUpdateEditor editor = new SVNUpdateEditor(wcAccess2, null, true);                    DebugLog.log("checkout from: " + wcAccess2);                                        repos.update(revNumber, null, true, reporter, editor);                    dispatchEvent(SVNEvent.createUpdateCompletedEvent(wcAccess, editor.getTargetRevision()));                    if (sameRepositories) {                        addDir(wcAccess.getAnchor(), dstPath.getName(), srcURL, editor.getTargetRevision());                        addDir(wcAccess2.getAnchor(), "", srcURL, editor.getTargetRevision());                        // fire added event.                        dispatchEvent(SVNEvent.createAddedEvent(wcAccess, wcAccess.getAnchor(),                                 wcAccess.getAnchor().getEntries().getEntry(dstPath.getName())));                    } else {                        SVNErrorManager.error(0, null);                    }                } finally {                    myIsDoNotSleepForTimeStamp = false;                    wcAccess2.close(true, true);                }            } else {                Map properties = new HashMap();                File tmpFile = null;                OutputStream os = null;                try {                    File baseTmpFile = wcAccess.getAnchor().getBaseFile(dstPath.getName(), true);                    tmpFile = SVNFileUtil.createUniqueFile(baseTmpFile.getParentFile(), dstPath.getName(), ".tmp");                                        os = new FileOutputStream(tmpFile);                    long fileRevision = repos.getFile("", revNumber, properties, os);                    os.close();                    os = null;                    SVNFileUtil.rename(tmpFile, baseTmpFile);                } catch (IOException e) {                    SVNErrorManager.error(0, e);                } finally {                    if (os != null) {                        try {                            os.close();                        } catch (IOException e) {                        }                    }                    if (tmpFile != null) {                        tmpFile.delete();                    }                }                addFile(wcAccess.getAnchor(), dstPath.getName(), properties, sameRepositories ? srcURL : null, revNumber);                wcAccess.getAnchor().runLogs();                // fire added event.                dispatchEvent(SVNEvent.createAddedEvent(wcAccess, wcAccess.getAnchor(),                         wcAccess.getAnchor().getEntries().getEntry(dstPath.getName())));            }        } finally {            if (wcAccess != null) {                wcAccess.close(true, false);            }            SVNFileUtil.sleepForTimestamp();        }    }