SVNNodeKind nodeKind = repository.checkPath(newPath, -1);
DebugLog.log("checking new path: " + newPath); nodeKind = repository.checkPath(newPath, -1);
    private void runRemote(PrintStream out, PrintStream err) throws SVNException {        if (getCommandLine().getURLCount() != 2) {            throw new SVNException("Please enter SRC and DST URL");        }        String srcURL = getCommandLine().getURL(0);        String destURL = getCommandLine().getURL(1);        String message = (String) getCommandLine().getArgumentValue(SVNArgument.MESSAGE);        SVNRepository repository = createRepository(destURL);        String root = destURL;        String newPath = PathUtil.tail(srcURL);        newPath = PathUtil.removeLeadingSlash(newPath);        newPath = PathUtil.decode(newPath);        if (repository.checkPath("", -1) == SVNNodeKind.NONE) {            // dst doesn't exists.            root = PathUtil.removeTail(destURL);            repository = createRepository(root);            newPath = PathUtil.tail(destURL);        }        long revNumber = -1;        String revStr = (String) getCommandLine().getArgumentValue(SVNArgument.REVISION);        if (revStr != null) {            try {                revNumber = Long.parseLong(revStr);            } catch (NumberFormatException e) {                revNumber = -1;            }        }        if (revNumber < 0) {            revNumber = repository.getLatestRevision();        }        String newPathParent = null;        SVNNodeKind nodeKind = repository.checkPath(newPath, -1);        if (nodeKind == SVNNodeKind.DIR) {        	DebugLog.log("path " + newPath + " already exists and its a dir");        	newPathParent = newPath;         	newPath = PathUtil.tail(srcURL);         	newPath = PathUtil.append(newPathParent, newPath);            nodeKind = repository.checkPath(newPath, -1);            if (nodeKind == SVNNodeKind.DIR) {            	DebugLog.log("can't copy to '" + PathUtil.append(destURL, newPath) + "', location already exists");            	err.println("can't copy to '" + PathUtil.append(destURL, newPath) + "', location already exists");            	return;            }        }        SVNRepositoryLocation srcLocation = SVNRepositoryLocation.parseURL(srcURL);        srcURL = srcLocation.getPath();        srcURL = PathUtil.decode(srcURL);        if (repository.getRepositoryRoot() == null) {            repository.testConnection();        }        srcURL = srcURL.substring(repository.getRepositoryRoot().length());        if (!srcURL.startsWith("/")) {            srcURL += "/";        }        ISVNEditor editor = repository.getCommitEditor(message, null);        try {            editor.openRoot(-1);            if (newPathParent != null) {            	editor.openDir(newPathParent, -1);            }            editor.addDir(newPath, srcURL, revNumber);            editor.closeDir();            if (newPathParent != null) {            	editor.closeDir();            }            editor.closeDir();            SVNCommitInfo info = editor.closeEdit();            out.println();            out.println("Committed revision " + info.getNewRevision() + ".");        } catch (SVNException e) {            if (editor != null) {                try {                    editor.abortEdit();                } catch (SVNException es) {}            }            throw e;        }    }