[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: (resend) [rfc/patch] : #933,#735 import syntax, mkdir -p

From: David Kimdon <dwhedon_at_debian.org>
Date: 2003-06-11 05:52:18 CEST

On Tue, Jun 10, 2003 at 09:57:08AM -0500, cmpilato@collab.net wrote:
> David Kimdon <dwhedon@debian.org> writes:
>
> > I'm resending this patch .... I need something like 'stat()' for
> > the repository, and I believe that this extra error checking in
> > get_ra_editor() does no harm, but maybe I missed something.
>
> Do you mean, you need an RA function that can tell you if something
> exists, and whether that something is a dir or a file?

exactly.

> Have you seen
> RA->check_path()?

yup, and that is what I am using. My question is mostly, "Does this
look safe?" I think it looks good, but another set of eyes would be
appreciated. I have included the chunk in question below.

Index: subversion/libsvn_client/commit.c
===================================================================
--- subversion/libsvn_client/commit.c (revision 6178)
+++ subversion/libsvn_client/commit.c (working copy)
@@ -457,6 +492,8 @@
                svn_boolean_t is_commit,
                apr_pool_t *pool)
 {
+ svn_node_kind_t kind;
+
   /* Get the RA vtable that matches URL. */
   SVN_ERR (svn_ra_init_ra_libs (ra_baton, pool));
   SVN_ERR (svn_ra_get_ra_library (ra_lib, *ra_baton,
@@ -469,6 +506,14 @@
                                         is_commit, !is_commit,
                                         ctx, pool));
 
+ SVN_ERR ((*ra_lib)->check_path (&kind, *session, "", SVN_INVALID_REVNUM,
+ pool));
+
+ if (kind == svn_node_none)
+ return svn_error_createf (SVN_ERR_FS_NO_SUCH_ENTRY, NULL,
+ "the path '%s' does not exist",
+ base_url);
+
   /* Fetch the latest revision if requested. */
   if (latest_rev)
     SVN_ERR ((*ra_lib)->get_latest_revnum (*session, latest_rev, pool));

>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 11 05:53:16 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.