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

Re: svn commit: r1330058 - in /subversion/trunk/subversion: include/svn_error_codes.h include/svn_fs.h libsvn_fs/editor.c libsvn_repos/commit.c

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Wed, 25 Apr 2012 14:28:33 +0300

gstein_at_apache.org wrote on Tue, Apr 24, 2012 at 23:33:24 -0000:
> Author: gstein
> Date: Tue Apr 24 23:33:23 2012
> New Revision: 1330058
>
> URL: http://svn.apache.org/viewvc?rev=1330058&view=rev
> Log:
> Rejigger how FS editors are completed and how the commit process works.
>
> Modified: subversion/trunk/subversion/libsvn_fs/editor.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/editor.c?rev=1330058&r1=1330057&r2=1330058&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs/editor.c (original)
> +++ subversion/trunk/subversion/libsvn_fs/editor.c Tue Apr 24 23:33:23 2012
> @@ -38,8 +38,8 @@ struct edit_baton {
> /* The transaction associated with this editor. */
> svn_fs_txn_t *txn;
>
> - /* Should the transaction be committed when complete_cb() is invoked? */
> - svn_boolean_t autocommit;
> + /* Has this editor been completed? */
> + svn_boolean_t completed;
>
> /* We sometimes need the cancellation beyond what svn_editor_t provides */
> svn_cancel_func_t cancel_func;
> @@ -326,15 +326,17 @@ complete_cb(void *baton,
> {
> struct edit_baton *eb = baton;
>
> + /* Watch out for a following call to svn_fs_editor_commit(). Note that
> + we are likely here because svn_fs_editor_commit() was called, and it
> + invoked svn_editor_complete(). */
> + eb->completed = TRUE;
> +

The code doesn't prevent people from calling svn_editor_complete() twice
when the second call is not via svn_fs_editor_commit(), but the
docstring says it would error in that case.

(Nice handling of all the various branches in svn_fs_editor_commit(),
BTW. Tricky code.)
Received on 2012-04-25 13:29:16 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.