--- subversion/subversion/libsvn_client/copy.c.orig 2003-07-07 20:39:59.000000000 +0300 +++ subversion/subversion/libsvn_client/copy.c 2003-07-07 22:12:40.000000000 +0300 @@ -321,11 +321,63 @@ /* 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. + * + * We create a subpool and then destroy it if everything is OK, in order + * to free the resources we allocated for this test. + * */ + { + 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; + apr_pool_t * subpool; + + subpool = svn_pool_create(pool); + + SVN_ERR(svn_ra_get_ra_library (&src_ra_lib, ra_baton, src_url, subpool)); + SVN_ERR(svn_ra_get_ra_library (&dest_ra_lib, ra_baton, dst_url, subpool)); + + /* 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, subpool)); + + /* 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, subpool)); + + /* Get the repository uuid of SRC_URL */ + src_err = src_ra_lib->get_uuid(src_sess, &src_uuid, subpool); + 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, subpool); + if (dest_err && dest_err->apr_err != SVN_ERR_RA_NO_REPOS_UUID) + return dest_err; + + /* If the UUIDs are different - throw an error */ + if (strcmp(src_uuid, dest_uuid)) + { + return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL, + "%s", "Copy operation on two different repositories"); + } + svn_pool_destroy(subpool); + } + SVN_ERR (svn_ra_get_ra_library (&ra_lib, ra_baton, top_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 (&sess, ra_lib, top_url,