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

Re: svn commit: r31248 - in trunk/subversion: include libsvn_client svn

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Sat, 17 May 2008 09:20:01 -0400

kfogel_at_tigris.org writes:
> Log:
> Narrow the race-condition window in 'svn propedit --revprop'.
> [...]
>
> --- trunk/subversion/libsvn_client/prop_commands.c (r31247)
> +++ trunk/subversion/libsvn_client/prop_commands.c (r31248)
> @@ -493,6 +494,31 @@ svn_client_revprop_set(const char *propn
> SVN_ERR(svn_client__get_revision_number
> (set_rev, NULL, ra_session, revision, NULL, pool));
>
> + if (original_propval)
> + {
> + /* Ensure old value hasn't changed behind our back. */
> + svn_string_t *current;
> + SVN_ERR(svn_ra_rev_prop(ra_session, *set_rev, propname, &current, pool));
> +
> + if (original_propval->data
> + && (! svn_string_compare(original_propval, current)))
> + {
> + return svn_error_createf(
> + SVN_ERR_RA_OUT_OF_DATE, NULL,
> + _("revprop '%s' in r%ld has unexpected value in repository"
> + " (maybe someone else changed it?)"),
> + propname, *set_rev);
> + }
> + else if ((! original_propval->data) && current)
> + {
> + return svn_error_createf(
> + SVN_ERR_RA_OUT_OF_DATE, NULL,
> + _("revprop '%s' in r%ld is unexpectedly absent in repository"
> + " (maybe someone else deleted it?)"),
> + propname, *set_rev);
> + }
> + }

Reviewing my own commit:

I messed up the above conditions. The second case's error message is
backwards, and furthermore there is actually no check for the case where
the revprop has disappeared behind the user's back (that is, there
should be three conditions).

Will fix.

-Karl

---------------------------------------------------------------------
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-17 15:20:24 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.