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

Re: svn commit: r31196 - trunk/subversion/libsvn_client

From: Philip Martin <philip_at_codematters.co.uk>
Date: Thu, 15 May 2008 17:39:32 +0100

kfogel_at_tigris.org writes:

> Author: kfogel
> Date: Thu May 15 07:44:15 2008
> New Revision: 31196
>
> Log:
> Fix issue #3198: don't commit an add of a missing item.
>
> * subversion/libsvn_client/commit_util.c
> (harvest_committables): Check for existence before adding.
>
> Modified:
> trunk/subversion/libsvn_client/commit_util.c
>
> Modified: trunk/subversion/libsvn_client/commit_util.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/commit_util.c?pathrev=31196&r1=31195&r2=31196
> ==============================================================================
> --- trunk/subversion/libsvn_client/commit_util.c Thu May 15 07:31:12 2008 (r31195)
> +++ trunk/subversion/libsvn_client/commit_util.c Thu May 15 07:44:15 2008 (r31196)
> @@ -438,8 +438,20 @@ harvest_committables(apr_hash_t *committ
> information about it. */
> if (state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
> {
> + svn_node_kind_t working_kind;
> svn_boolean_t eol_prop_changed;
>
> + /* First of all, the working file or directory must exist.
> + See issue #3198. */
> + svn_io_check_path(path, &working_kind, pool);
> + if (working_kind == svn_node_none)
> + {
> + return svn_error_createf
> + (SVN_ERR_WC_PATH_NOT_FOUND, NULL,
> + _("'%s' is scheduled for addition, but is missing"),
> + svn_path_local_style(path, pool));
> + }
> +

Adding svn_io_check_path calls often introduces races; in this case if
the file is deleted afer the check then the original problem is still
present. Now modifying the wc during a commit is not really expected
to work, but it would be good if the client failed without breaking
the working copy. A more robust solution would be better error
handling when attempting to open the missing file (I'm assuming that's
possible but I haven't looked at the code).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-15 18:39:50 CEST

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