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

Re: [PATCH]commit from multiple wc

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 15 Jul 2009 12:14:19 +0100

HuiHuang wrote:
> Hey Stefan,
>
> I write a new patch as you want. I have tested it on my machine and you can also test it to
> see whether it can pass the test. Thank you:)

Hi Hui Hang. A few comments from me...

> log message:
>
> [[[

Please write here a few lines describing the overall purpose of this
change.
      
> * subversion/include/svn_client.h
> (svn_client_commit5): New API. Which do commit from multiple working copies.
> It does one single commit for each working copy.
> * subversion/libsvn_client/commit.c
> (commit_packet_t): New struct. It is used to store information needed by commit.
> (create_commit_packet): New function.It is used to create commit_packet_t.
> (do_one_single_commit): New function. It is used to do one single commit for each
> collected commit packet.
> (do_commit): New function. When locking root failed, this function call
> collect_commit_packets to collect commit packets and call do_one_single_commit
> to do one single commit for each working copy.
> (collect_commit_packets): New function. It is used to collect commit_packet_t
> when locking root failed.
> (svn_client_commit5): It is renamed from svn_client_commit4 and is implement of
> API svn_client_commit5() in subversion/include/svn_client.h.
> (svn_client_commit4): New function. It does the same work as svn_client_commit4
> did originally.
> ]]]
>
> Index: subversion/include/svn_client.h
> ===================================================================
> --- subversion/include/svn_client.h (revision 38371)
> +++ subversion/include/svn_client.h (working copy)
> @@ -1705,6 +1705,25 @@
> */
>
> /**
> +* This function is the same as svn_client_commit4 except that it does
> +* multiple commits when @a multiple_commit is set TRUE, one for each
> +* target working copy. Essentially:
> +* svn commit wc1; svn commit wc2; ...; svn commit wcN;

Say also what it does if @a multiple_commit is FALSE.

> +* Also it returns an array @a commit_info_p.

What data type are the elements of the array, how many are there, and
what are they for?

> +*/

Please give the full doc-string here, not a reference to ..._commit4.
(We can then abbreviate ...commit4's doc string by refering to this new
one.)

> +svn_error_t *
> +svn_client_commit5(apr_array_header_t **commit_info_p,
> + const apr_array_header_t *targets,
> + svn_depth_t depth,
> + svn_boolean_t multiple_commit,
> + svn_boolean_t keep_locks,
> + svn_boolean_t keep_changelists,
> + const apr_array_header_t *changelists,
> + const apr_hash_t *revprop_table,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *pool);
> +
> +/**
> * Commit files or directories into repository, authenticating with
> * the authentication baton cached in @a ctx, and using
> * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to obtain the log message.
> Index: subversion/libsvn_client/commit.c
> ===================================================================
[...]
> +static svn_error_t *
> +collect_commit_packets(apr_array_header_t **commit_packets,
> + const apr_array_header_t *targets,
> + const char *base_dir,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
[...]
> + if (check_err)
> + {
> + if (check_err->apr_err = SVN_ERR_WC_NOT_LOCKED)

I think you meant "==". My compiler says

subversion/libsvn_client/commit.c: In function 'collect_commit_packets':
subversion/libsvn_client/commit.c:1537: warning: suggest parentheses
around assignment used as truth value

> +static svn_error_t *
> +do_commit(apr_array_header_t **commit_info,
> + const apr_array_header_t *targets,
> + const char *base_dir,
> + svn_depth_t depth,
> + svn_boolean_t keep_locks,
> + svn_boolean_t keep_changelists,
> + const apr_array_header_t *changelists,
> + const apr_hash_t *revprop_table,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *pool)
> +{
> + svn_commit_info_t *commit_info_p;
> + apr_array_header_t *commit_packets;
> + apr_pool_t *scratch_pool;
> + commit_packet_t *commit_packet;
> + int i;
> +
> + scratch_pool = svn_pool_create(pool);
> + //commit_packets = apr_array_make(pool, 0, sizeof(commit_packet_t *));

subversion/libsvn_client/commit.c: In function 'do_commit':
subversion/libsvn_client/commit.c:1675: error: expected expression
before '/' token

(We have to use only C-style comments, not "//".)

I have not reviewed the rest of this patch, I just had a quick look and
tried to compile it. I hope my comments are helpful.

Regards,
- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2371448
Received on 2009-07-15 13:14:51 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.