SVNDirectory parent = null; SVNDirectory child = null; String nameInParent = null;
SVNDirectory parent; SVNDirectory child; String nameInParent;
    public void scheduleForDeletion(String name) throws SVNException {        SVNEntries entries = getEntries();        SVNEntry entry = entries.getEntry(name, true);        if (entry == null) {            SVNFileUtil.deleteAll(getFile(name, false));            return;        }        boolean added = entry.isScheduledForAddition();        boolean deleted = false;        SVNNodeKind kind = entry.getKind();        if (entry.getKind() == SVNNodeKind.DIR) {            // try to get parent entry            SVNDirectory parent = null;            SVNDirectory child = null;            String nameInParent = null;            if (!"".equals(name)) {                parent = this;                nameInParent = name;                child = getChildDirectory(name);            } else {                child = this;                nameInParent = PathUtil.tail(myPath);                 String parentPath = PathUtil.removeTail(myPath);                parentPath = PathUtil.removeLeadingSlash(parentPath);                parent = myWCAccess.getDirectory(parentPath);            }            deleted = parent != null ? parent.getEntries().getEntry(nameInParent, true).isDeleted() : false;            if (added && !deleted) {                // destroy whole child dir.                if (child != null) {                    child.destroy("", true);                } else if (parent != null) {                    // no child, remove entry in parent                    parent.getEntries().deleteEntry(nameInParent);                    parent.getEntries().save(false);                }            } else if (child != null) {                // recursively mark for deletion (but not "").                child.updateEntryProperty(SVNProperty.SCHEDULE, SVNProperty.SCHEDULE_DELETE, true);            }            if (parent != null) {                parent.getEntries().save(false);            }            if (child != null) {                child.getEntries().save(false);            }        }         if (!(kind == SVNNodeKind.DIR && added && !deleted)) {            // schedule entry in parent.                        entry.scheduleForDeletion();        }        SVNEvent event = SVNEventFactory.createDeletedEvent(myWCAccess, this, entry.getName());        myWCAccess.svnEvent(event);        if (added) {            SVNFileUtil.deleteAll(getFile(name, false));        } else {            deleteWorkingFiles(name);        }        entries.save(true);    }