On 26 September 2013 14:19, <[email protected]> wrote:
> Author: rhuijben
> Date: Thu Sep 26 10:19:23 2013
> New Revision: 1526439
>
> URL: http://svn.apache.org/r1526439
> Log:
> Yet another serf server response handling improvement.
>
[...]
> if (handler->sline.code != 404)
> {
> - return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS, NULL,
> + if (handler->sline.code != 200)
> + {
> + svn_error_t *err;
> +
> + err = svn_ra_serf__error_on_status(handler->sline,
> + handler->path,
> + handler->location);
> +
> + SVN_ERR(err);
> + }
> +
> + return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
> _("File '%s' already exists"), path);
> }
Hi Bert,
What do you think about rewriting this condition in the following way?
[[[
if (handler->sline.code != 404)
{
SVN_ERR(svn_ra_serf__error_on_status(handler->sline,
handler->path,
handler->location));
return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
_("File '%s' already exists"), path);
}
]]]
Patch attached.
--
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Index: subversion/libsvn_ra_serf/commit.c
===================================================================
--- subversion/libsvn_ra_serf/commit.c (revision 1534135)
+++ subversion/libsvn_ra_serf/commit.c (working copy)
@@ -1933,18 +1933,11 @@
if (handler->sline.code != 404)
{
- if (handler->sline.code != 200)
- {
- svn_error_t *err;
+ SVN_ERR(svn_ra_serf__error_on_status(handler->sline,
+ handler->path,
+ handler->location));
- err = svn_ra_serf__error_on_status(handler->sline,
- handler->path,
- handler->location);
-
- SVN_ERR(err);
- }
-
- return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
+ return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
_("File '%s' already exists"), path);
}
}