Index: subversion/libsvn_repos/reporter.c =================================================================== --- subversion/libsvn_repos/reporter.c (revision 17078) +++ subversion/libsvn_repos/reporter.c (working copy) @@ -837,10 +837,15 @@ drive (report_baton_t *b, svn_revnum_t s if (info_is_set_path && !s_entry) s_fullpath = NULL; + /* Check if the target path exists first. */ + if (!t_entry) + return svn_error_create (SVN_ERR_FS_PATH_SYNTAX, NULL, + _("Target path does not exist")); + /* If the anchor is the operand, the source and target must be dirs. Check this before opening the root to avoid modifying the wc. */ - if (!*b->s_operand && (!s_entry || s_entry->kind != svn_node_dir - || !t_entry || t_entry->kind != svn_node_dir)) + else if (!*b->s_operand && (!s_entry || s_entry->kind != svn_node_dir + || t_entry->kind != svn_node_dir)) return svn_error_create (SVN_ERR_FS_PATH_SYNTAX, NULL, _("Cannot replace a directory from within"));