You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Berlin <db...@dberlin.org> on 2005/10/28 19:13:01 UTC

Re: [PATCH]: Use more informative error message when trying to switch to a target path that doesn't exist

On Fri, 2005-10-28 at 14:51 -0400, Daniel Berlin wrote:
> While confusing users is always fun, saying "Cannot replace directory
> from within" when someone attempts and svn switch to a directory path
> that doesn't exist is not very helpful.
> 
> The attached special cases the error for when the target entry is
> non-existent, so that it says "Target path does not exist" instead.
> 
> [[[
> 
>    Use more informative error when trying to deal with a target path
>    that doesn't exist.
> 
>    * subversion/libsvn_repos/reporter.c
>      (drive): Check !t_entry first and give more useful message
>      when it is NULL.
> ]]]
> 
> 

I just found a case where this check fails in some cases (though not in
regression tests).  It seems it needs to be:


+  /* Check if the target path exists first.  */
+  if (!*b->s_operand && !t_entry)
+    return svn_error_create (SVN_ERR_FS_PATH_SYNTAX, NULL,
+                             _("Target path does not exist"));

instead of

+  /* Check if the target path exists first.  */
+  if (!t_entry)
+    return svn_error_create (SVN_ERR_FS_PATH_SYNTAX, NULL,
+                             _("Target path does not exist"));


The patch and CL has been updated accordingly (the broken version was
never checked in).