Author: rhuijben
Date: Thu Jun 16 16:24:35 2011
New Revision: 1136530
URL: http://svn.apache.org/viewvc?rev=1136530&view=rev
Log:
Following up on r1136429, handle a few more commit failures with a clearer
error message. Pass the information to the notification handlers so GUIs can
also improve their user experience.
* subversion/libsvn_client/commit_util.c
(fixup_out_of_date_error): Handle already exist errors like not found. Pass
error and kind to notification handlers.
(do_item_commit): Handle failed add_file/add_directory via
fixup_out_of_date_error.
Modified:
subversion/trunk/subversion/libsvn_client/commit_util.c
Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1136530&r1=1136529&r2=1136530&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Thu Jun 16 16:24:35
2011
@@ -60,7 +60,9 @@ fixup_out_of_date_error(const char *loca
apr_pool_t *scratch_pool)
{
if (err->apr_err == SVN_ERR_FS_NOT_FOUND
- || err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND)
+ || err->apr_err == SVN_ERR_FS_ALREADY_EXISTS
+ || err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND
+ || err->apr_err == SVN_ERR_RA_DAV_ALREADY_EXISTS)
{
if (ctx->notify_func2)
{
@@ -70,6 +72,9 @@ fixup_out_of_date_error(const char *loca
svn_wc_notify_failed_out_of_date,
scratch_pool);
+ notify->kind = kind;
+ notify->err = err;
+
ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
}
@@ -1481,20 +1486,24 @@ do_item_commit(void **dir_baton,
if (kind == svn_node_file)
{
SVN_ERR_ASSERT(parent_baton);
- SVN_ERR(editor->add_file
- (path, parent_baton, item->copyfrom_url,
+ err = editor->add_file(
+ path, parent_baton, item->copyfrom_url,
item->copyfrom_url ? item->copyfrom_rev :
SVN_INVALID_REVNUM,
- file_pool, &file_baton));
+ file_pool, &file_baton);
}
else /* May be svn_node_none when adding parent dirs for a copy. */
{
SVN_ERR_ASSERT(parent_baton);
- SVN_ERR(editor->add_directory
- (path, parent_baton, item->copyfrom_url,
+ err = editor->add_directory(
+ path, parent_baton, item->copyfrom_url,
item->copyfrom_url ? item->copyfrom_rev :
SVN_INVALID_REVNUM,
- pool, dir_baton));
+ pool, dir_baton);
}
+ if (err)
+ return svn_error_return(fixup_out_of_date_error(local_abspath, path,
+ kind, err, ctx, pool));
+
/* Set other prop-changes, if available in the baton */
if (item->outgoing_prop_changes)
{