[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Call abort_edit upon editor error in repos reporter

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: Wed, 02 Apr 2008 10:53:41 -0700

[[[
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 --- */

---------------------------------------------------------------------
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-02 19:53:59 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.