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

Re: svn commit: r36367 - trunk/subversion/libsvn_wc

From: Greg Stein <gstein_at_gmail.com>
Date: Fri, 6 Mar 2009 18:39:03 +0100

On Fri, Mar 6, 2009 at 16:07, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>...
> +++ trunk/subversion/libsvn_wc/entries.c        Fri Mar  6 07:07:25 2009        (r36367)
>...
> @@ -1836,16 +1836,34 @@ entries_write_body(void *baton,
>   if (ewtb->this_dir->uuid != NULL)
>     {
>       SVN_ERR(svn_sqlite__get_statement(&stmt, wc_db, STMT_SELECT_REPOSITORY));
> -      SVN_ERR(svn_sqlite__bindf(stmt, "s", ewtb->this_dir->uuid));
> +      SVN_ERR(svn_sqlite__bindf(stmt, "s", ewtb->this_dir->repos));

The if-block is based on this_dir->uuid, but you use this_dir->repos.
Kinda inconsistent, but should be alright.

>       SVN_ERR(svn_sqlite__step(&have_row, stmt));
>
> -      if (!have_row)
> -        return svn_error_createf(SVN_ERR_WC_DB_ERROR, NULL,
> -                                 _("No REPOSITORY table entry for uuid '%s'"),
> -                                 ewtb->this_dir->uuid);
> +      if (have_row)
> +        {
> +          repos_id = svn_sqlite__column_int(stmt, 0);
> +          repos_root = svn_sqlite__column_text(stmt, 1, ewtb->scratch_pool);

No need to the root from the database. That is just the param you
bound: ewtb->this_dir->repos.

> +        }
> +      else
> +        {
> +          SVN_ERR(svn_sqlite__reset(stmt));
> +
> +          /* Insert a new row in the REPOSITORY table for using this new,
> +             and currently unknown, repository.
> +
> +             ### does this need to be done on a per-entry basis instead of
> +             ### the per-directory way we do it now?  me thinks yes...
> +             ###
> +             ### when do we harvest repository entries which no longer have
> +             ### any members?  */
> +          SVN_ERR(svn_sqlite__get_statement(&stmt, wc_db,
> +                                            STMT_INSERT_REPOSITORY));
> +          SVN_ERR(svn_sqlite__bindf(stmt, "ss", ewtb->this_dir->repos,
> +                                    ewtb->this_dir->uuid));
> +          SVN_ERR(svn_sqlite__insert(&repos_id, stmt));
> +          repos_root = ewtb->this_dir->repos;

oh! and there is ewtb->this_dir->repos again!

Looks like uuid isn't used in here, but you may want to select it from
the database and verify that it matches this_dir->uuid.

and yes: each child could have a different repos_id. Think: externals.

>...
> +++ trunk/subversion/libsvn_wc/wc-metadata.sql  Fri Mar  6 07:07:25 2009        (r36367)
> @@ -48,6 +48,7 @@ CREATE TABLE REPOSITORY (
>  /* Note: a repository (identified by its UUID) may appear at multiple URLs.
>    For example, http://example.com/repos/ and https://example.com/repos/.  */
>  CREATE INDEX I_UUID ON REPOSITORY (uuid);
> +CREATE INDEX I_ROOT ON REPOSITORY (root);

UNIQUE INDEX.

(the column is marked unique, so it isn't _strictly_ necessary, but it
helps docco our assumptions/use/semantics)

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1278260
Received on 2009-03-06 18:39:20 CET

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.