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

Re: FAIL: locks-test 6/7/11 - Re: svn commit: r34147 - trunk/subversion/libsvn_fs_fs

From: David Glasser <glasser_at_davidglasser.net>
Date: Tue, 11 Nov 2008 17:31:56 -0800

On Tue, Nov 11, 2008 at 5:12 PM, Neels J. Hofmeyr <neels_at_elego.de> wrote:
>
>
> David Glasser wrote:
>> My guess is that we need to rollback the transaction on error. So
>> rewrite all the SVN_ERRs to be if/goto cleanup, or wrap commit_body in
>> a little function like:
>>
>> svn_error_t *
>> commit_exoskeleton(void *baton, apr_pool_t *pool)
>
> <bikeshed>
> I've so far seen these things named *_wrapper... Or, in this instance, I'd
> give the "outside" function the simpler name as in commit_body() and the
> inner function e.g. commit_body_helper(), commit_body_internal(), ...
> </bikeshed>

I was just making a joke, in that commit_body is already such a name.
I assume that whoever sanity-checks this function and commits it will
come up with a better name.

--dave

>> {
>> struct commit_baton *cb = baton;
>> fs_fs_data_t *ffd = cb->fs->fsap_data;
>> svn_sqlite__db_t *db = ffb->rep_cache.db;
>> svn_error_t *err;
>>
>> /* Start the sqlite transaction. */
>> if (db)
>> SVN_ERR(svn_sqlite__transaction_begin(db));
>>
>> err = commit_body(cb, pool);
>>
>> if (db)
>> {
>> if (err)
>> svn_error_clear(svn_sqlite__transaction_rollback(db));
>> else
>> return svn_sqlite__transaction_commit(db);
>> }
>> return err;
>> }
>>
>> --dave
>
>

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-12 02:32:31 CET

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.