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

Re: use of commit_items param in svn_client__do_commit()

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2006-11-15 20:06:58 CET

Madan U Sreenivasan wrote:
> Hi,
>
> I have a situation while implementing wc to repos copy for
> merge-tracking. I decided to mail the list, since breaking my head over
> it didnt turn out any useful choices.
>
> The situation:
> svn_client__do_commit() function uses the do_item_commit() function to
> check-in changes from the working copy. But it does not use the whole of
> the commit_items array (an array of svn_client_commit_item2_t). Instead
> only the paths from the commit_items array are passed to do_item_commit().

How do you figure?

static svn_error_t *
do_item_commit(void **dir_baton,
               void *parent_baton,
               void *callback_baton,
               const char *path,
               apr_pool_t *pool)
{
  struct path_driver_cb_baton *cb_baton = callback_baton;
  svn_client_commit_item2_t *item = apr_hash_get(cb_baton->commit_items,
                                                 path, APR_HASH_KEY_STRING);
  ...

The first thing this function does is get a point to the object in the
commit_items *hash* (not "array", as you state) that corresponds to the
path. From there, that objects members are dereferenced all *over* that
function.

I think you need to take a closer look at how svn_client__do_commit()
and do_item_commit() really work. You might be getting confused by the
fact that cb.commit_items is a hash created from the original
commit_items array.

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Wed Nov 15 20:07:19 2006

This is an archived mail posted to the Subversion Dev mailing list.