You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/06/11 15:35:24 UTC

svn commit: r953695 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: philip
Date: Fri Jun 11 13:35:24 2010
New Revision: 953695

URL: http://svn.apache.org/viewvc?rev=953695&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_global_relocate): Determine if the base_node is present.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=953695&r1=953694&r2=953695&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jun 11 13:35:24 2010
@@ -4842,6 +4842,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
   svn_wc__db_status_t status;
   struct relocate_baton rb;
   const char *old_repos_root_url, *stored_local_dir_abspath;
+  svn_boolean_t base_shadowed;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
   /* ### assert that we were passed a directory?  */
@@ -4856,11 +4857,31 @@ svn_wc__db_global_relocate(svn_wc__db_t 
                                &rb.repos_relpath, &old_repos_root_url,
                                &rb.repos_uuid,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               &base_shadowed,
                                NULL, NULL,
                                db, local_dir_abspath,
                                scratch_pool, scratch_pool));
 
+  if (status == svn_wc__db_status_excluded
+      || status == svn_wc__db_status_incomplete)
+    {
+      svn_sqlite__stmt_t *stmt;
+
+      SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+                                        STMT_SELECT_BASE_NODE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is",
+                                pdh->wcroot->wc_id, rb.local_relpath));
+      SVN_ERR(svn_sqlite__step(&rb.have_base_node, stmt));
+      SVN_ERR(svn_sqlite__reset(stmt));
+    }
+  else if (base_shadowed || status == svn_wc__db_status_normal
+           || status == svn_wc__db_status_absent
+           || status == svn_wc__db_status_not_present)
+    rb.have_base_node = TRUE;
+  else
+    rb.have_base_node = FALSE;
+
   if (status == svn_wc__db_status_excluded)
     {
       /* The parent cannot be excluded, so look at the parent and then



Re: svn commit: r953695 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Greg Stein <gs...@gmail.com>.
On Fri, Jun 11, 2010 at 11:51, Greg Stein <gs...@gmail.com> wrote:
> On Fri, Jun 11, 2010 at 09:35,  <ph...@apache.org> wrote:
>>...
>> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jun 11 13:35:24 2010
>>...
>> @@ -4856,11 +4857,31 @@ svn_wc__db_global_relocate(svn_wc__db_t
>>                                &rb.repos_relpath, &old_repos_root_url,
>>                                &rb.repos_uuid,
>>                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
>> -                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
>> +                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
>> +                               &base_shadowed,
>>                                NULL, NULL,
>>                                db, local_dir_abspath,
>>                                scratch_pool, scratch_pool));
>>
>> +  if (status == svn_wc__db_status_excluded
>> +      || status == svn_wc__db_status_incomplete)
>> +    {
>> +      svn_sqlite__stmt_t *stmt;
>> +
>> +      SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
>> +                                        STMT_SELECT_BASE_NODE));
>> +      SVN_ERR(svn_sqlite__bindf(stmt, "is",
>> +                                pdh->wcroot->wc_id, rb.local_relpath));
>> +      SVN_ERR(svn_sqlite__step(&rb.have_base_node, stmt));
>> +      SVN_ERR(svn_sqlite__reset(stmt));
>> +    }
>> +  else if (base_shadowed || status == svn_wc__db_status_normal

I also think you should test base_shadowed first, so that you could
avoid the extra sql query.

>...

Cheers,
-g

Re: svn commit: r953695 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Philip Martin <ph...@wandisco.com>.
Greg Stein <gs...@gmail.com> writes:

> Is it possible to get an absent WORKING_NODE with 'svn cp URL WC' ? It
> seems that we would want an absent node so that the client cannot
> attempt to add/copy/move a node to that name.

It might, but that would be a copy bug.  svn_wc__db_read_info asserts
that status!=absent for the working node.

Copying an absent node is explicitly disallowed in the the wc-to-wc
code because there is no way to commit such a copy.  (My original plan
was to represent the copied node as not-present so that it got deleted
on commit, but the commit fails early when the parent is copied.)

-- 
Philip

Re: svn commit: r953695 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Greg Stein <gs...@gmail.com>.
On Fri, Jun 11, 2010 at 09:35,  <ph...@apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jun 11 13:35:24 2010
>...
> @@ -4856,11 +4857,31 @@ svn_wc__db_global_relocate(svn_wc__db_t
>                                &rb.repos_relpath, &old_repos_root_url,
>                                &rb.repos_uuid,
>                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
> -                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
> +                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
> +                               &base_shadowed,
>                                NULL, NULL,
>                                db, local_dir_abspath,
>                                scratch_pool, scratch_pool));
>
> +  if (status == svn_wc__db_status_excluded
> +      || status == svn_wc__db_status_incomplete)
> +    {
> +      svn_sqlite__stmt_t *stmt;
> +
> +      SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
> +                                        STMT_SELECT_BASE_NODE));
> +      SVN_ERR(svn_sqlite__bindf(stmt, "is",
> +                                pdh->wcroot->wc_id, rb.local_relpath));
> +      SVN_ERR(svn_sqlite__step(&rb.have_base_node, stmt));
> +      SVN_ERR(svn_sqlite__reset(stmt));
> +    }
> +  else if (base_shadowed || status == svn_wc__db_status_normal
> +           || status == svn_wc__db_status_absent
> +           || status == svn_wc__db_status_not_present)

Is it possible to get an absent WORKING_NODE with 'svn cp URL WC' ? It
seems that we would want an absent node so that the client cannot
attempt to add/copy/move a node to that name.

>...

Cheers,
-g