You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/05/25 17:46:48 UTC

svn commit: r1127568 - in /subversion/trunk/subversion: libsvn_wc/entries.c tests/cmdline/upgrade_tests.py

Author: stsp
Date: Wed May 25 15:46:47 2011
New Revision: 1127568

URL: http://svn.apache.org/viewvc?rev=1127568&view=rev
Log:
Fix another case of issue #3901, "upgrade doesn't handle depth=exclude",
where the excluded item is within a copied tree. This makes the test
associated with issue #3901 PASS.

* subversion/libsvn_wc/entries.c
  (write_entry): Expand an assertion to accommodate for excluded children
   of a copied directory and make sure to pick the right tree (base vs. working)
   for such nodes. Don't reset the working node's presence to 'incomplete'
   if it's already been set to 'excluded' (same fix as made for base nodes
   in r1127545).

* subversion/tests/cmdline/upgrade_tests.py
  (depth_exclude): Remove XFAIL marker.

Review by: philip

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1127568&r1=1127567&r2=1127568&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Wed May 25 15:46:47 2011
@@ -1627,8 +1627,11 @@ write_entry(struct write_baton **entry_n
                        || (parent_node->base && !parent_node->work
                            && !entry->copied)
                        || (!parent_node->base && parent_node->work
-                           && entry->copied));
-        if (entry->copied)
+                           && (entry->copied ||
+                               entry->depth == svn_depth_exclude)));
+        if (entry->copied ||
+            (entry->depth == svn_depth_exclude && parent_node &&
+             parent_node->work))
           working_node = MAYBE_ALLOC(working_node, result_pool);
         else
           base_node = MAYBE_ALLOC(base_node, result_pool);
@@ -2036,44 +2039,45 @@ write_entry(struct write_baton **entry_n
 #endif
         }
 
-      /* All subdirs start of incomplete, and stop being incomplete
-         when the entries file in the subdir is upgraded. */
-      if (entry->kind == svn_node_dir
-          && strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))
-        {
-          working_node->presence = svn_wc__db_status_incomplete;
-          working_node->kind = svn_node_dir;
-        }
-      else if (entry->schedule == svn_wc_schedule_delete)
+      working_node->kind = entry->kind;
+      if (working_node->presence != svn_wc__db_status_excluded)
         {
-          if (entry->incomplete)
+          /* All subdirs start of incomplete, and stop being incomplete
+             when the entries file in the subdir is upgraded. */
+          if (entry->kind == svn_node_dir
+              && strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))
             {
-              /* A transition from a schedule-delete state to incomplete
-                 is most likely caused by svn_wc_remove_from_revision_control.
-                 By setting this node's presence to 'incomplete', we will
-                 lose the scheduling information, but this directory is
-                 being deleted (by the logs) ... we won't need the state.  */
               working_node->presence = svn_wc__db_status_incomplete;
+              working_node->kind = svn_node_dir;
             }
-          else
+          else if (entry->schedule == svn_wc_schedule_delete)
             {
-              working_node->presence = svn_wc__db_status_base_deleted;
+              if (entry->incomplete)
+                {
+                  /* A transition from a schedule-delete state to incomplete
+                     is most likely caused by svn_wc_remove_from_revision_control.
+                     By setting this node's presence to 'incomplete', we will
+                     lose the scheduling information, but this directory is
+                     being deleted (by the logs) ... we won't need the state.  */
+                  working_node->presence = svn_wc__db_status_incomplete;
+                }
+              else
+                {
+                  working_node->presence = svn_wc__db_status_base_deleted;
+                }
             }
-
-          /* ### should be svn_node_unknown, but let's store what we have. */
-          working_node->kind = entry->kind;
-        }
-      else
-        {
-          /* presence == normal  */
-          working_node->kind = entry->kind;
-
-          if (entry->incomplete)
+          else
             {
-              /* We shouldn't be overwriting another status.  */
-              SVN_ERR_ASSERT(working_node->presence
-                             == svn_wc__db_status_normal);
-              working_node->presence = svn_wc__db_status_incomplete;
+              /* presence == normal  */
+              working_node->kind = entry->kind;
+
+              if (entry->incomplete)
+                {
+                  /* We shouldn't be overwriting another status.  */
+                  SVN_ERR_ASSERT(working_node->presence
+                                 == svn_wc__db_status_normal);
+                  working_node->presence = svn_wc__db_status_incomplete;
+                }
             }
         }
 

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1127568&r1=1127567&r2=1127568&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Wed May 25 15:46:47 2011
@@ -968,7 +968,6 @@ def upgrade_from_format_28(sbox):
   assert not os.path.exists(old_pristine_path)
   assert os.path.exists(new_pristine_path)
 
-@XFail()
 @Issue(3901)
 def depth_exclude(sbox):
   "upgrade 1.6.x wc that has depth=exclude"