You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "C. Michael Pilato" <cm...@collab.net> on 2008/04/21 16:51:06 UTC

'svn cat' turning around too many times

I noticed this today (in libsvn_client/cat.c:svn_client_cat2):

   /* Make sure the object isn't a directory. */
   SVN_ERR(svn_ra_check_path(ra_session, "", rev, &url_kind, pool));
   if (url_kind == svn_node_dir)
     return svn_error_createf(SVN_ERR_CLIENT_IS_DIRECTORY, NULL,
                              _("URL '%s' refers to a directory"), url);

   /* Grab some properties we need to know in order to figure out if anything
      special needs to be done with this file. */
   SVN_ERR(svn_ra_get_file(ra_session, "", rev, NULL, NULL, &props, pool));

Do we really need that svn_ra_check_path call (and its associated network 
traffic)?  I mean, it seems svn_ra_get_file() could raise the appropriate 
"this thing isn't a file" error code if asked to operate on a non-file.  Is 
there something I'm overlooking?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: 'svn cat' turning around too many times

Posted by David Glasser <gl...@davidglasser.net>.
On Mon, Apr 21, 2008 at 9:51 AM, C. Michael Pilato <cm...@collab.net> wrote:
> I noticed this today (in libsvn_client/cat.c:svn_client_cat2):
>
>   /* Make sure the object isn't a directory. */
>   SVN_ERR(svn_ra_check_path(ra_session, "", rev, &url_kind, pool));
>   if (url_kind == svn_node_dir)
>     return svn_error_createf(SVN_ERR_CLIENT_IS_DIRECTORY, NULL,
>                              _("URL '%s' refers to a directory"), url);
>
>   /* Grab some properties we need to know in order to figure out if anything
>      special needs to be done with this file. */
>   SVN_ERR(svn_ra_get_file(ra_session, "", rev, NULL, NULL, &props, pool));
>
>  Do we really need that svn_ra_check_path call (and its associated network
> traffic)?  I mean, it seems svn_ra_get_file() could raise the appropriate
> "this thing isn't a file" error code if asked to operate on a non-file.  Is
> there something I'm overlooking?

Well, as long as you make sure that all current implementations of
svn_ra_get_file raise the right error code against all mod_dav_svn and
svnserve versions going back to 1.0, of course.

--dave

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

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

Re: 'svn cat' turning around too many times

Posted by Karl Fogel <kf...@red-bean.com>.
"C. Michael Pilato" <cm...@collab.net> writes:
> I noticed this today (in libsvn_client/cat.c:svn_client_cat2):
>
>   /* Make sure the object isn't a directory. */
>   SVN_ERR(svn_ra_check_path(ra_session, "", rev, &url_kind, pool));
>   if (url_kind == svn_node_dir)
>     return svn_error_createf(SVN_ERR_CLIENT_IS_DIRECTORY, NULL,
>                              _("URL '%s' refers to a directory"), url);
>
>   /* Grab some properties we need to know in order to figure out if anything
>      special needs to be done with this file. */
>   SVN_ERR(svn_ra_get_file(ra_session, "", rev, NULL, NULL, &props, pool));
>
> Do we really need that svn_ra_check_path call (and its associated
> network traffic)?  I mean, it seems svn_ra_get_file() could raise the
> appropriate "this thing isn't a file" error code if asked to operate
> on a non-file.  Is there something I'm overlooking?

Seems reasonable to me.  svn_ra_get_file() doesn't promise a particular
error in the non-file case, but we could fix that, obviously.

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