return info != null ? info.getNewRevision() : -1;
return info != null ? info : SVNCommitInfo.NULL;
    private long wc2urlCopy(File srcPath, String dstURL, String commitMessage) throws SVNException {        dstURL = validateURL(dstURL);        SVNRepository repos = createRepository(dstURL);        SVNNodeKind dstKind = repos.checkPath("", -1);        if (dstKind == SVNNodeKind.DIR) {            dstURL = PathUtil.append(dstURL, PathUtil.encode(srcPath.getName()));        } else if (dstKind == SVNNodeKind.FILE) {            SVNErrorManager.error("svn: File '" + dstURL + "' already exists");        }        SVNCommitItem[] items = new SVNCommitItem[] {new SVNCommitItem(null, dstURL, null, SVNNodeKind.NONE, SVNRevision.UNDEFINED, true, false, false, false, true, false)};        commitMessage = getCommitHandler().getCommitMessage(commitMessage, items);        if (commitMessage == null) {            return -1;        }        // collect commitables.        Collection targets = new TreeSet();        Collection tmpFiles = null;        SVNCommitInfo info = null;        ISVNEditor commitEditor = null;        SVNWCAccess wcAccess = createWCAccess(srcPath);        try {            wcAccess.open(true, true);            Map commitables = new TreeMap();            SVNEntry entry = wcAccess.getAnchor().getEntries().getEntry(wcAccess.getTargetName(), false);            if (entry == null) {                SVNErrorManager.error("svn: '" + srcPath + "' is not under version control");                return -1;            }            SVNCommitUtil.harvestCommitables(commitables, wcAccess.getAnchor(), srcPath, null, entry, dstURL, entry.getURL(), true, false, false, null, true);            items = (SVNCommitItem[]) commitables.values().toArray(new SVNCommitItem[commitables.values().size()]);            DebugLog.log(new SVNCommitPacket(wcAccess, items, null) + "");            commitables = new TreeMap();            dstURL = SVNCommitUtil.translateCommitables(items, commitables);            SVNRepository repository = createRepository(dstURL);            SVNCommitMediator mediator = new SVNCommitMediator(wcAccess, commitables);            tmpFiles = mediator.getTmpFiles();            commitEditor = repository.getCommitEditor(commitMessage, null, false, mediator);            info = SVNCommitter.commit(wcAccess, tmpFiles, commitables, repository.getRepositoryRoot(true), commitEditor);            commitEditor = null;        } finally {            if (tmpFiles != null) {                for (Iterator files = tmpFiles.iterator(); files.hasNext();) {                    File file = (File) files.next();                    file.delete();                }            }            if (commitEditor != null && info == null) {                commitEditor.abortEdit();            }            if (wcAccess != null) {                wcAccess.close(true);            }        }        return info != null ? info.getNewRevision() : -1;    }