> Author: stsp
> Date: Tue Sep 30 20:03:43 2014
> New Revision: 1628536
>
> URL: http://svn.apache.org/r1628536
> Log:
> Fix issue #4085, "external can shadow a versioned directory".

[...]

> Modified: subversion/trunk/subversion/libsvn_client/externals.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1628536&r1=1628535&r2=1628536&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/externals.c (original)
> +++ subversion/trunk/subversion/libsvn_client/externals.c Tue Sep 30 20:03:43 
> 2014
> @@ -169,6 +169,37 @@ switch_dir_external(const char *local_ab
>    if (revision->kind == svn_opt_revision_number)
>      external_rev = revision->value.number;
>  
> +  /* 
> +   * The code below assumes existing versioned paths are *not* part of
> +   * the external's defining working copy.
> +   * The working copy library does not support registering externals
> +   * on top of existing BASE nodes and will error out if we try.
> +   * So if the external target is part of the defining working copy's
> +   * BASE tree, don't attempt to create the external. Doing so would
> +   * leave behind a switched path instead of an external (since the
> +   * switch succeeds but registration of the external in the DB fails).
> +   * The working copy then cannot be updated until the path is switched back.
> +   * See issue #4085.
> +   */
> +  SVN_ERR(svn_wc__node_get_base(&kind, NULL, NULL,
> +                                &repos_root_url, &repos_uuid,
> +                                NULL, ctx->wc_ctx, local_abspath,
> +                                TRUE, /* ignore_enoent */
> +                                TRUE, /* show hidden */
> +                                pool, pool));
> +  if (kind != svn_node_unknown)
> +    {
> +      const char *wcroot_abspath;
> +      const char *defining_wcroot_abspath;
> +
> +      SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath, ctx->wc_ctx,
> +                                 local_abspath, pool, pool));
> +      SVN_ERR(svn_wc__get_wcroot(&defining_wcroot_abspath, ctx->wc_ctx,
> +                                 defining_abspath, pool, pool));
> +      if (strcmp(wcroot_abspath, defining_wcroot_abspath) == 0)
> +        return svn_error_create(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, 
> NULL);
> +    }

Is there any good reason not to have a specific error message here?
Because right now we just get this, e.g., during update after the
offending svn:externals property was committed (both a/b/e and a/b/x are
versioned directories):

$ svn propset svn:externals '^/a/b/e x' a/b
$ svn commit -mm
Sending        a/b

Committed revision 2.
$ svn update
Updating '.':

Fetching external item into 'a/b/x':
svn: warning: W155035: The specified path has an unexpected status

At revision 2.
svn: E205011: Failure occurred processing one or more externals definitions


This error message is not very helpful.

-- Brane

Reply via email to