Index: subversion/libsvn_ra_serf/commit.c =================================================================== --- subversion/libsvn_ra_serf/commit.c (revision 1736882) +++ subversion/libsvn_ra_serf/commit.c (working copy) @@ -1415,7 +1415,6 @@ delete_context_t *delete_ctx; svn_ra_serf__handler_t *handler; const char *delete_target; - svn_error_t *err; if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx)) { @@ -1449,16 +1448,26 @@ handler->method = "DELETE"; handler->path = delete_target; + handler->no_fail_on_http_failure_status = TRUE; - err = svn_ra_serf__context_run_one(handler, pool); - if (err && err->apr_err == SVN_ERR_RA_DAV_REQUEST_FAILED - && handler->sline.code == 400) + SVN_ERR(svn_ra_serf__context_run_one(handler, pool)); + if (handler->sline.code == 400) { - svn_error_clear(err); - /* Try again with non-standard body to overcome Apache Httpd header limit */ delete_ctx->non_recursive_if = TRUE; + + handler = svn_ra_serf__create_handler(dir->commit_ctx->session, pool); + + handler->response_handler = svn_ra_serf__expect_empty_body; + handler->response_baton = handler; + + handler->header_delegate = setup_delete_headers; + handler->header_delegate_baton = delete_ctx; + + handler->method = "DELETE"; + handler->path = delete_target; + handler->body_type = "text/xml"; handler->body_delegate = create_delete_body; handler->body_delegate_baton = delete_ctx; @@ -1465,9 +1474,10 @@ SVN_ERR(svn_ra_serf__context_run_one(handler, pool)); } - else - SVN_ERR(err); + if (handler->server_error) + return svn_ra_serf__server_error_create(handler, pool); + /* 204 No Content: item successfully deleted */ if (handler->sline.code != 204) return svn_error_trace(svn_ra_serf__unexpected_status(handler));