Index: subversion/include/svn_error_codes.h =================================================================== --- subversion/include/svn_error_codes.h (revision 6946) +++ subversion/include/svn_error_codes.h (working copy) @@ -339,6 +339,10 @@ SVN_ERR_WC_CATEGORY_START + 18, "Cannot change node kind") + SVN_ERRDEF (SVN_ERR_WC_INVALID_OP_ON_CWD, + SVN_ERR_WC_CATEGORY_START + 19, + "Invalid operation on the current working directory") + /* fs errors */ SVN_ERRDEF (SVN_ERR_FS_GENERAL, Index: subversion/libsvn_wc/adm_ops.c =================================================================== --- subversion/libsvn_wc/adm_ops.c (revision 6946) +++ subversion/libsvn_wc/adm_ops.c (working copy) @@ -1462,6 +1462,17 @@ { apr_hash_t *entries; const svn_wc_entry_t *parents_entry; + + /* + * We are trying to revert the current directory which is + * scheduled for addition. This is supposed to fail (Issue #854) + * */ + if (path[0] == '\0') + { + return svn_error_createf (SVN_ERR_WC_INVALID_OP_ON_CWD, NULL, + "%s", "Cannot revert addition of current directory, please try this operation again from the parent directory."); + } + SVN_ERR (svn_wc_entries_read (&entries, parent_access, TRUE, pool)); parents_entry = apr_hash_get (entries, basey, APR_HASH_KEY_STRING); if (parents_entry)