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

Re: svn commit: r30838 - in branches/1.5.x: . subversion/include subversion/libsvn_client subversion/libsvn_ra subversion/libsvn_ra_neon subversion/svnsync subversion/tests/cmdline subversion/tests/libsvn_ra_local

From: David Glasser <glasser_at_davidglasser.net>
Date: Tue, 29 Apr 2008 13:56:50 -0700

Did people run the new tests on the branch before voting for backport?
 It seems to depend on the new "testing exit codes" stuff and fails
for me. Or am I the only one seeing this?

--dave

On Tue, Apr 29, 2008 at 9:38 AM, <hwright_at_tigris.org> wrote:
> Author: hwright
> Date: Tue Apr 29 09:38:31 2008
> New Revision: 30838
>
> Log:
> Merge r30666, r30684, r30726 from trunk:
>
> * r30666, r30684, r30726
> ra_neon: Cache repository UUID / ra_*: Have update check that it matches.
> Notes: Not strictly necessary for 1.5.0, but would be nice to get
> the new svn_ra_open3() API in if we can. If we do backport,
> make sure to change "New in 1.6" to "New in 1.5", of course.
> r30726 is a trivial compiler-warning change, by the way.
> Votes:
> +1: kfogel, jerenkrantz, arfrever
>
> Modified:
> branches/1.5.x/ (props changed)
> branches/1.5.x/CHANGES (props changed)
> branches/1.5.x/STATUS
> branches/1.5.x/subversion/include/svn_client.h
> branches/1.5.x/subversion/include/svn_error_codes.h
> branches/1.5.x/subversion/include/svn_ra.h
> branches/1.5.x/subversion/libsvn_client/client.h
> branches/1.5.x/subversion/libsvn_client/copy.c
> branches/1.5.x/subversion/libsvn_client/ra.c
> branches/1.5.x/subversion/libsvn_ra/ra_loader.c
> branches/1.5.x/subversion/libsvn_ra_neon/commit.c
> branches/1.5.x/subversion/libsvn_ra_neon/props.c
> branches/1.5.x/subversion/libsvn_ra_neon/ra_neon.h
> branches/1.5.x/subversion/libsvn_ra_neon/session.c
> branches/1.5.x/subversion/svnsync/main.c
> branches/1.5.x/subversion/tests/cmdline/svnadmin_tests.py
> branches/1.5.x/subversion/tests/cmdline/switch_tests.py
> branches/1.5.x/subversion/tests/cmdline/update_tests.py
> branches/1.5.x/subversion/tests/libsvn_ra_local/ra-local-test.c
>
> Merged:
> /trunk:r30666,30684,30726
>
> Modified: branches/1.5.x/STATUS
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/STATUS?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/STATUS Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/STATUS Tue Apr 29 09:38:31 2008 (r30838)
> @@ -35,15 +35,6 @@ Candidate changes:
> Approved changes (all releases):
> ================================
>
> - * r30666, r30684, r30726
> - ra_neon: Cache repository UUID / ra_*: Have update check that it matches.
> - Notes: Not strictly necessary for 1.5.0, but would be nice to get
> - the new svn_ra_open3() API in if we can. If we do backport,
> - make sure to change "New in 1.6" to "New in 1.5", of course.
> - r30726 is a trivial compiler-warning change, by the way.
> - Votes:
> - +1: kfogel, jerenkrantz, arfrever
> -
> * Apply patch at,
> http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=137828
> Fixes compiler warning, which has been introduced while resolving the
>
> Modified: branches/1.5.x/subversion/include/svn_client.h
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/include/svn_client.h?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/include/svn_client.h Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/include/svn_client.h Tue Apr 29 09:38:31 2008 (r30838)
> @@ -4319,7 +4319,7 @@ svn_client_uuid_from_path(const char **u
> *
> * @since New in 1.3.
> *
> - * @note This function is similar to svn_ra_open2(), but the caller avoids
> + * @note This function is similar to svn_ra_open3(), but the caller avoids
> * having to providing its own callback functions.
> */
> svn_error_t *
>
> Modified: branches/1.5.x/subversion/include/svn_error_codes.h
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/include/svn_error_codes.h?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/include/svn_error_codes.h Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/include/svn_error_codes.h Tue Apr 29 09:38:31 2008 (r30838)
> @@ -739,6 +739,11 @@ SVN_ERROR_START
> SVN_ERR_RA_CATEGORY_START + 8,
> "Server can only replay from the root of a repository")
>
> + /** @since New in 1.5. */
> + SVN_ERRDEF(SVN_ERR_RA_UUID_MISMATCH,
> + SVN_ERR_RA_CATEGORY_START + 9,
> + "Repository UUID does not match expected UUID")
> +
> /* ra_dav errors */
>
> SVN_ERRDEF(SVN_ERR_RA_DAV_SOCK_INIT,
>
> Modified: branches/1.5.x/subversion/include/svn_ra.h
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/include/svn_ra.h?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/include/svn_ra.h Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/include/svn_ra.h Tue Apr 29 09:38:31 2008 (r30838)
> @@ -57,7 +57,7 @@ const svn_version_t *svn_ra_version(void
> * @a close_baton as appropriate.
> *
> * @a path is relative to the "root" of the session, defined by the
> - * @a repos_url passed to svn_ra_open2() vtable call.
> + * @a repos_URL passed to svn_ra_open3() vtable call.
> *
> * @a name is the name of the property to fetch. If the property is present,
> * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
> @@ -284,7 +284,7 @@ typedef struct svn_ra_reporter3_t
> * implementor should assume the directory has no entries or props.
> *
> * This will *override* any previous set_path() calls made on parent
> - * paths. @a path is relative to the URL specified in svn_ra_open2().
> + * paths. @a path is relative to the URL specified in svn_ra_open3().
> *
> * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
> *
> @@ -435,7 +435,7 @@ typedef struct svn_ra_reporter_t
> /** A collection of callbacks implemented by libsvn_client which allows
> * an RA layer to "pull" information from the client application, or
> * possibly store information. libsvn_client passes this vtable to
> - * svn_ra_open2().
> + * svn_ra_open3().
> *
> * Each routine takes a @a callback_baton originally provided with the
> * vtable.
> @@ -571,6 +571,9 @@ typedef struct svn_ra_session_t svn_ra_s
> * Open a repository session to @a repos_URL. Return an opaque object
> * representing this session in @a *session_p, allocated in @a pool.
> *
> + * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
> + * to the UUID of the repository at @c repos_URL.
> + *
> * @a callbacks/@a callback_baton is a table of callbacks provided by the
> * client; see @c svn_ra_callbacks2_t.
> *
> @@ -583,7 +586,22 @@ typedef struct svn_ra_session_t svn_ra_s
> *
> * @see svn_client_open_ra_session().
> *
> + * @since New in 1.6.
> + */
> +svn_error_t *
> +svn_ra_open3(svn_ra_session_t **session_p,
> + const char *repos_URL,
> + const char *uuid,
> + const svn_ra_callbacks2_t *callbacks,
> + void *callback_baton,
> + apr_hash_t *config,
> + apr_pool_t *pool);
> +
> +/**
> + * Similiar to svn_ra_open3(), but with @a uuid set to @c NULL.
> + *
> * @since New in 1.3.
> + * @deprecated Provided for backward compatibility with the 1.4 API.
> */
> svn_error_t *
> svn_ra_open2(svn_ra_session_t **session_p,
>
> Modified: branches/1.5.x/subversion/libsvn_client/client.h
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_client/client.h?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_client/client.h Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_client/client.h Tue Apr 29 09:38:31 2008 (r30838)
> @@ -369,11 +369,11 @@ svn_client__default_walker_error_handler
> #define SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx) \
> ((ctx)->log_msg_func3 || (ctx)->log_msg_func2 || (ctx)->log_msg_func)
>
> -/* This is the baton that we pass svn_ra_open2(), and is associated with
> +/* This is the baton that we pass svn_ra_open3(), and is associated with
> the callback table we provide to RA. */
> typedef struct
> {
> - /* Holds the directory that corresponds to the REPOS_URL at svn_ra_open2()
> + /* Holds the directory that corresponds to the REPOS_URL at svn_ra_open3()
> time. When callbacks specify a relative path, they are joined with
> this base directory. */
> const char *base_dir;
>
> Modified: branches/1.5.x/subversion/libsvn_client/copy.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_client/copy.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_client/copy.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_client/copy.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -749,7 +749,7 @@ repos_to_repos_copy(svn_commit_info_t **
> ctx, pool);
>
> /* If the two URLs appear not to be in the same repository, then
> - top_url will be empty and the call to svn_ra_open2()
> + top_url will be empty and the call to svn_ra_open3()
> above will have failed. Below we check for that, and propagate a
> descriptive error back to the user.
>
>
> Modified: branches/1.5.x/subversion/libsvn_client/ra.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_client/ra.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_client/ra.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_client/ra.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -291,6 +291,7 @@ svn_client__open_ra_session_internal(svn
> {
> svn_ra_callbacks2_t *cbtable = apr_pcalloc(pool, sizeof(*cbtable));
> svn_client__callback_baton_t *cb = apr_pcalloc(pool, sizeof(*cb));
> + const char *uuid = NULL;
>
> cbtable->open_tmp_file = use_admin ? open_admin_tmp_file : open_tmp_file;
> cbtable->get_wc_prop = use_admin ? get_wc_prop : NULL;
> @@ -310,7 +311,17 @@ svn_client__open_ra_session_internal(svn
> cb->commit_items = commit_items;
> cb->ctx = ctx;
>
> - SVN_ERR(svn_ra_open2(ra_session, base_url, cbtable, cb,
> + if (base_access)
> + {
> + const svn_wc_entry_t *entry;
> +
> + SVN_ERR(svn_wc_entry(&entry, base_dir, base_access, FALSE, pool));
> +
> + if (entry && entry->uuid)
> + uuid = entry->uuid;
> + }
> +
> + SVN_ERR(svn_ra_open3(ra_session, base_url, uuid, cbtable, cb,
> ctx->config, pool));
>
> return SVN_NO_ERROR;
>
> Modified: branches/1.5.x/subversion/libsvn_ra/ra_loader.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_ra/ra_loader.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_ra/ra_loader.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_ra/ra_loader.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -50,7 +50,7 @@
>
> /* ### This file maps URL schemes to particular RA libraries.
> ### Currently, the only pair of RA libraries which support the same
> - ### protocols are neon and serf. svn_ra_open2 makes the assumption
> + ### protocols are neon and serf. svn_ra_open3 makes the assumption
> ### that this is the case; that their 'schemes' fields are both
> ### dav_schemes; and that "neon" is listed first.
>
> @@ -378,8 +378,9 @@ svn_ra_create_callbacks(svn_ra_callbacks
> return SVN_NO_ERROR;
> }
>
> -svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
> +svn_error_t *svn_ra_open3(svn_ra_session_t **session_p,
> const char *repos_URL,
> + const char *uuid,
> const svn_ra_callbacks2_t *callbacks,
> void *callback_baton,
> apr_hash_t *config,
> @@ -468,10 +469,37 @@ svn_error_t *svn_ra_open2(svn_ra_session
> SVN_ERR(vtable->open_session(session, repos_URL, callbacks, callback_baton,
> config, pool));
>
> + /* Check the UUID. */
> + if (uuid)
> + {
> + const char *repository_uuid;
> +
> + SVN_ERR(vtable->get_uuid(session, &repository_uuid, pool));
> +
> + if (strcmp(uuid, repository_uuid) != 0)
> + {
> + return svn_error_createf(SVN_ERR_RA_UUID_MISMATCH, NULL,
> + _("Repository UUID '%s' doesn't match "
> + "expected UUID '%s'"),
> + repository_uuid, uuid);
> + }
> + }
> +
> *session_p = session;
> return SVN_NO_ERROR;
> }
>
> +svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
> + const char *repos_URL,
> + const svn_ra_callbacks2_t *callbacks,
> + void *callback_baton,
> + apr_hash_t *config,
> + apr_pool_t *pool)
> +{
> + return svn_ra_open3(session_p, repos_URL, NULL,
> + callbacks, callback_baton, config, pool);
> +}
> +
> svn_error_t *svn_ra_open(svn_ra_session_t **session_p,
> const char *repos_URL,
> const svn_ra_callbacks_t *callbacks,
>
> Modified: branches/1.5.x/subversion/libsvn_ra_neon/commit.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_ra_neon/commit.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_ra_neon/commit.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_ra_neon/commit.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -1371,7 +1371,7 @@ static svn_error_t * apply_revprops(comm
> apr_hash_t *revprop_table,
> apr_pool_t *pool)
> {
> - const svn_string_t *vcc;
> + const char *vcc;
> const svn_string_t *baseline_url;
> version_rsrc_t baseline_rsrc = { SVN_INVALID_REVNUM };
> svn_error_t *err = NULL;
> @@ -1381,8 +1381,7 @@ static svn_error_t * apply_revprops(comm
> ### REPORT when that is available on the server. */
>
> /* fetch the DAV:version-controlled-configuration from the session's URL */
> - SVN_ERR(svn_ra_neon__get_one_prop(&vcc, cc->ras, cc->ras->root.path,
> - NULL, &svn_ra_neon__vcc_prop, pool));
> + SVN_ERR(svn_ra_neon__get_vcc(&vcc, cc->ras, cc->ras->root.path, pool));
>
> /* ### we should use DAV:apply-to-version on the CHECKOUT so we can skip
> ### retrieval of the baseline */
> @@ -1394,7 +1393,7 @@ static svn_error_t * apply_revprops(comm
> /* Get the latest baseline from VCC's DAV:checked-in property.
> This should give us the HEAD revision of the moment. */
> SVN_ERR(svn_ra_neon__get_one_prop(&baseline_url, cc->ras,
> - vcc->data, NULL,
> + vcc, NULL,
> &svn_ra_neon__checked_in_prop, pool));
> baseline_rsrc.pool = pool;
> baseline_rsrc.vsn_url = baseline_url->data;
>
> Modified: branches/1.5.x/subversion/libsvn_ra_neon/props.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_ra_neon/props.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_ra_neon/props.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_ra_neon/props.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -638,8 +638,32 @@ svn_error_t * svn_ra_neon__get_starting_
> const char *label,
> apr_pool_t *pool)
> {
> - return svn_ra_neon__get_props_resource(rsrc, sess, url, label, starting_props,
> - pool);
> + svn_string_t *propval;
> +
> + SVN_ERR(svn_ra_neon__get_props_resource(rsrc, sess, url, label,
> + starting_props, pool));
> +
> + /* Cache some of the resource information. */
> +
> + if (! sess->vcc)
> + {
> + propval = apr_hash_get((*rsrc)->propset,
> + SVN_RA_NEON__PROP_VCC,
> + APR_HASH_KEY_STRING);
> + if (propval)
> + sess->vcc = apr_pstrdup(sess->pool, propval->data);
> + }
> +
> + if (! sess->uuid)
> + {
> + propval = apr_hash_get((*rsrc)->propset,
> + SVN_RA_NEON__PROP_REPOSITORY_UUID,
> + APR_HASH_KEY_STRING);
> + if (propval)
> + sess->uuid = apr_pstrdup(sess->pool, propval->data);
> + }
> +
> + return SVN_NO_ERROR;
> }
>
>
> @@ -747,9 +771,13 @@ svn_error_t *svn_ra_neon__get_vcc(const
> {
> svn_ra_neon__resource_t *rsrc;
> const char *lopped_path;
> - const svn_string_t *vcc_s;
>
> - /* ### Someday, possibly look for memory-cached VCC in the RA session. */
> + /* Look for memory-cached VCC in the RA session. */
> + if (sess->vcc)
> + {
> + *vcc = sess->vcc;
> + return SVN_NO_ERROR;
> + }
>
> /* ### Someday, possibly look for disk-cached VCC via get_wcprop callback. */
>
> @@ -757,14 +785,15 @@ svn_error_t *svn_ra_neon__get_vcc(const
> SVN_ERR(svn_ra_neon__search_for_starting_props(&rsrc, &lopped_path,
> sess, url, pool));
>
> - vcc_s = apr_hash_get(rsrc->propset,
> - SVN_RA_NEON__PROP_VCC, APR_HASH_KEY_STRING);
> - if (! vcc_s)
> - return svn_error_create(APR_EGENERAL, NULL,
> - _("The VCC property was not found on the "
> - "resource"));
> + if (! sess->vcc)
> + {
> + /* ### better error reporting... */
> + return svn_error_create(APR_EGENERAL, NULL,
> + _("The VCC property was not found on the "
> + "resource"));
> + }
>
> - *vcc = vcc_s->data;
> + *vcc = sess->vcc;
> return SVN_NO_ERROR;
> }
>
> @@ -778,7 +807,7 @@ svn_error_t *svn_ra_neon__get_baseline_p
> apr_pool_t *pool)
> {
> svn_ra_neon__resource_t *rsrc;
> - const svn_string_t *vcc;
> + const char *vcc;
> const svn_string_t *relative_path;
> const char *my_bc_relative;
> const char *lopped_path;
> @@ -809,7 +838,7 @@ svn_error_t *svn_ra_neon__get_baseline_p
> SVN_ERR(svn_ra_neon__search_for_starting_props(&rsrc, &lopped_path,
> sess, url, pool));
>
> - vcc = apr_hash_get(rsrc->propset, SVN_RA_NEON__PROP_VCC, APR_HASH_KEY_STRING);
> + SVN_ERR(svn_ra_neon__get_vcc(&vcc, sess, url, pool));
> if (vcc == NULL)
> {
> /* ### better error reporting... */
> @@ -881,7 +910,7 @@ svn_error_t *svn_ra_neon__get_baseline_p
> /* Get the Baseline from the DAV:checked-in value, then fetch its
> DAV:baseline-collection property. */
> /* ### should wrap this with info about rsrc==VCC */
> - SVN_ERR(svn_ra_neon__get_one_prop(&baseline, sess, vcc->data, NULL,
> + SVN_ERR(svn_ra_neon__get_one_prop(&baseline, sess, vcc, NULL,
> &svn_ra_neon__checked_in_prop, pool));
>
> /* ### do we want to optimize the props we fetch, based on what the
> @@ -902,7 +931,7 @@ svn_error_t *svn_ra_neon__get_baseline_p
>
> /* ### do we want to optimize the props we fetch, based on what the
> ### user asked for? i.e. omit version-name if latest_rev is NULL */
> - SVN_ERR(svn_ra_neon__get_props_resource(&rsrc, sess, vcc->data, label,
> + SVN_ERR(svn_ra_neon__get_props_resource(&rsrc, sess, vcc, label,
> which_props, pool));
> }
>
> @@ -982,8 +1011,8 @@ svn_error_t *svn_ra_neon__get_baseline_i
> const char *full_bc_url = svn_path_url_add_component(my_bc_url->data,
> my_bc_rel.data,
> pool);
> - SVN_ERR(svn_ra_neon__get_props_resource(&rsrc, sess, full_bc_url,
> - NULL, starting_props, pool));
> + SVN_ERR(svn_ra_neon__get_starting_props(&rsrc, sess, full_bc_url,
> + NULL, pool));
> *is_dir = rsrc->is_collection;
> }
>
>
> Modified: branches/1.5.x/subversion/libsvn_ra_neon/ra_neon.h
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_ra_neon/ra_neon.h?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_ra_neon/ra_neon.h Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_ra_neon/ra_neon.h Tue Apr 29 09:38:31 2008 (r30838)
> @@ -98,6 +98,10 @@ typedef struct {
> svn_auth_iterstate_t *p11pin_iterstate; /* state of PKCS#11 pin retries */
>
> svn_boolean_t compression; /* should we use http compression? */
> +
> + /* Both of these function as caches, and are NULL when uninitialized
> + or cleared: */
> + const char *vcc; /* version-controlled-configuration */
> const char *uuid; /* repository UUID */
>
> svn_ra_progress_notify_func_t progress_func;
> @@ -423,7 +427,10 @@ svn_error_t * svn_ra_neon__get_props_res
> const ne_propname *which_props,
> apr_pool_t *pool);
>
> -/* fetch a single resource's starting props from the server. */
> +/* fetch a single resource's starting props from the server.
> +
> + Cache the version-controlled-configuration in SESS->vcc, and the
> + repository uuid in SESS->uuid. */
> svn_error_t * svn_ra_neon__get_starting_props(svn_ra_neon__resource_t **rsrc,
> svn_ra_neon__session_t *sess,
> const char *url,
> @@ -437,7 +444,10 @@ svn_error_t * svn_ra_neon__get_starting_
>
> Also return *MISSING_PATH (allocated in POOL), which is the
> trailing portion of the URL that did not exist. If an error
> - occurs, *MISSING_PATH isn't changed. */
> + occurs, *MISSING_PATH isn't changed.
> +
> + Cache the version-controlled-configuration in SESS->vcc, and the
> + repository uuid in SESS->uuid. */
> svn_error_t *
> svn_ra_neon__search_for_starting_props(svn_ra_neon__resource_t **rsrc,
> const char **missing_path,
>
> Modified: branches/1.5.x/subversion/libsvn_ra_neon/session.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/libsvn_ra_neon/session.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/libsvn_ra_neon/session.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/libsvn_ra_neon/session.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -1133,6 +1133,8 @@ svn_ra_neon__open(svn_ra_session_t *sess
> ras->progress_baton = callbacks->progress_baton;
> ras->progress_func = callbacks->progress_func;
> ras->capabilities = apr_hash_make(ras->pool);
> + ras->vcc = NULL;
> + ras->uuid = NULL;
> /* save config and server group in the auth parameter hash */
> svn_auth_set_parameter(ras->callbacks->auth_baton,
> SVN_AUTH_PARAM_CONFIG, cfg);
> @@ -1313,31 +1315,24 @@ static svn_error_t *svn_ra_neon__do_get_
> {
> svn_ra_neon__resource_t *rsrc;
> const char *lopped_path;
> - const svn_string_t *uuid_propval;
>
> SVN_ERR(svn_ra_neon__search_for_starting_props(&rsrc, &lopped_path,
> ras, ras->url->data,
> pool));
> SVN_ERR(svn_ra_neon__maybe_store_auth_info(ras, pool));
>
> - uuid_propval = apr_hash_get(rsrc->propset,
> - SVN_RA_NEON__PROP_REPOSITORY_UUID,
> - APR_HASH_KEY_STRING);
> - if (uuid_propval == NULL)
> - /* ### better error reporting... */
> - return svn_error_create(APR_EGENERAL, NULL,
> - _("The UUID property was not found on the "
> - "resource or any of its parents"));
> -
> - if (uuid_propval && (uuid_propval->len > 0))
> - ras->uuid = apr_pstrdup(ras->pool, uuid_propval->data); /* cache */
> - else
> - return svn_error_create
> - (SVN_ERR_RA_NO_REPOS_UUID, NULL,
> - _("Please upgrade the server to 0.19 or later"));
> + if (! ras->uuid)
> + {
> + /* ### better error reporting... */
> + return svn_error_create(APR_EGENERAL, NULL,
> + _("The UUID property was not found on the "
> + "resource or any of its parents"));
> + }
> }
>
> + /* search_for_starting_props() filled it. */
> *uuid = ras->uuid;
> +
> return SVN_NO_ERROR;
> }
>
>
> Modified: branches/1.5.x/subversion/svnsync/main.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/svnsync/main.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/svnsync/main.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/svnsync/main.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -619,7 +619,7 @@ do_initialize(svn_ra_session_t *to_sessi
>
> /* Now fill in our bookkeeping info in the dest repository. */
>
> - SVN_ERR(svn_ra_open2(&from_session, baton->from_url,
> + SVN_ERR(svn_ra_open3(&from_session, baton->from_url, NULL,
> &(baton->source_callbacks), baton,
> baton->config, pool));
> SVN_ERR(svn_ra_get_repos_root2(from_session, &root_url, pool));
> @@ -703,8 +703,8 @@ initialize_cmd(apr_getopt_t *os, void *b
> _("Path '%s' is not a URL"), from_url);
>
> baton = make_subcommand_baton(opt_baton, to_url, from_url, 0, 0, pool);
> - SVN_ERR(svn_ra_open2(&to_session, baton->to_url, &(baton->sync_callbacks),
> - baton, baton->config, pool));
> + SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
> + &(baton->sync_callbacks), baton, baton->config, pool));
> SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
> SVN_ERR(with_locked(to_session, do_initialize, baton, pool));
>
> @@ -1109,7 +1109,6 @@ open_source_session(svn_ra_session_t **f
> apr_pool_t *pool)
> {
> svn_string_t *from_url, *from_uuid;
> - const char *uuid;
>
> SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_FROM_URL,
> &from_url, pool));
> @@ -1124,19 +1123,8 @@ open_source_session(svn_ra_session_t **f
> _("Destination repository has not been initialized"));
>
> /* Open the session to copy the revision data. */
> - SVN_ERR(svn_ra_open2(from_session, from_url->data, callbacks, baton,
> - config, pool));
> -
> - /* Ok, now sanity check the UUID of the source repository, it
> - wouldn't be a good thing to sync from a different repository. */
> -
> - SVN_ERR(svn_ra_get_uuid2(*from_session, &uuid, pool));
> -
> - if (strcmp(uuid, from_uuid->data) != 0)
> - return svn_error_createf(APR_EINVAL, NULL,
> - _("UUID of source repository (%s) does not "
> - "match expected UUID (%s)"),
> - uuid, from_uuid->data);
> + SVN_ERR(svn_ra_open3(from_session, from_url->data, from_uuid->data,
> + callbacks, baton, config, pool));
>
> return SVN_NO_ERROR;
> }
> @@ -1514,8 +1502,8 @@ synchronize_cmd(apr_getopt_t *os, void *
> _("Path '%s' is not a URL"), to_url);
>
> baton = make_subcommand_baton(opt_baton, to_url, NULL, 0, 0, pool);
> - SVN_ERR(svn_ra_open2(&to_session, baton->to_url, &(baton->sync_callbacks),
> - baton, baton->config, pool));
> + SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
> + &(baton->sync_callbacks), baton, baton->config, pool));
> SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
> SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
>
> @@ -1665,8 +1653,8 @@ copy_revprops_cmd(apr_getopt_t *os, void
>
> baton = make_subcommand_baton(opt_baton, to_url, NULL,
> start_rev, end_rev, pool);
> - SVN_ERR(svn_ra_open2(&to_session, baton->to_url, &(baton->sync_callbacks),
> - baton, baton->config, pool));
> + SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
> + &(baton->sync_callbacks), baton, baton->config, pool));
> SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
> SVN_ERR(with_locked(to_session, do_copy_revprops, baton, pool));
>
>
> Modified: branches/1.5.x/subversion/tests/cmdline/svnadmin_tests.py
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/tests/cmdline/svnadmin_tests.py?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/tests/cmdline/svnadmin_tests.py Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/tests/cmdline/svnadmin_tests.py Tue Apr 29 09:38:31 2008 (r30838)
> @@ -202,7 +202,8 @@ def extra_headers(sbox):
> dumpfile[3:3] = \
> [ "X-Comment-Header: Ignored header normally not in dump stream\n" ]
>
> - load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile)
> + load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
> + '--ignore-uuid')
>
> #----------------------------------------------------------------------
> # Ensure loading continues after skipping a bit of unknown extra content.
> @@ -220,7 +221,8 @@ def extra_blockcontent(sbox):
> # Insert the extra content after "PROPS-END\n"
> dumpfile[11] = dumpfile[11][:-2] + "extra text\n\n\n"
>
> - load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile)
> + load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
> + '--ignore-uuid')
>
> #----------------------------------------------------------------------
> def inconsistent_headers(sbox):
> @@ -252,7 +254,8 @@ def empty_date(sbox):
> "K 7\nsvn:log\nV 0\n\nK 10\nsvn:author\nV 4\nerik\nPROPS-END\n\n\n"
> ]
>
> - load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile)
> + load_and_verify_dumpstream(sbox,[],[], dumpfile_revisions, dumpfile,
> + '--ignore-uuid')
>
> # Verify that the revision still lacks the svn:date property.
> svntest.actions.run_and_verify_svn(None, [], [], "propget",
>
> Modified: branches/1.5.x/subversion/tests/cmdline/switch_tests.py
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/tests/cmdline/switch_tests.py?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/tests/cmdline/switch_tests.py Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/tests/cmdline/switch_tests.py Tue Apr 29 09:38:31 2008 (r30838)
> @@ -1065,7 +1065,7 @@ def switch_change_repos_root(sbox):
>
> svntest.main.create_repos(other_repo_dir)
> svntest.actions.run_and_verify_svn(None, None,
> - ".*not the same repository.*",
> + ".*UUID.*",
> 'switch',
> other_A_url, A_wc_dir)
>
>
> Modified: branches/1.5.x/subversion/tests/cmdline/update_tests.py
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/tests/cmdline/update_tests.py?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/tests/cmdline/update_tests.py Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/tests/cmdline/update_tests.py Tue Apr 29 09:38:31 2008 (r30838)
> @@ -3814,6 +3814,45 @@ interactive-conflicts = true
> '-r1', wc_dir)
>
>
> +#----------------------------------------------------------------------
> +
> +
> +def update_uuid_changed(sbox):
> + "update fails when repos uuid changed"
> +
> + def wc_uuid(wc_dir):
> + "Return the UUID of the working copy at WC_DIR."
> +
> + exit_code, output, errput = svntest.main.run_svn(None, 'info', wc_dir)
> + if errput:
> + raise svntest.verify.SVNUnexpectedStderr(errput)
> +
> + for line in output:
> + if line.startswith('Repository UUID:'):
> + return line[17:].rstrip()
> +
> + # No 'Repository UUID' line in 'svn info'?
> + raise svntest.verify.SVNUnexpectedStdout(output)
> +
> + sbox.build(read_only = True)
> + wc_dir = sbox.wc_dir
> + repo_dir = sbox.repo_dir
> +
> + uuid_before = wc_uuid(wc_dir)
> +
> + # Change repository's uuid.
> + svntest.actions.run_and_verify_svnadmin(None, None, [],
> + 'setuuid', repo_dir)
> +
> + # 'update' detected the new uuid...
> + svntest.actions.run_and_verify_svn(None, None, '.*UUID.*',
> + 'update', wc_dir)
> +
> + # ...and didn't overwrite the old uuid.
> + uuid_after = wc_uuid(wc_dir)
> + if uuid_before != uuid_after:
> + raise svntest.Failure
> +
>
> #######################################################################
> # Run the tests
> @@ -3867,6 +3906,7 @@ test_list = [ None,
> update_copied_and_deleted_prop,
> update_accept_conflicts,
> eof_in_interactive_conflict_resolver,
> + update_uuid_changed,
> ]
>
> if __name__ == '__main__':
>
> Modified: branches/1.5.x/subversion/tests/libsvn_ra_local/ra-local-test.c
> URL: http://svn.collab.net/viewvc/svn/branches/1.5.x/subversion/tests/libsvn_ra_local/ra-local-test.c?pathrev=30838&r1=30837&r2=30838
> ==============================================================================
> --- branches/1.5.x/subversion/tests/libsvn_ra_local/ra-local-test.c Tue Apr 29 09:08:33 2008 (r30837)
> +++ branches/1.5.x/subversion/tests/libsvn_ra_local/ra-local-test.c Tue Apr 29 09:38:31 2008 (r30838)
> @@ -99,8 +99,9 @@ make_and_open_local_repos(svn_ra_session
>
> SVN_ERR(current_directory_url(&url, repos_name, pool));
>
> - SVN_ERR(svn_ra_open2(session,
> + SVN_ERR(svn_ra_open3(session,
> url,
> + NULL,
> cbtable,
> NULL,
> NULL,
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>
>

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-29 22:57:09 CEST

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.