if (ch.isScheduledForDeletion()) {
if (!ch.isScheduledForDeletion()) {
    public ISVNEntry scheduleForAddition(String name, boolean mkdir, boolean recurse) throws SVNException {        loadEntries();        ISVNEntry child = getChild(name);        if (child != null && !child.isScheduledForDeletion()) {            throw new SVNException("working copy file " + name + " already exists in " + getPath());        }        File file = new File(getRootEntry().getWorkingCopyFile(this), name);        if (mkdir && !file.exists()) {            file.mkdirs();        }        if (!file.exists()) {            throw new SVNException("file " + file.getPath() + " doesn't exists");        }        myUnmanagedChildren = null;        myAllUnmanagedChildren = null;                String path = PathUtil.append(getPath(), name);        FSEntry entry = null;        Map entryMap = null;        if (child == null) {            entryMap = new HashMap();            entryMap.put(SVNProperty.NAME, name);        } else {            entryMap = (Map) myChildEntries.get(name);        }        if (child != null) {            entryMap.put(SVNProperty.SCHEDULE, SVNProperty.SCHEDULE_REPLACE);        } else {            entryMap.put(SVNProperty.SCHEDULE, SVNProperty.SCHEDULE_ADD);            entryMap.put(SVNProperty.KIND, file.isDirectory() ? SVNProperty.KIND_DIR : SVNProperty.KIND_FILE);        }        String url = (String) getEntry().get(SVNProperty.URL);        url = PathUtil.append(url, PathUtil.encode(name));                if (myDeletedEntries != null && myDeletedEntries.containsKey(name)) {            myDeletedEntries.remove(name);            entryMap.put(SVNProperty.DELETED, Boolean.TRUE.toString());        }                if (file.isDirectory()) {            if (child == null) {                entry = new FSDirEntry(getAdminArea(), getRootEntry(), path, url);                            myChildren.put(name, entry);                myChildEntries.put(name, entryMap);                entry.getEntry().put(SVNProperty.REVISION, SVNProperty.toString(0));                entry.getEntry().put(SVNProperty.SCHEDULE, SVNProperty.SCHEDULE_ADD);            } else {                entry = (FSEntry) child;                entry.getEntry().put(SVNProperty.SCHEDULE, SVNProperty.SCHEDULE_REPLACE);            }            if (recurse) {                for(Iterator children = ((ISVNDirectoryEntry) entry).childEntries(); children.hasNext();) {                    ISVNEntry ch = (ISVNEntry) children.next();                    if (ch.isScheduledForDeletion()) {                        ((FSDirEntry) entry).scheduleForAddition(ch.getName(), false, recurse);                    }                }                for(Iterator children = ((ISVNDirectoryEntry) entry).unmanagedChildEntries(false); children.hasNext();) {                    ISVNEntry ch = (ISVNEntry) children.next();                    ((FSDirEntry) entry).scheduleForAddition(ch.getName(), false, recurse);                }            }        } else if (child == null) {            entryMap.put(SVNProperty.REVISION, SVNProperty.toString(0));            entryMap.put(SVNProperty.URL, url);            entry = new FSFileEntry(getAdminArea(), getRootEntry(), path, entryMap);            myChildren.put(name, entry);            myChildEntries.put(name, entryMap);        } else if (child != null) {            // delete props file to copy behaviour of command line client.            File propsFile = getAdminArea().getPropertiesFile(child);            FSUtil.setReadonly(propsFile, false);            propsFile.delete();            entry = (FSEntry) child;        }        try {            if (!entry.isDirectory() && !FileTypeUtil.isTextFile(getRootEntry().getWorkingCopyFile(entry))) {                entry.setPropertyValue(SVNProperty.MIME_TYPE, "application/octet-stream");            }        } catch (IOException e) {            throw new SVNException(e);        }            return entry;    }