[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: Neels J. Hofmeyr <neels_at_elego.de>
Date: Wed, 12 Nov 2008 02:12:00 +0100

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>

~Neels

> {
> 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

Received on 2008-11-12 02:12:30 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.