I (Julian Foad) wrote: > The "call a function within a transaction" paradigm is used heavily in > wc_db.c. [...] To simplify it, we can write a statement > macro that takes a complete, arbitrary function call as an argument. > [...] Then the usage looks like this: > > /* ... */ > static svn_error_t *db_base_remove(param1, > param2, > ..., > scratch_pool) > { > ... param1 ... > } > > In the caller: > { > SVN_WC__DB_WITH_TXN(wcroot, > db_base_remove(param1, param2, ..., scratch_pool)); > } [...] > I would prefer to be working with the simpler style of code, so I would like > to > introduce and use this macro.
I will point out that there are also some places where the current use of a baton still makes sense, notably for these three functions: insert_base_node() insert_external_node() insert_working_node() where the baton contains a set of logically related information about the node rather than things that would make sense to be function parameters. Using the new macro for these while keeping the baton will enable type checking of the baton type but nothing major. > What does anybody think of introducing this form, in principle and in > practice? If there are no objections in a day or so, I'll finish the patch and commit it. - Julian