commitEditor.closeFile(null);
commitEditor.closeFile(dstPath, null);
    private long url2urlCopy(String srcURL, long srcRevision, String dstURL, String commitMessage, final boolean move) throws SVNException {        String commonURL = SVNPathUtil.getCommonURLAncestor(srcURL, dstURL);        if (commonURL.length() == 0 || commonURL.indexOf("://") < 0) {            SVNErrorManager.error("svn: Source and dest appear not to be in the same repository (src: '" + srcURL + "'; dst: '" +dstURL + "'");        }        boolean resurrect = false;        if (srcURL.equals(dstURL)) {            commonURL = PathUtil.removeTail(commonURL);            resurrect = true;        }        String srcRelative = PathUtil.decode(srcURL.substring(commonURL.length()));        String dstRelative = PathUtil.decode(dstURL.substring(commonURL.length()));        if (srcRelative.length() == 0 && move) {            SVNErrorManager.error("svn: Cannot move '" + srcURL + "' into itself");        }        DebugLog.log("dst relative: " + dstRelative);        DebugLog.log("src relative: " + srcRelative);        if (srcRelative.startsWith("/")) {            srcRelative = srcRelative.substring(1);        }        if (dstRelative.startsWith("/")) {            dstRelative = dstRelative.substring(1);        }        SVNRepository repos = createRepository(commonURL);        long lastRevision = repos.getLatestRevision();        if (srcRevision < 0) {            srcRevision = lastRevision;        }        final SVNNodeKind srcKind = repos.checkPath(srcRelative, srcRevision);        if (srcKind == SVNNodeKind.NONE) {            SVNErrorManager.error("svn: Path '" + srcURL + "' does not exist in revision " + srcRevision);        }        SVNNodeKind dstKind = repos.checkPath(dstRelative, lastRevision);        if (dstKind == SVNNodeKind.FILE) {            SVNErrorManager.error("svn: Path '" + dstURL + "' already exists");        } else if (dstKind == SVNNodeKind.DIR) {            String newDstPath = dstRelative.length() == 0 ? PathUtil.decode(PathUtil.tail(srcURL)) :                    PathUtil.append(dstRelative, PathUtil.decode(PathUtil.tail(srcURL)));            dstKind = repos.checkPath(newDstPath, lastRevision);            if (dstKind != SVNNodeKind.NONE) {                SVNErrorManager.error("svn: Path '" + newDstPath + "' already exists");            }            dstRelative = newDstPath;        }        DebugLog.log("repos created at " + commonURL);        Collection commitItems = new ArrayList(2);        commitItems.add(new SVNCommitItem(null, dstURL, srcURL, srcKind, SVNRevision.create(srcRevision), true, false, false, false, true, false));        if (move) {            commitItems.add(new SVNCommitItem(null, srcURL, null, srcKind, SVNRevision.create(srcRevision), false, true, false, false, false, false));        }        commitMessage = getCommitHandler().getCommitMessage(commitMessage, (SVNCommitItem[]) commitItems.toArray(new SVNCommitItem[commitItems.size()]));        if (commitMessage == null) {            return -1;        }        ISVNEditor commitEditor = repos.getCommitEditor(commitMessage, null, false, null);        final String srcPath = srcRelative;        final String dstPath = dstRelative;        final long srcRevNumber = srcRevision;        final boolean isRessurect = resurrect;        ISVNCommitPathHandler committer = new ISVNCommitPathHandler() {            public void handleCommitPath(String commitPath, ISVNEditor commitEditor) throws SVNException {                boolean doAdd = false;                boolean doDelete = false;                if (isRessurect) {                    if (!move) {                        doAdd = true;                    }                } else {                    if (move) {                        if (commitPath.equals(srcPath)) {                            doDelete = true;                        } else {                            doAdd = true;                        }                    } else {                        doAdd = true;                    }                }                if (doDelete) {                    DebugLog.log("deleting " + srcPath);                    commitEditor.deleteEntry(srcPath, -1);                }                if (doAdd) {                    if (srcKind == SVNNodeKind.DIR) {                        DebugLog.log("adding dir " + dstPath + " from " + srcPath);                        commitEditor.addDir(dstPath, srcPath, srcRevNumber);                    } else {                        DebugLog.log("adding file " + dstPath + " from " + srcPath);                        commitEditor.addFile(dstPath, srcPath, srcRevNumber);                        commitEditor.closeFile(null);                    }                }            }        };        Collection paths = move ? Arrays.asList(new String[] {srcRelative, dstRelative}) :                Collections.singletonList(dstRelative);        SVNCommitInfo result = null;        try {            SVNCommitUtil.driveCommitEditor(committer, paths, commitEditor, -1);            result = commitEditor.closeEdit();        } catch (SVNException e) {            try {                commitEditor.abortEdit();            } catch (SVNException inner) {                //            }            SVNErrorManager.error("svn: " + e.getMessage());        }        return result != null ? result.getNewRevision() : -1;    }