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

Re: [PATCH] Issue 1313 - svn copy URL1 URL2 fails silently

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-07-07 20:55:32 CEST

Shlomi Fish <shlomif@vipe.stud.technion.ac.il> writes:

> Here's a patch for this issue. I hope I got it right.

No log message.

> --- subversion/subversion/libsvn_client/copy.c.orig 2003-07-07 20:39:59.000000000 +0300
> +++ subversion/subversion/libsvn_client/copy.c 2003-07-07 21:13:17.000000000 +0300

Hmm, you don't appear to be using 'svn diff'. Any reason for that?

> @@ -321,11 +321,55 @@
>
> /* 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, top_url, pool));
>
> /* Get the auth dir. */
> SVN_ERR (svn_client__dir_if_wc (&auth_dir, "", pool));
>
> + /* This entire code block is meant to find out if the user is attempting
> + * a cross-repository copy, which is not supported yet.*/
> + {
> + svn_ra_plugin_t * src_ra_lib, * dest_ra_lib;
> + const char * src_uuid = NULL, * dest_uuid = NULL;
> + svn_error_t * src_err, *dest_err;
> + void * src_sess, * dest_sess;
> +
> + SVN_ERR(svn_ra_get_ra_library (&src_ra_lib, ra_baton, src_url, pool));
> + SVN_ERR(svn_ra_get_ra_library (&dest_ra_lib, ra_baton, dst_url, pool));
> +
> + /* Open an RA session for the URL. Note that we don't have a local
> + directory, nor a place to put temp files or store the auth data. */
> + SVN_ERR (svn_client__open_ra_session (&src_sess, src_ra_lib, src_url,
> + auth_dir,
> + NULL, NULL, FALSE, TRUE,
> + ctx, pool));
> +
> + /* Open an RA session for the URL. Note that we don't have a local
> + directory, nor a place to put temp files or store the auth data. */
> + SVN_ERR (svn_client__open_ra_session (&dest_sess, dest_ra_lib, dst_url,
> + auth_dir,
> + NULL, NULL, FALSE, TRUE,
> + ctx, pool));
> +
> + /* Get the repository uuid of SRC_URL */
> + src_err = src_ra_lib->get_uuid(src_sess, &src_uuid, pool);
> + if (src_err && src_err->apr_err != SVN_ERR_RA_NO_REPOS_UUID)
> + return src_err;
> +
> + /* Get the repository uuid of DEST_URL */
> + dest_err = dest_ra_lib->get_uuid(dest_sess, &dest_uuid, pool);
> + if (dest_err && dest_err->apr_err != SVN_ERR_RA_NO_REPOS_UUID)
> + return dest_err;

This looks a wrong to me. At present an URL to URL copy uses a single
RA session because only copies within a repository are supported.
Your patch introduces the overhead of two additional RA sessions just
to handle an error case. For those cases where there is no error
(which is likely to be the common case) three RA sessions will be
opened onto the same repository.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 7 20:56:28 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.