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

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

From: Greg Stein <gstein_at_gmail.com>
Date: Sun, 7 Jun 2009 09:01:54 +0200

If you have the repository root, then just select on that. The root is
unique, the UUID is not. IOW, you're selecting on the wrong thing.

On Thu, Jun 4, 2009 at 12:11, Hyrum K. Wright<hyrum_at_hyrumwright.org> wrote:
> Author: hwright
> Date: Thu Jun  4 03:11:25 2009
> New Revision: 37927
>
> Log:
> Fix a couple of switch tests which were broken by r37926.
>
> * subversion/libsvn_wc/wc_db.c
>  (statements.STMT_SELECT_REPOSITORY): Also select the repository root.
>  (create_repos_id): Look at all the rows which match a given UUID, not just
>    the first one.
>
> Modified:
>   trunk/subversion/libsvn_wc/wc_db.c
>
> Modified: trunk/subversion/libsvn_wc/wc_db.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/wc_db.c?pathrev=37927&r1=37926&r2=37927
> ==============================================================================
> --- trunk/subversion/libsvn_wc/wc_db.c  Thu Jun  4 01:26:56 2009        (r37926)
> +++ trunk/subversion/libsvn_wc/wc_db.c  Thu Jun  4 03:11:25 2009        (r37927)
> @@ -231,7 +231,7 @@ static const char * const statements[] =
>   "select id from wcroot where local_abspath is null;",
>
>   /* STMT_SELECT_REPOSITORY */
> -  "select id from repository where uuid = ?1;",
> +  "select id, root from repository where uuid = ?1;",
>
>   /* STMT_INSERT_REPOSITORY */
>   "insert into repository (root, uuid) values (?1, ?2);",
> @@ -1293,10 +1293,18 @@ create_repos_id(apr_int64_t *repos_id, c
>   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_REPOSITORY));
>   SVN_ERR(svn_sqlite__bindf(stmt, "s", repos_uuid));
>   SVN_ERR(svn_sqlite__step(&have_row, stmt));
> -  if (have_row)
> +
> +  while (have_row)
>     {
> -      *repos_id = svn_sqlite__column_int64(stmt, 0);
> -      return svn_sqlite__reset(stmt);
> +      const char *fetched_repos_root = svn_sqlite__column_text(stmt, 1, NULL);
> +
> +      if (strcmp(fetched_repos_root, repos_root_url) == 0)
> +        {
> +          *repos_id = svn_sqlite__column_int64(stmt, 0);
> +          return svn_error_return(svn_sqlite__reset(stmt));
> +        }
> +
> +      SVN_ERR(svn_sqlite__step(&have_row, stmt));
>     }
>   SVN_ERR(svn_sqlite__reset(stmt));
>
> @@ -1311,7 +1319,7 @@ create_repos_id(apr_int64_t *repos_id, c
>
>   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_REPOSITORY));
>   SVN_ERR(svn_sqlite__bindf(stmt, "ss", repos_root_url, repos_uuid));
> -  return svn_sqlite__insert(repos_id, stmt);
> +  return svn_error_return(svn_sqlite__insert(repos_id, stmt));
>  }
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=2359372
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2360060
Received on 2009-06-07 09:02:29 CEST

This is an archived mail posted to the Subversion Dev mailing list.