On Thu, Mar 26, 2009 at 16:40, C. Michael Pilato <cmpilato_at_collab.net> wrote:
> Greg Stein wrote:
>> On Wed, Mar 25, 2009 at 22:24, C. Michael Pilato <cmpilato_at_collab.net> wrote:
>>> ...
>>> +++ trunk/subversion/libsvn_ra_serf/merge.c   Wed Mar 25 14:24:32 2009     (r36782)
>>> @@ -287,40 +287,41 @@ end_merge(svn_ra_serf__xml_parser_t *par
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â apr_hash_get(info->props,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "post-commit-err", APR_HASH_KEY_STRING));
>>> Â Â Â Â }
>>> - Â Â Â else if (ctx->session->wc_callbacks->push_wc_prop)
>>> + Â Â Â else
>>> Â Â Â Â {
>>> - Â Â Â Â Â const char *href, *checked_in;
>>> - Â Â Â Â Â svn_string_t checked_in_str;
>>> + Â Â Â Â Â const char *href;
>>>
>>> Â Â Â Â Â href = apr_hash_get(info->props, "href", APR_HASH_KEY_STRING);
>>> - Â Â Â Â Â checked_in = apr_hash_get(info->props, "checked-in",
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â APR_HASH_KEY_STRING);
>>> -
>>> Â Â Â Â Â if (! svn_path_is_ancestor(ctx->merge_url, href))
>>> Â Â Â Â Â Â {
>>> Â Â Â Â Â Â Â /* ### need something better than APR_EGENERAL */
>>> Â Â Â Â Â Â Â return svn_error_createf(APR_EGENERAL, NULL,
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â _("A MERGE response for '%s' is not a child "
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "of the destination ('%s')"),
>>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â _("A MERGE response for '%s' is not "
>>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "a child of the destination ('%s')"),
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â href, ctx->merge_url);
>>> Â Â Â Â Â Â }
>
> Hi. Â Remember me?
Ah. Missed that usage.
>>> Â Â Â Â Â href = svn_path_is_child(ctx->merge_url, href, NULL);
>>> Â Â Â Â Â if (! href) /* the paths are equal */
>>> Â Â Â Â Â Â href = "";
>>>
>>> - Â Â Â Â Â checked_in_str.data = checked_in;
>>> - Â Â Â Â Â checked_in_str.len = strlen(checked_in);
>>> -
>>> Â Â Â Â Â /* We now need to dive all the way into the WC to update the
>>> Â Â Â Â Â Â * base VCC url.
>>> Â Â Â Â Â Â */
>>> - Â Â Â Â Â SVN_ERR(ctx->session->wc_callbacks->push_wc_prop(
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx->session->wc_callback_baton,
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â href,
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â SVN_RA_SERF__WC_CHECKED_IN_URL,
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &checked_in_str,
>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â info->pool));
>>> + Â Â Â Â Â if ((! SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->session))
>>> + Â Â Â Â Â Â Â && ctx->session->wc_callbacks->push_wc_prop)
>>> + Â Â Â Â Â Â {
>>> + Â Â Â Â Â Â Â svn_string_t checked_in_str;
>>> + Â Â Â Â Â Â Â const char *checked_in;
>>>
>>> + Â Â Â Â Â Â Â checked_in = apr_hash_get(info->props, "checked-in",
>>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â APR_HASH_KEY_STRING);
>>> + Â Â Â Â Â Â Â checked_in_str.data = checked_in;
>>> + Â Â Â Â Â Â Â checked_in_str.len = strlen(checked_in);
>>> +
>>> + Â Â Â Â Â Â Â SVN_ERR(ctx->session->wc_callbacks->push_wc_prop(
>>> + Â Â Â Â Â Â Â Â ctx->session->wc_callback_baton, href,
>>> + Â Â Â Â Â Â Â Â SVN_RA_SERF__WC_CHECKED_IN_URL, &checked_in_str, info->pool));
>>
>> href is only needed here, so you can tighten up its computation/scope.
>
> No, I expressly wish to always hit the sanity check above, which previously
> only "ran" if there was a push_wc_prop() callback function to use. Â We've
> seen enough bugs over time in this area to make me want to always perform
> the sanity check. Â When this error triggers, it has traditionally meant that
> a commit has gone to the *wrong* FS node ... like changes intended for
> /trunk winding up on some branch. Â Users will want to know about this
> scenario, even if they aren't writing out wcprops.
Yup. Fair enough.
So the second bits of href usage can be shifted inside the block.
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1432872
Received on 2009-03-26 18:44:27 CET