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

RE: svn commit: r38192 - in trunk/subversion: libsvn_wc tests/libsvn_wc

From: Bert Huijben <rhuijben_at_sharpsvn.net>
Date: Thu, 25 Jun 2009 00:09:52 +0200

> -----Original Message-----
> From: Hyrum K. Wright [mailto:hyrum_at_hyrumwright.org]
> Sent: woensdag 24 juni 2009 23:43
> To: svn_at_subversion.tigris.org
> Subject: svn commit: r38192 - in trunk/subversion: libsvn_wc
> tests/libsvn_wc
>
> Author: hwright
> Date: Wed Jun 24 14:43:19 2009
> New Revision: 38192
>
> Log:
> Adapt the wc_db relocate API for our current db-per-dir paradigm (with
> nice
> breadcrumbs as to how to get back to the "right" way).
>
> * subversion/tests/libsvn_wc/db-test.c
> (test_global_relocate): Run the API in "centralized" mode.
>
> * subversion/libsvn_wc/wc_db.c
> (relocate_txn): Ensure parent URLs are proper subdirs in a select
> statement.
> (svn_wc__db_global_relocate): Recurse over the subdirs, if run in
> "db-per-dir" mode.
>
> * subversion/libsvn_wc/wc_db.h
> (svn_wc__db_check_node): Update param list and docs.
>
> Modified:
> trunk/subversion/libsvn_wc/wc_db.c
> trunk/subversion/libsvn_wc/wc_db.h
> trunk/subversion/tests/libsvn_wc/db-test.c
>
> Modified: trunk/subversion/libsvn_wc/wc_db.c
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/wc_db.c?pat
> hrev=38192&r1=38191&r2=38192
> =======================================================================
> =======
> --- trunk/subversion/libsvn_wc/wc_db.c Wed Jun 24 14:35:55 2009
> (r38191)
> +++ trunk/subversion/libsvn_wc/wc_db.c Wed Jun 24 14:43:19 2009
> (r38192)
> @@ -25,6 +25,7 @@
> #include "svn_dirent_uri.h"
> #include "svn_wc.h"
> #include "svn_checksum.h"
> +#include "svn_pools.h"
>
> #include "wc.h"
> #include "wc_db.h"
> @@ -3118,7 +3119,7 @@ relocate_txn(void *baton, svn_sqlite__db
> SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
>
> STMT_UPDATE_WORKING_CHILDREN_COPYFROM_REPO));
> SVN_ERR(svn_sqlite__bindf(stmt, "isi", rb->wc_id,
> - apr_psprintf(scratch_pool, "%s%%",
> + apr_psprintf(scratch_pool, "%s/%%",
> rb->local_relpath),

How does this handle urls containing '%' (The standard escape character in
urls)?

        Bert

> new_repos_id));
> SVN_ERR(svn_sqlite__step_done(stmt));
> @@ -3139,7 +3140,7 @@ relocate_txn(void *baton, svn_sqlite__db
> STMT_UPDATE_LOCK_REPOS_ID));
> SVN_ERR(svn_sqlite__bindf(stmt, "isi",
> rb->old_repos_id,
> - apr_psprintf(scratch_pool, "%s%%",
> + apr_psprintf(scratch_pool, "%s/%%",
> rb->repos_relpath),

Same question.

> new_repos_id));
> SVN_ERR(svn_sqlite__step_done(stmt));
> @@ -3153,6 +3154,7 @@ svn_error_t *
> svn_wc__db_global_relocate(svn_wc__db_t *db,
> const char *local_dir_abspath,
> const char *repos_root_url,
> + svn_boolean_t single_db, /* ### */
> apr_pool_t *scratch_pool)
> {
> svn_wc__db_pdh_t *pdh;
> @@ -3196,8 +3198,51 @@ svn_wc__db_global_relocate(svn_wc__db_t
> rb.repos_root_url = repos_root_url;
> rb.scratch_pool = scratch_pool;
>
> - return svn_error_return(svn_sqlite__with_transaction(pdh->wcroot-
> >sdb,
> - relocate_txn,
> &rb));
> + SVN_ERR(svn_sqlite__with_transaction(pdh->wcroot->sdb, relocate_txn,
> &rb));
> +
> + if (!single_db)
> + {
> + /* ### Now, a bit of a dance because we don't yet have a
> centralized
> + metadata store. We need to update the repos_id in the
> databases
> + of subdirectories. */
> + apr_pool_t *iterpool;
> + const apr_array_header_t *children;
> + int i;
> +
> + iterpool = svn_pool_create(scratch_pool);
> + SVN_ERR(svn_wc__db_read_children(&children, db,
> local_dir_abspath,
> + scratch_pool, iterpool));
> +
> + for (i = 0; i < children->nelts; i++)
> + {
> + const char *child = APR_ARRAY_IDX(children, i, const char
> *);
> + const char *child_abspath;
> + svn_wc__db_kind_t kind;
> +
> + svn_pool_clear(iterpool);
> +
> + child_abspath = svn_dirent_join(local_dir_abspath, child,
> iterpool);
> + SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL,
> + NULL, NULL, NULL,
> + NULL, NULL, NULL,
> + NULL, NULL, NULL,
> + NULL, NULL, NULL,
> + NULL, NULL, NULL, NULL,
> + NULL, NULL, NULL, NULL,
> + db, child_abspath,
> + iterpool, iterpool));
> + if (kind != svn_wc__db_kind_dir)
> + continue;
> +
> + /* Recurse on the child directory */
> + SVN_ERR(svn_wc__db_global_relocate(db, child_abspath,
> repos_root_url,
> + single_db, iterpool));
> + }
> +
> + svn_pool_destroy(iterpool);
> + }
> +
> + return SVN_NO_ERROR;
> }
>
>
>
> Modified: trunk/subversion/libsvn_wc/wc_db.h
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/wc_db.h?pat
> hrev=38192&r1=38191&r2=38192
> =======================================================================
> =======
> --- trunk/subversion/libsvn_wc/wc_db.h Wed Jun 24 14:35:55 2009
> (r38191)
> +++ trunk/subversion/libsvn_wc/wc_db.h Wed Jun 24 14:43:19 2009
> (r38192)
> @@ -1214,11 +1214,15 @@ svn_wc__db_check_node(svn_wc__db_kind_t
> *
> * ### Assuming the future ability to copy across repositories, should
> we
> * ### refrain from resetting the copyfrom information in this
> operation?
> + *
> + * ### SINGLE_DB is a temp argument, and should be TRUE if using
> compressed
> + * ### metadata. When *all* metadata gets compressed, it should
> disappear.
> */
> svn_error_t *
> svn_wc__db_global_relocate(svn_wc__db_t *db,
> const char *local_dir_abspath,
> const char *repos_root_url,
> + svn_boolean_t single_db,
> apr_pool_t *scratch_pool);
>
>
>
> Modified: trunk/subversion/tests/libsvn_wc/db-test.c
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/tests/libsvn_wc/db-
> test.c?pathrev=38192&r1=38191&r2=38192
> =======================================================================
> =======
> --- trunk/subversion/tests/libsvn_wc/db-test.c Wed Jun 24 14:35:55
2009
> (r38191)
> +++ trunk/subversion/tests/libsvn_wc/db-test.c Wed Jun 24 14:43:19
2009
> (r38192)
> @@ -1222,7 +1222,8 @@ test_global_relocate(apr_pool_t *pool)
> SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE);
>
> /* Test relocating to a repos not existant in the db */
> - SVN_ERR(svn_wc__db_global_relocate(db, local_abspath, ROOT_THREE,
> pool));
> + SVN_ERR(svn_wc__db_global_relocate(db, local_abspath, ROOT_THREE,
> TRUE,
> + pool));
> SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL,
> &repos_relpath, &repos_root_url,
> &repos_uuid,
> NULL, NULL, NULL, NULL,
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageI
> d=2365111

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2365118
Received on 2009-06-25 00:10:20 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.