Eric Gillespie <epg_at_pretzelnet.org> writes:
> [[[
> Call abort_edit upon editor failure in the repos reporter.
>
> * subversion/libsvn_repos/reporter.c
> (drive): Don't call close_edit here.
> (finish_report): If drive returns an error, call abort_edit (discarding
> any error) and return the error. Else, call close_edit.
> ]]]
>
> Index: subversion/libsvn_repos/reporter.c
> ===================================================================
> --- subversion/libsvn_repos/reporter.c (revision 30158)
> +++ subversion/libsvn_repos/reporter.c (working copy)
> @@ -1179,9 +1179,7 @@ drive(report_baton_t *b, svn_revnum_t s_rev, path_
> t_entry, root_baton, b->s_operand, info,
> info->depth, b->requested_depth, pool));
>
> - SVN_ERR(b->editor->close_directory(root_baton, pool));
> - SVN_ERR(b->editor->close_edit(b->edit_baton, pool));
> - return SVN_NO_ERROR;
> + return b->editor->close_directory(root_baton, pool);
> }
>
> /* Initialize the baton fields for editor-driving, and drive the editor. */
> @@ -1239,7 +1237,13 @@ finish_report(report_baton_t *b, apr_pool_t *pool)
> for (i = 0; i < NUM_CACHED_SOURCE_ROOTS; i++)
> b->s_roots[i] = NULL;
>
> - return drive(b, s_rev, info, pool);
> + {
> + svn_error_t *err = drive(b, s_rev, info, pool);
> + if (err == SVN_NO_ERROR)
> + return b->editor->close_edit(b->edit_baton, pool);
> + svn_error_clear(b->editor->abort_edit(b->edit_baton, pool));
> + return err;
> + }
> }
>
> /* --- COLLECTING THE REPORT INFORMATION --- */
Looks good, but why not chain any error returned by abort_edit(),
instead of discarding it?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-03 01:50:19 CEST