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

Re: svn commit: r932796 - /subversion/trunk/subversion/libsvn_wc/wc_db.h

From: Greg Stein <gstein_at_gmail.com>
Date: Sat, 10 Apr 2010 20:41:31 -0400

On Sat, Apr 10, 2010 at 18:08, <stsp_at_apache.org> wrote:
> Author: stsp
> Date: Sat Apr 10 22:08:37 2010
> New Revision: 932796
>
> URL: http://svn.apache.org/viewvc?rev=932796&view=rev
> Log:
> Add sketchy declarations of functions wrting data to the new conflict store.
> Review and comments welcome.

Upon reflection, this approach will cause atomicity problems. The
ideal situation is to add/replace a node with all of its metadata
(including conflict data!) in one atomic transation.

If you look at svn_wc__db_base_add_*(), they have a parameter named
CONFLICT, which can be inserted during the transaction which
adds/replaces the node data itself.

What I would like to suggest is a "conflict builder" set of APIs that
constructs the svn_skel_t. The operation would be something like this:

svn_skel_t *conflict = svn_wc__builder_create(result_pool);

/* conflict == (()), representing (OPERATION) and OPERATION=() */

SVN_ERR(svn_wc__builder_set_update_op(conflict, base_revision,
target_revision, result_pool, scratch_pool));
SVN_ERR(svn_wc__builder_add_text_conflict(conflict, ...));
SVN_ERR(svn_wc__builder_add_prop_conflict(conflict, ...));
...
SVN_ERR(svn_wc__db_base_add_file(..., conflict, ...));

I don't think we need anything fancier than an svn_skel_t for the
representation. The builder_set_*_op would just replace the OPERATION
subskel with the appropriate data. The build_add_* functions would
append new conflict subskels to the main skel. When everything is
ready, the main skel is passed into wc_db fully-formed and ready for
insertion into the database.

Whatcha think?

Cheers,
-g
Received on 2010-04-11 02:41: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.