You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/23 15:04:37 UTC

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

Author: gstein
Date: Fri Apr 23 13:04:37 2010
New Revision: 937276

URL: http://svn.apache.org/viewvc?rev=937276&view=rev
Log:
Strengthen the checks in scan_addition to throw errors if invoked for
obstructed nodes.

This breaks schedule_tests 7, to be fixed in a larger and distinct
semantic change/revision.

* subversion/libsvn_wc/wc_db.c:
  (svn_wc__db_temp_op_delete): add some comments, and note that the code
    breaks in a limited case.
  (svn_wc__db_scan_addition): we have nifty token mapping support now, so
    do a full decode of the presence value, and drop PRESENCE_IS_NORMAL.
    look for an obstructed target, which is not allowed.

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=937276&r1=937275&r2=937276&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Apr 23 13:04:37 2010
@@ -3894,6 +3894,7 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
   new_working_status = working_status;
   if (working_none)
     {
+      /* No structural changes  */
       if (base_status == svn_wc__db_status_normal
           || base_status == svn_wc__db_status_obstructed
           || base_status == svn_wc__db_status_incomplete
@@ -3907,7 +3908,11 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
             || working_status == svn_wc__db_status_obstructed)
            && (base_none || base_status == svn_wc__db_status_not_present))
     {
+      /* ADD  */
+
       svn_boolean_t add_or_root_of_copy;
+
+      /* ### this fails for the status_obstructed case.  */
       SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy,
                                      db, local_abspath, scratch_pool));
       if (add_or_root_of_copy)
@@ -3917,6 +3922,7 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
     }
   else if (working_status == svn_wc__db_status_normal)
     {
+      /* DELETE + ADD  */
       svn_boolean_t add_or_root_of_copy;
       SVN_ERR(is_add_or_root_of_copy(&add_or_root_of_copy,
                                      db, local_abspath, scratch_pool));
@@ -5363,6 +5369,7 @@ svn_wc__db_scan_addition(svn_wc__db_stat
     {
       svn_sqlite__stmt_t *stmt;
       svn_boolean_t have_row;
+      svn_wc__db_status_t presence;
       svn_boolean_t presence_is_normal;
 
       /* ### is it faster to fetch fewer columns? */
@@ -5398,15 +5405,11 @@ svn_wc__db_scan_addition(svn_wc__db_stat
           break;
         }
 
-      presence_is_normal = strcmp("normal",
-                                  svn_sqlite__column_text(stmt, 0, NULL)) == 0;
+      presence = svn_sqlite__column_token(stmt, 0, presence_map);
 
       /* Record information from the starting node.  */
       if (current_abspath == local_abspath)
         {
-          svn_wc__db_status_t presence
-            = svn_sqlite__column_token(stmt, 0, presence_map);
-
           /* The starting node should exist normally.  */
           if (presence != svn_wc__db_status_normal)
             return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS,
@@ -5415,6 +5418,18 @@ svn_wc__db_scan_addition(svn_wc__db_stat
                                      svn_dirent_local_style(local_abspath,
                                                             scratch_pool));
 
+          /* ### in per-dir operation, it is possible that we just fetched
+             ### the parent stub. examine the KIND field.
+             ###
+             ### scan_addition is NOT allowed for an obstructed_add status
+             ### from read_info. there may be key information in the
+             ### subdir record (eg. copyfrom_*).  */
+          {
+            svn_wc__db_kind_t kind = svn_sqlite__column_token(stmt, 1,
+                                                              kind_map);
+            SVN_ERR_ASSERT(kind != svn_wc__db_kind_subdir);
+          }
+
           /* Provide the default status; we'll override as appropriate. */
           if (status)
             *status = svn_wc__db_status_added;
@@ -5423,7 +5438,7 @@ svn_wc__db_scan_addition(svn_wc__db_stat
       /* We want the operation closest to the start node, and then we
          ignore any operations on its ancestors.  */
       if (!found_info
-          && presence_is_normal
+          && presence == svn_wc__db_status_normal
           && !svn_sqlite__column_is_null(stmt, 9 /* copyfrom_repos_id */))
         {
           if (status)



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

Posted by Greg Stein <gs...@gmail.com>.
On Fri, Apr 23, 2010 at 09:25, Stefan Sperling <st...@elego.de> wrote:
> On Fri, Apr 23, 2010 at 01:04:37PM -0000, gstein@apache.org wrote:
>> Author: gstein
>> Date: Fri Apr 23 13:04:37 2010
>> New Revision: 937276
>
>> This breaks schedule_tests 7, to be fixed in a larger and distinct
>> semantic change/revision.
>
> Why not mark it XFAIL in the meantime?

Cuz I planned to fix it in short order. Thus, churning the test script
would be just that... churn.

Cheers,
-g

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

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Apr 23, 2010 at 01:04:37PM -0000, gstein@apache.org wrote:
> Author: gstein
> Date: Fri Apr 23 13:04:37 2010
> New Revision: 937276

> This breaks schedule_tests 7, to be fixed in a larger and distinct
> semantic change/revision.

Why not mark it XFAIL in the meantime?

Stefan