You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexander Sinyushkin <sa...@tmate.org> on 2006/01/28 10:04:56 UTC

An incorrect error code?

Hello, svn devs. I've got a tag version of the 1.3.0 Subversion source
code. In the 'svn_fs_fs__dag_set_entry' function (both libsvn_fs_base
& libsvn_fs_fs) when a node is an immutable dir you set an
SVN_ERR_FS_NOT_DIRECTORY error code:

  /* Check it's a directory. */
  if (node->kind != svn_node_dir)
    return svn_error_create
      (SVN_ERR_FS_NOT_DIRECTORY, NULL,
       _("Attempted to set entry in non-directory node"));
  
  /* Check it's mutable. */
  if (! svn_fs_fs__dag_check_mutable (node, txn_id))
    return svn_error_create
      (SVN_ERR_FS_NOT_DIRECTORY, NULL,
       _("Attempted to set entry in immutable node"));

The previous check is already reporting of a non-directory node, so,
maybe the next check should set an SVN_ERR_FS_NOT_MUTABLE error code?
I'm not sure if it's so important, but anyway decided to tell you
about this.

-- 
 Alexander                          mailto:sa@tmate.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: An incorrect error code?

Posted by kf...@collab.net.
Alexander Sinyushkin <sa...@tmate.org> writes:
> Hello, svn devs. I've got a tag version of the 1.3.0 Subversion source
> code. In the 'svn_fs_fs__dag_set_entry' function (both libsvn_fs_base
> & libsvn_fs_fs) when a node is an immutable dir you set an
> SVN_ERR_FS_NOT_DIRECTORY error code:
> 
>   /* Check it's a directory. */
>   if (node->kind != svn_node_dir)
>     return svn_error_create
>       (SVN_ERR_FS_NOT_DIRECTORY, NULL,
>        _("Attempted to set entry in non-directory node"));
>   
>   /* Check it's mutable. */
>   if (! svn_fs_fs__dag_check_mutable (node, txn_id))
>     return svn_error_create
>       (SVN_ERR_FS_NOT_DIRECTORY, NULL,
>        _("Attempted to set entry in immutable node"));
> 
> The previous check is already reporting of a non-directory node, so,
> maybe the next check should set an SVN_ERR_FS_NOT_MUTABLE error code?
> I'm not sure if it's so important, but anyway decided to tell you
> about this.

Fixed in r18286, thanks for pointing it out.

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org