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

svn commit: r1127480 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/db-test.c

Author: julianfoad
Date: Wed May 25 11:44:40 2011
New Revision: 1127480

URL: http://svn.apache.org/viewvc?rev=1127480&view=rev
Log:
Revert r905744.  This removes the ability for svn_wc__db_scan_deletion() to
handle a path whose parent has been moved to a different op-depth, and the
test for the same, as this ability is no longer needed.  I found this by
trying to verify that for every NODES row there is a row corresponding to
its op-root; the test created a DB state that violated that constraint.

* subversion/libsvn_wc/wc_db.c
  (scan_deletion_txn): Assert that the child is not 'not-present'.

* subversion/tests/libsvn_wc/db-test.c
  (TESTING_DATA): Remove the test nodes 'M' and 'M/M-a'.
  (test_children): Update the expected number of children.
  (test_scan_deletion): Remove the part that tests 'M/M-a'.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_wc/db-test.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=1127480&r1=1127479&r2=1127480&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed May 25 11:44:40 2011
@@ -9362,15 +9362,9 @@ scan_deletion_txn(void *baton,
           /* No row means no WORKING node at this path, which means we just
              fell off the top of the WORKING tree.
 
-             If the child was not-present this implies the root of the
-             (added) WORKING subtree was deleted.  This can occur
-             during post-commit processing when the copied parent that
-             was in the WORKING tree has been moved to the BASE tree. */
-          if (sd_baton->work_del_relpath != NULL
-              && child_presence == svn_wc__db_status_not_present
-              && *sd_baton->work_del_relpath == NULL)
-            *sd_baton->work_del_relpath = apr_pstrdup(sd_baton->result_pool,
-                                                      child_relpath);
+             The child cannot be not-present, as that would imply the
+             root of the (added) WORKING subtree was deleted.  */
+          SVN_ERR_ASSERT(child_presence != svn_wc__db_status_not_present);
 
           /* If the child did not have a BASE node associated with it, then
              we're looking at a deletion that occurred within an added tree.

Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=1127480&r1=1127479&r2=1127480&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Wed May 25 11:44:40 2011
@@ -305,15 +305,6 @@ static const char * const TESTING_DATA =
    "insert into actual_node values ("
    "  1, 'G', '', null, null, null, null, null, null, null, "
    "  '" G_TC_DATA "', null, null, null, null);"
-   "  "
-   "insert into nodes values ("
-   "  1, 'M', 0, '', 1, 'M', null, 'normal', "
-   "  1, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
-   "  null, null, null, null);"
-   "insert into nodes values ("
-   "  1, 'M/M-a', 1, 'M', null, null, null, 'not-present', "
-   "  null, null, 'file', '()', null, null, null, null, null, null,"
-   "  null, 0, null, null);"
    );
 
 WC_QUERIES_SQL_DECLARE_STATEMENTS(statements);
@@ -792,7 +783,7 @@ test_children(apr_pool_t *pool)
   SVN_ERR(svn_wc__db_base_get_children(&children,
                                        db, local_abspath,
                                        pool, pool));
-  SVN_TEST_ASSERT(children->nelts == 12);
+  SVN_TEST_ASSERT(children->nelts == 11);
   for (i = children->nelts; i--; )
     {
       const char *name = APR_ARRAY_IDX(children, i, const char *);
@@ -804,7 +795,7 @@ test_children(apr_pool_t *pool)
   SVN_ERR(svn_wc__db_read_children(&children,
                                    db, local_abspath,
                                    pool, pool));
-  SVN_TEST_ASSERT(children->nelts == 13);
+  SVN_TEST_ASSERT(children->nelts == 12);
   for (i = children->nelts; i--; )
     {
       const char *name = APR_ARRAY_IDX(children, i, const char *);
@@ -1223,18 +1214,6 @@ test_scan_deletion(apr_pool_t *pool)
   SVN_TEST_ASSERT(validate_abspath(local_abspath, "L/L-a",
                                    work_del_abspath, pool));
 
-  /* Root of delete, parent converted to BASE during post-commit. */
-  SVN_ERR(svn_wc__db_scan_deletion(
-            &base_del_abspath,
-            &moved_to_abspath,
-            &work_del_abspath,
-            db, svn_dirent_join(local_abspath, "M/M-a", pool),
-            pool, pool));
-  SVN_TEST_ASSERT(base_del_abspath == NULL);
-  SVN_TEST_ASSERT(moved_to_abspath == NULL);
-  SVN_TEST_ASSERT(validate_abspath(local_abspath, "M/M-a",
-                                   work_del_abspath, pool));
-
   return SVN_NO_ERROR;
 }