subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1186434 - in /subversion/trunk/subversion: libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
Date Wed, 19 Oct 2011 19:55:30 GMT
Author: philip
Date: Wed Oct 19 19:55:30 2011
New Revision: 1186434

URL: http://svn.apache.org/viewvc?rev=1186434&view=rev
Log:
Fix issue 4033, upgrade with not-present replaced nodes.  This fixes
the case identified in the issue but there may still be problems if the
not-present node is a working node.

* subversion/libsvn_wc/entries.c
  (write_entry): Handle deleted=TRUE with schedule add.

* subversion/tests/cmdline/upgrade_tests.py
  (upgrade_not_present_replaced): Extend to run update and status.

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=1186434&r1=1186433&r2=1186434&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Wed Oct 19 19:55:30 2011
@@ -1672,6 +1672,13 @@ write_entry(struct write_baton **entry_n
 
       case svn_wc_schedule_add:
         working_node = MAYBE_ALLOC(working_node, result_pool);
+        if (entry->deleted)
+          {
+            if (parent_node->base)
+              base_node = MAYBE_ALLOC(base_node, result_pool);
+            else
+              below_working_node = MAYBE_ALLOC(below_working_node, result_pool);
+          }
         break;
 
       case svn_wc_schedule_delete:
@@ -1695,9 +1702,12 @@ write_entry(struct write_baton **entry_n
      BASE node to indicate the not-present node.  */
   if (entry->deleted)
     {
-      SVN_ERR_ASSERT(base_node && !working_node && !below_working_node);
+      SVN_ERR_ASSERT(base_node || below_working_node);
       SVN_ERR_ASSERT(!entry->incomplete);
-      base_node->presence = svn_wc__db_status_not_present;
+      if (base_node)
+        base_node->presence = svn_wc__db_status_not_present;
+      else
+        below_working_node->presence = svn_wc__db_status_not_present;
     }
   else if (entry->absent)
     {

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1186434&r1=1186433&r2=1186434&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Wed Oct 19 19:55:30 2011
@@ -1244,6 +1244,16 @@ def upgrade_not_present_replaced(sbox):
                                      'file:///tmp/repo', sbox.repo_url,
                                      sbox.wc_dir)
 
+  expected_output = svntest.wc.State(sbox.wc_dir, {
+      'A/B/E'         : Item(status='E '),
+      'A/B/E/alpha'   : Item(status='A '),
+      'A/B/E/beta'    : Item(status='A '),
+      'A/B/lambda'    : Item(status='E '),
+      })
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+  svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output,
+                                        None, expected_status)
+
 ########################################################################
 # Run the tests
 



Mime
View raw message