You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/15 21:32:38 UTC

svn commit: r997472 [41/41] - in /subversion/branches/py-tests-as-modules: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/server-side/ notes/ notes/tree-conflicts/ notes/wc-ng/ subversion/bindings/javahl/native/ subversi...

Modified: subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/db-test.c?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/db-test.c Wed Sep 15 19:32:26 2010
@@ -90,6 +90,7 @@ static const char * const TESTING_DATA =
    /* ### The file_externals column in BASE_NODE is temporary, and will be
       ### removed.  However, to keep the tests passing, we need to add it
       ### to the following insert statements.  *Be sure to remove it*. */
+#ifndef SVN_WC__NODES_ONLY
    "insert into base_node values ("
    "  1, '', 1, '', null, 'normal', 'dir', "
    "  1, null, null, "
@@ -187,6 +188,92 @@ static const char * const TESTING_DATA =
    "  1, " TIME_1s ", '" AUTHOR_1 "', null, null, null, '()', null, null, "
    "  null); "
    " "
+#endif
+#ifdef SVN_WC__NODES
+   /* load the base nodes into the nodes table */
+  "insert into nodes values ("
+  "  1, '', 0, null, 1, '', 1, 'normal', 'infinity',"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'A', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  "  '()', 10, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'B', 0, '', null, null, null, 'excluded', null,"
+  "  null, null, 'symlink', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'C', 0, '', null, null, null, 'absent', null,"
+  "  null, null, 'unknown', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'D', 0, '', null, null, null, 'not-present', null,"
+  "  null, null, 'unknown', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'E', 0, '', null, null, null, 'incomplete', null,"
+  "  null, null, 'unknown', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'F', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$sha1$" SHA1_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'G', 0, '', 2, 'G-alt', 1, 'normal', null,"
+  "  null, null, 'file', 2, " TIME_2s ", '" AUTHOR_2 "', '$sha1$" SHA1_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'H', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'symlink', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, 'H-target', null);"
+  "insert into nodes values ("
+  "  1, 'I', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e', 0, 'J', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-a', 0, 'J/J-e', null, null, 1, 'normal', null,"
+  " null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$sha1$" SHA1_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-b', 0, 'J/J-e', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-b/Jeba', 0, 'J/J-e/J-e-b', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$sha1$" SHA1_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-f', 0, 'J', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-f/J-f-a', 0, 'J/J-f', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K/K-a', 0, 'K', null, null, 1, 'normal', null,"
+  "   null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$sha1$" SHA1_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K/K-b', 0, 'K', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$sha1$" SHA1_1 "',"
+  " '()', 15, null, null, null, null);"
+  ""
+#endif
+#ifndef SVN_WC__NODES_ONLY
    "insert into working_node values ("
    "  1, 'I', '', 'normal', 'dir', "
    "  null, null, "
@@ -293,10 +380,101 @@ static const char * const TESTING_DATA =
    "  null, null, null, 'immediates', null, "
    "  null, null, null, 0, null, null, '()', 0); "
    " "
+#endif
+#ifdef SVN_WC__NODES
+   /* Load data into NODES table;
+      ### op_depths have not been calculated by me yet;
+      the value 1 is just 'good enough' to make the nodes WORKING nodes. */
+  "insert into nodes values ("
+  "  1, 'I', 1, '', 2, 'some/dir', 2, 'normal', 'immediates',"
+  "  0, null, 'dir', 2, " TIME_2s ", ' " AUTHOR_2 " ', null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J', 1, '', null, null, null, 'normal', 'immediates',"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-a', 1, 'J', null, null, null, 'normal', null,"
+  "  0, null, 'file', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-b', 1, 'J', 2, 'some/dir', 2, 'normal', 'infinity',"
+  "  0, null, 'dir', 2, " TIME_2s ", ' " AUTHOR_2 " ', null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-b/J-b-a', 1, 'J/J-b', 2, 'another/dir', 2, 'normal', 'infinity',"
+  "  0, null, 'dir', 2, " TIME_2s ", ' " AUTHOR_2 " ', null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-b/J-b-b', 1, 'J/J-b', null, null, null, 'normal', null,"
+  "  0, null, 'file', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-c', 1, 'J', null, null, null, 'not-present', null,"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-c/J-c-a', 1, 'J/J-c', null, null, null, 'not-present', null,"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-d', 1, 'J', 2, 'moved/file', 2, 'normal', null,"
+  "  1, null, 'file', 2, " TIME_2s ", ' " AUTHOR_2 " ', '$md5 $ " MD5_1 " ',"
+  " '()', 10, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e', 1, 'J', null, null, null, 'not-present', null,"
+  "  0, 'other/place', 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-a', 1, 'J/J-e', null, null, null, 'not-present', null,"
+  "  0, null, 'file', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-b', 1, 'J/J-e', null, null, null, 'not-present',"
+  "  null, 0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-b/Jeba', 1, 'J/J-e/J-e-b', null, null, null, 'base-deleted',"
+  "  null, 0, null, 'file', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-f', 1, 'J', null, null, null, 'normal', 'immediates',"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-f/J-f-a', 1, 'J/J-f', null, null, null, 'base-deleted',"
+  "  'immediates', 0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K', 1, '', null, null, null, 'base-deleted', null,"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K/K-a', 1, 'K', null, null, null, 'base-deleted', null,"
+  "  0, null, 'file', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K/K-b', 1, 'K', null, null, null, 'base-deleted', null,"
+  "  0, 'moved/away', 'file', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'L', 1, '', null, null, null, 'normal', 'immediates',"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'L/L-a', 1, 'L', null, null, null, 'not-present', 'immediates',"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'L/L-a/L-a-a', 1, 'L', null, null, null, 'not-present', 'immediates',"
+  "  0, null, 'dir', null, null, null, null, '()',"
+  "  null, null, null, null, null);"
+#endif
    "insert into actual_node values ("
    "  1, 'I', '', null, null, null, null, null, 'changelist', null, "
    "'" I_TC_DATA "', null, null, null, null);"
    "  "
+#ifndef SVN_WC__NODES_ONLY
    "insert into base_node values ("
    "  1, 'M', null, null, '', 'normal', 'dir', "
    "  1, null, null, "
@@ -307,6 +485,19 @@ static const char * const TESTING_DATA =
    "  null, null, "
    "  null, null, null, null, null, "
    "  null, null, null, 0, null, null, '()', 0); "
+#endif
+#ifdef SVN_WC__NODES_not_enabled_yet
+   "insert into nodes values ("
+   "  1, 'M', null, null, '', 'normal', 'dir', "
+   "  1, null, null, "
+   "  1, " TIME_1s ", '" AUTHOR_1 "', null, null, null, '()', null, null, "
+   "  null); "
+   "insert into nodes values ("
+   "  1, 'M/M-a', 'M', 'not-present', 'file', "
+   "  null, null, "
+   "  null, null, null, null, null, "
+   "  null, null, null, 0, null, null, '()', 0); "
+#endif
    );
 
 WC_QUERIES_SQL_DECLARE_STATEMENTS(statements);
@@ -321,9 +512,13 @@ create_fake_wc(const char *subdir, int f
   svn_sqlite__db_t *sdb;
   const char * const my_statements[] = {
     statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODES
+    statements[STMT_CREATE_NODES],
+#endif
     TESTING_DATA,
     NULL
   };
+  int i;
 
   SVN_ERR(svn_io_make_dir_recursively(dirpath, scratch_pool));
   svn_error_clear(svn_io_remove_file(dbpath, scratch_pool));
@@ -332,11 +527,8 @@ create_fake_wc(const char *subdir, int f
                            0, NULL,
                            scratch_pool, scratch_pool));
 
-  /* Create the database's schema.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 0));
-
-  /* Throw our extra data into the database.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 1));
+  for (i = 0; my_statements[i] != NULL; i++)
+    SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
 
   return SVN_NO_ERROR;
 }
@@ -681,7 +873,7 @@ test_inserting_nodes(apr_pool_t *pool)
             props,
             1, TIME_1a, AUTHOR_1,
             children, svn_depth_infinity,
-            NULL, NULL,
+            NULL, NULL, NULL,
             pool));
 
   /* Replace an incomplete node with a file node. */
@@ -692,7 +884,7 @@ test_inserting_nodes(apr_pool_t *pool)
             props,
             1, TIME_1a, AUTHOR_1,
             checksum, 10,
-            NULL, NULL,
+            NULL, NULL, NULL,
             pool));
 
   /* Create a new symlink node. */
@@ -703,7 +895,7 @@ test_inserting_nodes(apr_pool_t *pool)
             props,
             1, TIME_1a, AUTHOR_1,
             "O-target",
-            NULL, NULL,
+            NULL, NULL, NULL,
             pool));
 
   /* Replace an incomplete node with an absent file node. */
@@ -1287,8 +1479,7 @@ test_global_relocate(apr_pool_t *pool)
   SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE);
 
   /* Test relocating to a repos not existant in the db */
-  SVN_ERR(svn_wc__db_global_relocate(db, local_abspath, ROOT_THREE, TRUE,
-                                     pool));
+  SVN_ERR(svn_wc__db_global_relocate(db, local_abspath, ROOT_THREE, pool));
   SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL,
                                &repos_relpath, &repos_root_url, &repos_uuid,
                                NULL, NULL, NULL, NULL,

Modified: subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/entries-compat.c?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/entries-compat.c Wed Sep 15 19:32:26 2010
@@ -90,6 +90,7 @@ static const char * const TESTING_DATA =
    /* ### The file_externals column in BASE_NODE is temporary, and will be
       ### removed.  However, to keep the tests passing, we need to add it
       ### to the following insert statements.  *Be sure to remove it*. */
+#ifndef SVN_WC__NODES_ONLY
    "insert into base_node values ("
    "  1, '', 1, '', null, 'normal', 'dir', "
    "  1, null, null, "
@@ -187,6 +188,92 @@ static const char * const TESTING_DATA =
    "  1, " TIME_1s ", '" AUTHOR_1 "', null, null, null, '()', null, null, "
    "  null); "
    " "
+#endif
+#ifdef SVN_WC__NODES
+   /* load the base nodes into the nodes table */
+  "insert into nodes values ("
+  "  1, '', 0, null, 1, '', 1, 'normal', 'infinity',"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'A', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  "  '()', 10, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'B', 0, '', null, null, null, 'excluded', null,"
+  "  null, null, 'symlink', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'C', 0, '', null, null, null, 'absent', null,"
+  "  null, null, 'unknown', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'D', 0, '', null, null, null, 'not-present', null,"
+  "  null, null, 'unknown', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'E', 0, '', null, null, null, 'incomplete', null,"
+  "  null, null, 'unknown', null, null, null, null,"
+  "  null, null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'F', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'G', 0, '', 2, 'G-alt', 1, 'normal', null,"
+  "  null, null, 'file', 2, " TIME_2s ", '" AUTHOR_2 "', '$md5 $" MD5_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'H', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'symlink', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, 'H-target', null);"
+  "insert into nodes values ("
+  "  1, 'I', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e', 0, 'J', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-a', 0, 'J/J-e', null, null, 1, 'normal', null,"
+  " null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-b', 0, 'J/J-e', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-e/J-e-b/Jeba', 0, 'J/J-e/J-e-b', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-f', 0, 'J', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'J/J-f/J-f-a', 0, 'J/J-f', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K', 0, '', null, null, 1, 'normal', null,"
+  "  null, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null,"
+  "  '()', null, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K/K-a', 0, 'K', null, null, 1, 'normal', null,"
+  "   null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  "  '()', 15, null, null, null, null);"
+  "insert into nodes values ("
+  "  1, 'K/K-b', 0, 'K', null, null, 1, 'normal', null,"
+  "  null, null, 'file', 1, " TIME_1s ", '" AUTHOR_1 "', '$md5 $" MD5_1 "',"
+  " '()', 15, null, null, null, null);"
+  ""
+#endif
+#ifndef SVN_WC__NODES_ONLY
    "insert into working_node values ("
    "  1, 'I', '', 'normal', 'dir', "
    "  null, null, "
@@ -293,6 +380,9 @@ static const char * const TESTING_DATA =
    "  null, null, null, 'immediates', null, "
    "  null, null, null, 0, null, null, '()', 0); "
    " "
+#endif
+#ifdef SVN_WC__NODES
+#endif
    "insert into actual_node values ("
    "  1, 'I', '', null, null, null, null, null, 'changelist', null, "
    "'" I_TC_DATA "', null, null, null, null);"
@@ -337,6 +427,7 @@ make_one_db(const char *dirpath,
 {
   const char *dbpath = svn_dirent_join(dirpath, "wc.db", scratch_pool);
   svn_sqlite__db_t *sdb;
+  int i;
 
   /* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
   SVN_ERR(svn_io_make_dir_recursively(dirpath, scratch_pool));
@@ -347,11 +438,8 @@ make_one_db(const char *dirpath,
                            0, NULL,
                            scratch_pool, scratch_pool));
 
-  /* Create the database's schema.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 0));
-
-  /* Throw our extra data into the database.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 1));
+  for (i = 0; my_statements[i] != NULL; i++)
+    SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
 
   return SVN_NO_ERROR;
 }
@@ -360,24 +448,33 @@ make_one_db(const char *dirpath,
 static svn_error_t *
 create_fake_wc(const char *subdir, int format, apr_pool_t *scratch_pool)
 {
+  const char *root;
   const char *dirpath;
   const char * const my_statements[] = {
     statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODES
+    statements[STMT_CREATE_NODES],
+#endif
     TESTING_DATA,
     NULL
   };
   const char * const M_statements[] = {
     statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODES
+    statements[STMT_CREATE_NODES],
+#endif
     M_TESTING_DATA,
     NULL
   };
 
-  dirpath = svn_dirent_join_many(scratch_pool,
-                                 "fake-wc", subdir, ".svn", NULL);
+  root = svn_dirent_join("fake-wc", subdir, scratch_pool);
+
+  SVN_ERR(svn_io_remove_dir2(root, TRUE, NULL, NULL, scratch_pool));
+
+  dirpath = svn_dirent_join(root, ".svn", scratch_pool);
   SVN_ERR(make_one_db(dirpath, my_statements, scratch_pool));
 
-  dirpath = svn_dirent_join_many(scratch_pool,
-                                 "fake-wc", subdir, "M", ".svn", NULL);
+  dirpath = svn_dirent_join_many(scratch_pool, root, "M", ".svn", NULL);
   SVN_ERR(make_one_db(dirpath, M_statements, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -524,6 +621,169 @@ test_stubs(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_access_baton_like_locking(apr_pool_t *pool)
+{
+  svn_wc__db_t *db;
+  svn_wc_context_t *wc_ctx, *wc_ctx2;
+  const char *local_abspath;
+  const char *D, *D1, *D2, *D3, *D4;
+  svn_boolean_t locked_here, locked;
+  svn_error_t *err;
+  svn_wc_adm_access_t *adm_access, *subdir_access;
+
+#undef WC_NAME
+#define WC_NAME "test_access_batons"
+  SVN_ERR(create_open(&db, &local_abspath, WC_NAME, pool));
+
+  D = svn_dirent_join(local_abspath, "DD", pool);
+
+  D1 = svn_dirent_join(D, "DD", pool);
+  D2 = svn_dirent_join(D1, "DD", pool);
+  D3 = svn_dirent_join(D2, "DD", pool);
+  D4 = svn_dirent_join(D3, "DD", pool);
+
+  SVN_ERR(svn_io_make_dir_recursively(D4, pool));
+
+  /* Use the legacy interface */
+  SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, local_abspath, TRUE, 0,
+                           NULL, NULL, pool));
+  SVN_ERR(svn_wc_add3(D, adm_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D, pool));
+  SVN_ERR(svn_wc_add3(D1, subdir_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D1, pool));
+  SVN_ERR(svn_wc_add3(D2, subdir_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D2, pool));
+  SVN_ERR(svn_wc_add3(D3, subdir_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_locked(&locked, D3, pool));
+  SVN_TEST_ASSERT(locked);
+  SVN_ERR(svn_wc_revert3(D, adm_access, -1, FALSE,
+                         NULL, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_locked(&locked, D3, pool));
+  SVN_TEST_ASSERT(!locked);
+  SVN_ERR(svn_wc_adm_close2(adm_access, pool));
+
+  SVN_ERR(svn_wc_context_create(&wc_ctx, NULL, pool, pool));
+
+  /* Obtain a lock for the root, which is extended on each level */
+  SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, local_abspath, 0, FALSE, pool));
+  SVN_ERR(svn_wc_add4(wc_ctx, D, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+                      NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_add4(wc_ctx, D1, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+                      NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_add4(wc_ctx, D2, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+                      NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_add4(wc_ctx, D3, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+                      NULL, NULL, NULL, NULL, pool));
+
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D3, pool));
+  SVN_TEST_ASSERT(locked_here && locked);
+
+  /* Test if the not added path is already locked */
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D4, pool));
+  SVN_TEST_ASSERT(!locked_here && !locked);
+
+  SVN_ERR(svn_wc_add4(wc_ctx, D4, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+                      NULL, NULL, NULL, NULL, pool));
+
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D4, pool));
+  SVN_TEST_ASSERT(locked_here && locked);
+
+  SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath, pool));
+  /* Should be unlocked */
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, local_abspath, pool));
+  SVN_TEST_ASSERT(!locked_here && !locked);
+
+  /* Lock shouldn't be released */
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D, pool));
+  SVN_TEST_ASSERT(locked_here && locked);
+
+  SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D, pool));
+  SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D1, pool));
+  SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D2, pool));
+  SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D3, pool));
+
+  /* Try reobtaining lock on D3; should succeed */
+  SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, D3, 0, FALSE, pool));
+  SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D4, pool));
+
+
+  /* D3 should still be locked; try stealing in a different context */
+  SVN_ERR(svn_wc_context_create(&wc_ctx2, NULL, pool, pool));
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx2, D3, pool));
+  SVN_TEST_ASSERT(!locked_here && locked);
+
+  err = svn_wc__db_wclock_obtain(wc_ctx2->db, D3, 0, FALSE, pool);
+
+  if (err && err->apr_err != SVN_ERR_WC_LOCKED)
+    return svn_error_return(err);
+  svn_error_clear(err);
+
+  SVN_TEST_ASSERT(err != NULL); /* Can't lock, as it is still locked */
+
+  err = svn_wc__db_wclock_release(wc_ctx2->db, D4, pool);
+  if (err && err->apr_err != SVN_ERR_WC_NOT_LOCKED)
+    return svn_error_return(err);
+  svn_error_clear(err);
+
+  SVN_TEST_ASSERT(err != NULL); /* Can't unlock, as it is not ours */
+
+  /* Now steal the lock */
+  SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx2->db, D3, 0, TRUE, pool));
+
+  /* We should own the lock now */
+  SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx2, D3, pool));
+  SVN_TEST_ASSERT(locked_here && locked);
+
+  err = svn_wc__db_wclock_release(wc_ctx2->db, D4, pool);
+  if (err && err->apr_err != SVN_ERR_WC_NOT_LOCKED)
+    return svn_error_return(err);
+  svn_error_clear(err);
+
+  SVN_TEST_ASSERT(err != NULL); /* Can't unlock a not locked path */
+
+  /* Now create a separate working copy from the same repository directly
+     below this WC and test if our code really sees it as a separate wc,
+     for locking and normal operation */
+  {
+    const char *url, *repos_root_url, *repos_uuid;
+    const char *subdir = svn_dirent_join(local_abspath, "sub-wc", pool);
+
+    svn_boolean_t is_root;
+    SVN_ERR(svn_wc__node_get_url(&url, wc_ctx, local_abspath, pool, pool));
+    SVN_ERR(svn_wc__node_get_repos_info(&repos_root_url, &repos_uuid,
+                                        wc_ctx, local_abspath, FALSE, FALSE,
+                                        pool, pool));
+
+    SVN_ERR(svn_io_make_dir_recursively(subdir, pool));
+    SVN_ERR(svn_wc_ensure_adm3(subdir, repos_uuid,
+                               svn_uri_join(url, "sub-wc", pool),
+                               repos_root_url, 0, svn_depth_infinity,
+                               pool));
+
+    SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, NULL, wc_ctx->db, subdir,
+                                  pool));
+
+    SVN_TEST_ASSERT(is_root);
+
+    SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, NULL, wc_ctx2->db, subdir,
+                                  pool));
+
+    /* This test was added to show a regression where the next check failed,
+       but the check above this succeeded */
+    SVN_TEST_ASSERT(is_root);
+
+    SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx2, subdir, pool));
+    SVN_TEST_ASSERT(!locked_here && !locked);
+  }
+
+  return SVN_NO_ERROR;
+}
+
 
 struct svn_test_descriptor_t test_funcs[] =
   {
@@ -532,5 +792,7 @@ struct svn_test_descriptor_t test_funcs[
                    "entries are allocated in access baton"),
     SVN_TEST_PASS2(test_stubs,
                    "access baton mojo can return stubs"),
+    SVN_TEST_PASS2(test_access_baton_like_locking,
+                   "access baton like locks must work with wc-ng"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/pristine-store-test.c?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/libsvn_wc/pristine-store-test.c Wed Sep 15 19:32:26 2010
@@ -43,6 +43,7 @@
 #include "../../libsvn_wc/wc.h"
 #include "../../libsvn_wc/wc_db.h"
 #include "../../libsvn_wc/wc-queries.h"
+#include "../../libsvn_wc/workqueue.h"
 
 #include "private/svn_wc_private.h"
 
@@ -85,7 +86,7 @@ create_repos_and_wc(const char **repos_u
     svn_repos_t *repos;
 
     SVN_ERR(svn_test__create_repos(&repos, repos_path, opts, pool));
-    SVN_ERR(svn_test__current_directory_url(repos_url, repos_path, pool));
+    SVN_ERR(svn_uri_get_file_url_from_dirent(repos_url, repos_path, pool));
   }
 
   /* Create a WC */
@@ -161,7 +162,7 @@ pristine_write_read(const svn_test_opts_
     svn_boolean_t present;
 
     SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1,
-                                      svn_wc__db_checkmode_usable, pool));
+                                      pool));
     SVN_ERR_ASSERT(! present);
   }
 
@@ -174,7 +175,7 @@ pristine_write_read(const svn_test_opts_
     svn_boolean_t present;
 
     SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1,
-                                      svn_wc__db_checkmode_usable, pool));
+                                      pool));
     SVN_ERR_ASSERT(present);
   }
 
@@ -219,18 +220,116 @@ pristine_write_read(const svn_test_opts_
     svn_boolean_t present;
 
     SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1,
-                                      svn_wc__db_checkmode_usable, pool));
+                                      pool));
     SVN_ERR_ASSERT(! present);
   }
 
   return SVN_NO_ERROR;
 }
 
+/* Test the WQ item for getting and translating a text. */
+static svn_error_t *
+pristine_get_translated(const svn_test_opts_t *opts,
+                        apr_pool_t *pool)
+{
+  svn_wc__db_t *db;
+  const char *repos_url;
+  const char *wc_abspath, *versioned_abspath, *new_abspath;
+  const char data[] = "Blah at r$Rev$\n";
+  const char expected_data[] = "Blah at r$Rev: -1 $\n";
+  svn_checksum_t *data_sha1, *data_md5;
+
+  SVN_ERR(create_repos_and_wc(&repos_url, &wc_abspath, &db,
+                              "pristine_get_translated", opts, pool));
+
+  versioned_abspath = svn_dirent_join(wc_abspath, "foo", pool);
+  new_abspath = svn_dirent_join(wc_abspath, "foo.fetched", pool);
+
+  /* Create VERSIONED_ABSPATH, whose metadata will be used for the
+     translation. Set some properties on it. */
+  {
+    svn_wc_context_t *wc_ctx;
+    const char *dirname = svn_dirent_dirname(versioned_abspath, pool);
+
+    SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL, db, pool));
+    SVN_ERR(svn_io_file_create(versioned_abspath, data, pool));
+
+    SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, dirname, 0, FALSE, pool));
+
+    SVN_ERR(svn_wc_add4(wc_ctx, versioned_abspath, svn_depth_empty,
+                        NULL, SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL,
+                        pool));
+    SVN_ERR(svn_wc_prop_set4(wc_ctx, versioned_abspath,
+                             "svn:keywords", svn_string_create("Rev", pool),
+                             FALSE, NULL, NULL, pool));
+
+    SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, dirname, pool));
+  }
+
+  /* Store a pristine text, and set DATA_SHA1 and DATA_MD5. */
+  {
+    const char *pristine_tmp_dir;
+    const char *pristine_tmp_abspath;
+    svn_stream_t *pristine_tmp_stream;
+
+    SVN_ERR(svn_wc__db_pristine_get_tempdir(&pristine_tmp_dir, db,
+                                            wc_abspath, pool, pool));
+    SVN_ERR(svn_stream_open_unique(&pristine_tmp_stream, &pristine_tmp_abspath,
+                                   pristine_tmp_dir, svn_io_file_del_none,
+                                   pool, pool));
+
+    pristine_tmp_stream = svn_stream_checksummed2(
+                            pristine_tmp_stream, NULL, &data_sha1,
+                            svn_checksum_sha1, TRUE, pool);
+    pristine_tmp_stream = svn_stream_checksummed2(
+                            pristine_tmp_stream, NULL, &data_md5,
+                            svn_checksum_md5, TRUE, pool);
+
+    SVN_ERR(svn_stream_printf(pristine_tmp_stream, pool, "%s", data));
+    SVN_ERR(svn_stream_close(pristine_tmp_stream));
+
+    SVN_ERR(svn_wc__db_pristine_install(db, pristine_tmp_abspath,
+                                        data_sha1, data_md5, pool));
+  }
+
+  /* Run a work item to read and translate the text into NEW_ABSPATH. */
+  {
+    svn_skel_t *work_item;
+
+    SVN_ERR(svn_wc__wq_build_pristine_get_translated(&work_item,
+                                                     db, versioned_abspath,
+                                                     new_abspath, data_sha1,
+                                                     pool, pool));
+    SVN_ERR(svn_wc__db_wq_add(db, versioned_abspath, work_item, pool));
+
+    SVN_ERR(svn_wc__wq_run(db, wc_abspath, NULL, NULL, pool));
+  }
+
+  /* Check that NEW_ABSPATH has been created with the translated text. */
+  {
+    svn_stream_t *expected_stream
+      = svn_stream_from_string(svn_string_create(expected_data, pool), pool);
+    svn_stream_t *file_stream;
+    svn_boolean_t same;
+
+    SVN_ERR(svn_stream_open_readonly(&file_stream, new_abspath,
+                                     pool, pool));
+    SVN_ERR(svn_stream_contents_same2(&same, expected_stream, file_stream,
+                                      pool));
+
+    SVN_TEST_ASSERT(same);
+  }
+
+  return SVN_NO_ERROR;
+}
+
 
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
     SVN_TEST_OPTS_PASS(pristine_write_read,
                        "pristine_write_read"),
+    SVN_TEST_OPTS_PASS(pristine_get_translated,
+                       "pristine_get_translated"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.c?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.c Wed Sep 15 19:32:26 2010
@@ -24,13 +24,6 @@
 #include <string.h>
 #include <apr_pools.h>
 
-#ifdef _MSC_VER
-#include <direct.h>
-#define getcwd _getcwd
-#else
-#include <unistd.h> /* for getcwd() */
-#endif
-
 #include "svn_test.h"
 
 #include "svn_string.h"
@@ -238,37 +231,6 @@ svn_test__create_repos(svn_repos_t **rep
   return SVN_NO_ERROR;
 }
 
-
-/* Helper function.  Set URL to a "file://" url for the current directory,
-   suffixed by the forward-slash-style relative path SUFFIX, performing all
-   allocation in POOL. */
-svn_error_t *
-svn_test__current_directory_url(const char **url,
-                                const char *suffix,
-                                apr_pool_t *pool)
-{
-  /* 8KB is a lot, but it almost guarantees that any path will fit. */
-  char curdir[8192];
-  const char *utf8_ls_curdir, *utf8_is_curdir, *unencoded_url;
-
-  if (! getcwd(curdir, sizeof(curdir)))
-    return svn_error_create(SVN_ERR_BASE, NULL, "getcwd() failed");
-
-  SVN_ERR(svn_utf_cstring_to_utf8(&utf8_ls_curdir, curdir, pool));
-  utf8_is_curdir = svn_path_internal_style(utf8_ls_curdir, pool);
-
-  unencoded_url = apr_psprintf(pool, "file://%s%s%s%s",
-                               (utf8_is_curdir[0] != '/') ? "/" : "",
-                               utf8_is_curdir,
-                               (suffix[0] && suffix[0] != '/') ? "/" : "",
-                               suffix);
-
-  *url = svn_path_uri_encode(unencoded_url, pool);
-
-  return SVN_NO_ERROR;
-}
-
-
 svn_error_t *
 svn_test__stream_to_string(svn_stringbuf_t **string,
                            svn_stream_t *stream,

Modified: subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.h?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/svn_test_fs.h Wed Sep 15 19:32:26 2010
@@ -73,14 +73,6 @@ svn_test__create_repos(svn_repos_t **rep
                        const svn_test_opts_t *opts,
                        apr_pool_t *pool);
 
-/* Set URL to a "file://" url for the current directory, suffixed by the
-   forward-slash-style relative path SUFFIX, performing all allocation
-   in POOL. */
-svn_error_t *
-svn_test__current_directory_url(const char **url,
-                                const char *suffix,
-                                apr_pool_t *pool);
-
 /* Read all data from a generic read STREAM, and return it in STRING.
    Allocate the svn_stringbuf_t in POOL.  (All data in STRING will be
    dup'ed from STREAM using POOL too.) */

Modified: subversion/branches/py-tests-as-modules/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/tests/svn_test_main.c?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/tests/svn_test_main.c Wed Sep 15 19:32:26 2010
@@ -29,7 +29,6 @@
 
 #include <apr_pools.h>
 #include <apr_general.h>
-#include <apr_lib.h>
 
 #include "svn_cmdline.h"
 #include "svn_opt.h"
@@ -38,6 +37,7 @@
 #include "svn_test.h"
 #include "svn_io.h"
 #include "svn_path.h"
+#include "svn_ctype.h"
 #include "svn_private_config.h"
 
 
@@ -50,6 +50,13 @@ const char **test_argv;
 /* Test option: Print more output */
 static svn_boolean_t verbose_mode = FALSE;
 
+/* Test option: Trap SVN_ERR_ASSERT failures in the code under test. Default
+ * is false so the test can easily be run in a debugger with the debugger
+ * catching the assertion failure. Test suites should enable this in order
+ * to be able to continue with other sub-tests and report the results even
+ * when a test hits an assertion failure. */
+static svn_boolean_t trap_assertion_failures = FALSE;
+
 /* Test option: Print only unexpected results */
 static svn_boolean_t quiet_mode = FALSE;
 
@@ -62,6 +69,7 @@ enum {
   fstype_opt,
   list_opt,
   verbose_opt,
+  trap_assert_opt,
   quiet_opt,
   config_opt,
   server_minor_version_opt
@@ -82,6 +90,8 @@ static const apr_getopt_option_t cl_opti
   {"server-minor-version", server_minor_version_opt, 1,
                     N_("set the minor version for the server ('3', '4',\n"
                        "'5', or '6')")},
+  {"trap-assertion-failures", trap_assert_opt, 0,
+                    N_("catch and report SVN_ERR_ASSERT failures")},
   {"quiet",         quiet_opt, 0,
                     N_("print only unexpected results")},
   {0,               0, 0, 0}
@@ -107,6 +117,7 @@ cleanup_rmtree(void *data)
 
       /* Ignore errors here. */
       svn_error_t *err = svn_io_remove_dir2(path, FALSE, NULL, NULL, pool);
+      svn_error_clear(err);
       if (verbose_mode)
         {
           if (err)
@@ -127,6 +138,7 @@ svn_test_add_dir_cleanup(const char *pat
     {
       const char *abspath;
       svn_error_t *err = svn_path_get_absolute(&abspath, path, cleanup_pool);
+      svn_error_clear(err);
       if (!err)
         apr_pool_cleanup_register(cleanup_pool, abspath, cleanup_rmtree,
                                   apr_pool_cleanup_null);
@@ -250,7 +262,7 @@ do_test_num(const char *progname,
         printf("WARNING: Test docstring exceeds 50 characters\n");
       if (msg[len - 1] == '.')
         printf("WARNING: Test docstring ends in a period (.)\n");
-      if (apr_isupper(msg[0]))
+      if (svn_ctype_isupper(msg[0]))
         printf("WARNING: Test docstring is capitalized\n");
     }
   if (desc->msg == NULL)
@@ -350,6 +362,9 @@ main(int argc, const char *argv[])
         case verbose_opt:
           verbose_mode = TRUE;
           break;
+        case trap_assert_opt:
+          trap_assertion_failures = TRUE;
+          break;
         case quiet_opt:
           quiet_mode = TRUE;
           break;
@@ -383,6 +398,9 @@ main(int argc, const char *argv[])
   cleanup_pool = svn_pool_create(pool);
   test_pool = svn_pool_create(pool);
 
+  if (trap_assertion_failures)
+    svn_error_set_malfunction_handler(svn_error_raise_on_malfunction);
+
   if (argc >= 2)  /* notice command-line arguments */
     {
       if (! strcmp(argv[1], "list") || list_mode)
@@ -407,7 +425,7 @@ main(int argc, const char *argv[])
         {
           for (i = 1; i < argc; i++)
             {
-              if (apr_isdigit(argv[i][0]))
+              if (svn_ctype_isdigit(argv[i][0]))
                 {
                   ran_a_test = TRUE;
                   test_num = atoi(argv[i]);

Modified: subversion/branches/py-tests-as-modules/tools/backup/hot-backup.py.in
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/tools/backup/hot-backup.py.in?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/tools/backup/hot-backup.py.in (original)
+++ subversion/branches/py-tests-as-modules/tools/backup/hot-backup.py.in Wed Sep 15 19:32:26 2010
@@ -106,6 +106,7 @@ Options:
                        zip  : Creates a compressed zip file.
                        zip64: Creates a zip64 file (can be > 2GB).
   --num-backups=N    Number of prior backups to keep around (0 to keep all).
+  --verify           Verify the backup.
   --help      -h     Print this help message and exit.
 
 """ % (scriptname,))
@@ -114,6 +115,7 @@ Options:
 try:
   opts, args = getopt.gnu_getopt(sys.argv[1:], "h?", ["archive-type=",
                                                       "num-backups=",
+                                                      "verify",
                                                       "help"])
 except getopt.GetoptError, e:
   sys.stderr.write("ERROR: %s\n\n" % e)
@@ -122,12 +124,15 @@ except getopt.GetoptError, e:
   sys.exit(2)
 
 archive_type = None
+verify_copy = False
 
 for o, a in opts:
   if o == "--archive-type":
     archive_type = a
   elif o == "--num-backups":
     num_backups = int(a)
+  elif o == "--verify":
+    verify_copy = True
   elif o in ("-h", "--help", "-?"):
     usage()
     sys.exit()
@@ -266,8 +271,18 @@ if err_code != 0:
 else:
   print("Done.")
 
+### Step 4: Verify the hotcopy
+if verify_copy:
+  print("Verifying backup...")
+  err_code = subprocess.call([svnadmin, "verify", "--quiet", backup_subdir])
+  if err_code != 0:
+    sys.stderr.write("Backup verification failed.\n")
+    sys.stderr.flush()
+    sys.exit(err_code)
+  else:
+    print("Done.")
 
-### Step 4: Make an archive of the backup if required.
+### Step 5: Make an archive of the backup if required.
 if archive_type:
   archive_path = backup_subdir + archive_map[archive_type]
   err_msg = ""
@@ -321,7 +336,7 @@ if archive_type:
     print("Archive created, removing backup '" + backup_subdir + "'...")
     safe_rmtree(backup_subdir, 1)
 
-### Step 5: finally, remove all repository backups other than the last
+### Step 6: finally, remove all repository backups other than the last
 ###         NUM_BACKUPS.
 
 if num_backups > 0:

Modified: subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd (original)
+++ subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd Wed Sep 15 19:32:26 2010
@@ -23,6 +23,23 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDE
 CALL ..\svn-config.cmd
 IF ERRORLEVEL 1 EXIT /B 1
 
+svnversion . /1.6.x | find "S" > nul:
+IF ERRORLEVEL 1 (
+  ECHO --- Building 1.6.x: Skipping bindings ---
+  EXIT /B 0
+)
+
+PATH %PATH%;%TESTDIR%\bin
+SET result=0
+
+
+echo python win-tests.py -r -f fsfs --javahl "%TESTDIR%\tests"
+python win-tests.py -r -f fsfs --javahl "%TESTDIR%\tests"
+IF ERRORLEVEL 1 (
+  echo [python reported error %ERRORLEVEL%]
+  SET result=1
+)
+
 IF EXIST "%TESTDIR%\swig" rmdir /s /q "%TESTDIR%\swig"
 mkdir "%TESTDIR%\swig\py-release\libsvn"
 mkdir "%TESTDIR%\swig\py-release\svn"
@@ -32,8 +49,12 @@ xcopy "release\subversion\bindings\swig\
 xcopy "subversion\bindings\swig\python\*.py" "%TESTDIR%\swig\py-release\libsvn\*.py"
 xcopy "subversion\bindings\swig\python\svn\*.py" "%TESTDIR%\swig\py-release\svn\*.py"
 
-PATH %PATH%;%TESTDIR%\bin
 SET PYTHONPATH=%TESTDIR%\swig\py-release
 
 python subversion\bindings\swig\python\tests\run_all.py
-IF ERRORLEVEL 1 EXIT /B 1
+IF ERRORLEVEL 1 (
+  echo [Python reported error %ERRORLEVEL%]
+  SET result=1
+)
+
+exit /b %result%

Modified: subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd (original)
+++ subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd Wed Sep 15 19:32:26 2010
@@ -23,5 +23,11 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDE
 CALL ..\svn-config.cmd
 IF ERRORLEVEL 1 EXIT /B 1
 
+svnversion . /1.6.x | find "S" > nul:
+IF ERRORLEVEL 1 (
+  ECHO --- Building 1.6.x: Skipping bindings ---
+  EXIT /B 0
+)
+
 msbuild subversion_vcnet.sln /p:Configuration=Release /p:Platform=win32 /t:__JAVAHL__ /t:__SWIG_PYTHON__ /t:__SWIG_PERL__ /t:__JAVAHL_TESTS__
 IF ERRORLEVEL 1 EXIT /B 1 

Modified: subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd (original)
+++ subversion/branches/py-tests-as-modules/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd Wed Sep 15 19:32:26 2010
@@ -51,9 +51,14 @@ POPD
 taskkill /im svn.exe /f 2> nul:
 taskkill /im svnadmin.exe /f 2> nul:
 taskkill /im svnserve.exe /f 2> nul:
+taskkill /im svnrdump.exe /f 2> nul:
+taskkill /im svnsync.exe /f 2> nul:
 taskkill /im httpd.exe /f 2> nul:
 IF EXIST "%TESTDIR%\tests\subversion\tests\cmdline\httpd\" (
   rmdir /s /q  "%TESTDIR%\tests\subversion\tests\cmdline\httpd"
 )
 
+del "%TESTDIR%\tests\*.log" 2> nul:
+
+
 exit /B 0

Modified: subversion/branches/py-tests-as-modules/tools/client-side/svn-viewspec.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/tools/client-side/svn-viewspec.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/tools/client-side/svn-viewspec.py (original)
+++ subversion/branches/py-tests-as-modules/tools/client-side/svn-viewspec.py Wed Sep 15 19:32:26 2010
@@ -20,9 +20,10 @@
 # ====================================================================
 
 """\
-Usage: 1. __SCRIPTNAME__ VIEWSPEC-FILE TARGET-DIR
-       2. __SCRIPTNAME__ VIEWSPEC-FILE --dump-tree
-       3. __SCRIPTNAME__ --help
+Usage: 1. __SCRIPTNAME__ checkout VIEWSPEC-FILE TARGET-DIR
+       2. __SCRIPTNAME__ examine VIEWSPEC-FILE
+       3. __SCRIPTNAME__ help
+       4. __SCRIPTNAME__ help-format
 
 VIEWSPEC-FILE is the path of a file whose contents describe a
 Subversion sparse checkouts layout, or '-' if that description should
@@ -34,9 +35,14 @@ by this script as it checks out the spec
 
 2. Parse VIEWSPEC-FILE and dump out a human-readable representation of
    the tree described in the specification.
-
+   
 3. Show this usage message.
 
+4. Show information about the file format this program expects.
+
+"""
+
+FORMAT_HELP = """\
 Viewspec File Format
 ====================
 
@@ -93,7 +99,7 @@ script in conjunction with 'svn cat' to 
 versioned viewspec file:
 
     $ svn cat http://svn.example.com/specs/dev-spec.txt |
-         __SCRIPTNAME__ - /path/to/target/directory
+         __SCRIPTNAME__ checkout - /path/to/target/directory
 
 """
 
@@ -294,32 +300,47 @@ def checkout_spec(viewspec, target_dir):
                   viewspec.tree,
                   target_dir)
 
+def usage_and_exit(errmsg=None):
+    stream = errmsg and sys.stderr or sys.stdout
+    msg = __doc__.replace("__SCRIPTNAME__", os.path.basename(sys.argv[0]))
+    stream.write(msg)
+    if errmsg:
+        stream.write("ERROR: %s\n" % (errmsg))
+    sys.exit(errmsg and 1 or 0)
+    
 def main():
-    if len(sys.argv) < 3 or '--help' in sys.argv:
-        msg = __doc__.replace("__SCRIPTNAME__", os.path.basename(sys.argv[0]))
-        sys.stderr.write(msg)
-        sys.exit(1)
-    if sys.argv[1] == '-':
-        fp = sys.stdin
-    else:
-        fp = open(sys.argv[1], 'r')
-    if sys.argv[2] == '--dump-tree':
-        target_dir = None
-    else:
-        target_dir = sys.argv[2]
-
-    viewspec = parse_viewspec(fp)
-    if target_dir is None:
-        sys.stderr.write("Url: %s\n" % (viewspec.base_url))
+    argc = len(sys.argv)
+    if argc < 2:
+        usage_and_exit('Not enough arguments.')
+    subcommand = sys.argv[1]
+    if subcommand == 'help':
+        usage_and_exit()
+    elif subcommand == 'help-format':
+        msg = FORMAT_HELP.replace("__SCRIPTNAME__",
+                                  os.path.basename(sys.argv[0]))
+        sys.stdout.write(msg)
+    elif subcommand == 'examine':
+        if argc < 3:
+            usage_and_exit('No viewspec file specified.')
+        fp = (sys.argv[2] == '-') and sys.stdin or open(sys.argv[2], 'r')
+        viewspec = parse_viewspec(fp)
+        sys.stdout.write("Url: %s\n" % (viewspec.base_url))
         revision = viewspec.revision
         if revision != -1:
-            sys.stderr.write("Revision: %s\n" % (revision))
+            sys.stdout.write("Revision: %s\n" % (revision))
         else:
-            sys.stderr.write("Revision: HEAD\n")
-        sys.stderr.write("\n")
+            sys.stdout.write("Revision: HEAD\n")
+        sys.stdout.write("\n")
         viewspec.tree.dump(True)
+    elif subcommand == 'checkout':
+        if argc < 3:
+            usage_and_exit('No viewspec file specified.')
+        if argc < 4:
+            usage_and_exit('No target directory specified.')
+        fp = (sys.argv[2] == '-') and sys.stdin or open(sys.argv[2], 'r')
+        checkout_spec(parse_viewspec(fp), sys.argv[3])
     else:
-        checkout_spec(viewspec, target_dir)
-
+        usage_and_exit('Unknown subcommand "%s".' % (subcommand))
+    
 if __name__ == "__main__":
     main()

Propchange: subversion/branches/py-tests-as-modules/tools/dev/svnraisetreeconflict/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep 15 19:32:26 2010
@@ -1 +1,2 @@
 .libs
+svnraisetreeconflict

Modified: subversion/branches/py-tests-as-modules/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/tools/dev/unix-build/Makefile.svn?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/py-tests-as-modules/tools/dev/unix-build/Makefile.svn Wed Sep 15 19:32:26 2010
@@ -2,31 +2,6 @@
 #
 # WARNING: This may or may not work on your system. This Makefile is
 # an example, rather than a ready-made universal solution.
-#
-# This Makefile builds and installs Subversion, and many of its
-# dependencies, on UNIX-like systems, in the current working directory.
-# Indirect dependencies are not covered, e.g. you need OpenSSL installed
-# to get SSL support in neon and serf.
-#
-# The Makefile can also run Subversion's regression test suite via all
-# repository backends and RA methods. It generates the necessary configuration
-# files and starts svnserve and httpd daemons automatically on non-privileged
-# ports.
-#
-# Some version of Subversion is required to be in $PATH and will be used
-# to check out working copies.
-#
-# The default is to compile trunk.
-# Pass the branch you want to build in BRANCH, e.g.
-#	$ make BRANCH="1.5.x"
-# You can also pass a tag to build:
-#       $ make TAG="1.6.6"
-# And you can specify a working copy to use, in case you need more
-# than one working copy of the same branch:
-#	$ make BRANCH="1.6.x" WC="1.6.x-test2"
-#
-# After the build, point your PATH to the Subversion build you want to use.
-# Note that this Makefile requires GNU make.
 
 ENABLE_PYTHON_BINDINGS ?= yes
 ENABLE_RUBY_BINDINGS ?= yes
@@ -35,6 +10,7 @@ ENABLE_JAVA_BINDINGS ?= no # they don't 
 USE_APR_ICONV ?= no # set to yes to use APR iconv instead of GNU iconv
 
 PWD		= $(shell pwd)
+UNAME		= $(shell uname)
 
 TAG		?= none
 ifeq ($(TAG),none)
@@ -61,7 +37,8 @@ GNU_ICONV_VER	= 1.13.1
 APR_UTIL_VER	= 1.3.9
 HTTPD_VER	= 2.2.15
 NEON_VER	= 0.29.3
-SERF_VER	= 0.6.x
+SERF_VER	= 0.7.x
+CYRUS_SASL_VER	= 2.1.23
 SQLITE_VER	= 3.6.23.1
 
 BDB_DIST	= db-$(BDB_VER).tar.gz
@@ -70,6 +47,7 @@ GNU_ICONV_DIST	= libiconv-$(GNU_ICONV_VE
 NEON_DIST	= neon-$(NEON_VER).tar.gz
 #SERF_DIST	= serf-$(SERF_VER).tar.gz
 SQLITE_DIST	= sqlite-$(SQLITE_VER).tar.gz
+CYRUS_SASL_DIST	= cyrus-sasl-$(CYRUS_SASL_VER).tar.gz
 HTTPD_DIST	= httpd-$(HTTPD_VER).tar.bz2
 
 DISTFILES	= $(DISTDIR)/$(NEON_DIST) \
@@ -77,21 +55,23 @@ DISTFILES	= $(DISTDIR)/$(NEON_DIST) \
 		$(DISTDIR)/$(SQLITE_DIST) \
 		$(DISTDIR)/$(HTTPD_DIST) \
 		$(DISTDIR)/$(APR_ICONV_DIST) \
-		$(DISTDIR)/$(GNU_ICONV_DIST)
+		$(DISTDIR)/$(GNU_ICONV_DIST) \
+		$(DISTDIR)/$(CYRUS_SASL_DIST)
 
 FETCH_CMD	= wget -c
 
 SUBVERSION_REPOS_URL = https://svn.apache.org/repos/asf/subversion
 BDB_URL		= http://ftp2.de.freebsd.org/pub/FreeBSD/distfiles/bdb/$(BDB_DIST)
 APR_URL		= http://svn.apache.org/repos/asf/apr/apr
-APR_ICONV_URL	= ftp://ftp.fu-berlin.de/unix/www/apache/apr/$(APR_ICONV_DIST)
-GNU_ICONV_URL	= ftp://ftp.fu-berlin.de/unix/gnu/libiconv/$(GNU_ICONV_DIST)
+APR_ICONV_URL	= http://www.apache.org/dist/apr/$(APR_ICONV_DIST)
+GNU_ICONV_URL	= http://ftp.gnu.org/pub/gnu/libiconv/$(GNU_ICONV_DIST)
 APR_UTIL_URL	= http://svn.apache.org/repos/asf/apr/apr-util
 HTTPD_URL	= http://archive.apache.org/dist/httpd/$(HTTPD_DIST)
 NEON_URL	= http://webdav.org/neon/$(NEON_DIST)
 #SERF_URL	= http://serf.googlecode.com/files/$(SERF_DIST)
 SERF_URL	= http://serf.googlecode.com/svn/branches/$(SERF_VER)
 SQLITE_URL	= http://www.sqlite.org/$(SQLITE_DIST)
+CYRUS_SASL_URL	= ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/$(CYRUS_SASL_DIST)
 
 BDB_SRCDIR	= $(SRCDIR)/db-$(BDB_VER)
 APR_SRCDIR	= $(SRCDIR)/apr-$(APR_VER)
@@ -102,6 +82,7 @@ HTTPD_SRCDIR	= $(SRCDIR)/httpd-$(HTTPD_V
 NEON_SRCDIR	= $(SRCDIR)/neon-$(NEON_VER)
 SERF_SRCDIR	= $(SRCDIR)/serf-$(SERF_VER)
 SQLITE_SRCDIR	= $(SRCDIR)/sqlite-$(SQLITE_VER)
+CYRUS_SASL_SRCDIR	= $(SRCDIR)/cyrus-sasl-$(CYRUS_SASL_VER)
 SVN_SRCDIR	= $(SVN_WC)
 
 BDB_OBJDIR	= $(OBJDIR)/db-$(BDB_VER)
@@ -113,6 +94,7 @@ HTTPD_OBJDIR	= $(OBJDIR)/httpd-$(HTTPD_V
 NEON_OBJDIR	= $(OBJDIR)/neon-$(NEON_VER)
 SERF_OBJDIR	= $(OBJDIR)/serf-$(SERF_VER)
 SQLITE_OBJDIR	= $(OBJDIR)/sqlite-$(SQLITE_VER)
+CYRUS_SASL_OBJDIR	= $(OBJDIR)/cyrus-sasl-$(CYRUS_SASL_VER)
 SVN_OBJDIR	= $(OBJDIR)/$(SVN_REL_WC)
 
 # Tweak this for out-of-tree builds. Note that running individual
@@ -127,16 +109,17 @@ svn_builddir	?=$(SVN_WC)
 .PHONY: all reset clean nuke
 
 all: dirs-create bdb-install apr-install iconv-install apr-util-install \
-	httpd-install neon-install serf-install sqlite-install svn-install \
-	svn-bindings-install
+	httpd-install neon-install serf-install sqlite-install \
+	cyrus-sasl-install svn-install svn-bindings-install
 
 # Use these to start a build from the beginning.
 reset: dirs-reset bdb-reset apr-reset iconv-reset apr-util-reset \
-	httpd-reset neon-reset serf-reset sqlite-reset svn-reset
+	httpd-reset neon-reset serf-reset sqlite-reset cyrus-sasl-reset \
+	svn-reset
 
 # Use to save disc space.
 clean: bdb-clean apr-clean iconv-clean apr-util-clean httpd-clean \
-	neon-clean serf-clean svn-clean
+	neon-clean serf-clean cyrus-sasl-clean svn-clean
 
 # Nukes everything (including installed binaries!)
 # Use this to start ALL OVER AGAIN! Use with caution!
@@ -154,7 +137,7 @@ nuke:
 			yes)    echo "You said $$ANSWER. I will continue."; \
 				echo rm -rf $(SRCDIR) $(OBJDIR) $(PREFIX); \
 				rm -rf $(SRCDIR) $(OBJDIR) $(PREFIX); \
-				echo "Remember to reset the build!"; \
+				$(MAKE) reset; \
 				;; \
 			"")     echo "You said no."; \
 				;; \
@@ -332,6 +315,7 @@ $(DISTDIR)/$(GNU_ICONV_DIST):
 	cd $(DISTDIR) && $(FETCH_CMD) $(GNU_ICONV_URL)
 
 $(GNU_ICONV_OBJDIR)/lib_encodings.def.diff:
+	[ -d $(GNU_ICONV_OBJDIR) ] || mkdir -p $(GNU_ICONV_OBJDIR)
 	echo "--- lib/encodings.def.orig	Wed Oct 24 23:41:41 2007" > $@
 	echo "+++ lib/encodings.def	Wed Oct 24 23:43:47 2007" >> $@
 	echo "@@ -37,6 +37,7 @@" >> $@
@@ -344,6 +328,7 @@ $(GNU_ICONV_OBJDIR)/lib_encodings.def.di
 	echo "               \"ISO_646.IRV:1991\",       /* IANA */" >> $@
 
 $(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff:
+	[ -d $(GNU_ICONV_OBJDIR) ] || mkdir -p $(GNU_ICONV_OBJDIR)
 	echo "--- lib/aliases.gperf.orig	Wed Oct 24 23:41:32 2007" > $@
 	echo "+++ lib/aliases.gperf	Wed Oct 24 23:47:38 2007" >> $@
 	echo "@@ -10,6 +10,7 @@ struct alias { int name; unsigned int encoding_index; " >> $@
@@ -360,7 +345,6 @@ $(GNU_ICONV_OBJDIR)/lib_aliases.gperf.di
 $(GNU_ICONV_OBJDIR)/.retrieved: $(DISTDIR)/$(GNU_ICONV_DIST) \
 		$(GNU_ICONV_OBJDIR)/lib_encodings.def.diff \
 		$(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff
-	[ -d $(GNU_ICONV_OBJDIR) ] || mkdir -p $(GNU_ICONV_OBJDIR)
 	tar -C $(SRCDIR) -zxf $(DISTDIR)/$(GNU_ICONV_DIST)
 	cd $(SRCDIR)/libiconv-$(GNU_ICONV_VER) && \
 		patch -p0 < $(GNU_ICONV_OBJDIR)/lib_encodings.def.diff && \
@@ -552,14 +536,26 @@ $(NEON_OBJDIR)/.retrieved: $(DISTDIR)/$(
 	tar -C $(SRCDIR) -zxf $(DISTDIR)/$(NEON_DIST)
 	touch $@
 
+# OpenBSD does not have krb5-config in PATH, but the neon port has
+# a suitable replacement.
+ifeq ($(UNAME),OpenBSD)
+KRB5_CONFIG_PATH=/usr/ports/net/neon/files
+endif
+
 # configure neon
 $(NEON_OBJDIR)/.configured: $(NEON_OBJDIR)/.retrieved
 	cd $(NEON_SRCDIR) && ./autogen.sh
+	if [ -n "$(KRB5_CONFIG_PATH)" -a -d "$(KRB5_CONFIG_PATH)" ]; then \
+		cp $(KRB5_CONFIG_PATH)/krb5-config $(NEON_OBJDIR); \
+		chmod +x $(NEON_OBJDIR)/krb5-config; \
+	fi
 	cd $(NEON_OBJDIR) \
 		&& env CFLAGS="-g" $(NEON_SRCDIR)/configure \
+		PATH=$(NEON_OBJDIR):$$PATH \
 		--prefix=$(PREFIX)/neon \
 		--with-ssl \
-		--enable-shared
+		--enable-shared \
+		--without-libproxy
 	touch $@
 
 # compile neon
@@ -668,6 +664,62 @@ $(SQLITE_OBJDIR)/.installed: $(SQLITE_OB
 	touch $@
 
 #######################################################################
+# cyrus-sasl
+#######################################################################
+
+cyrus-sasl-retrieve:	$(CYRUS_SASL_OBJDIR)/.retrieved
+cyrus-sasl-configure:	$(CYRUS_SASL_OBJDIR)/.configured
+cyrus-sasl-compile:	$(CYRUS_SASL_OBJDIR)/.compiled
+cyrus-sasl-install:	$(CYRUS_SASL_OBJDIR)/.installed
+cyrus-sasl-reset:
+	$(foreach f, .retrieved .configured .compiled .installed, \
+		rm -f $(CYRUS_SASL_OBJDIR)/$(f);)
+
+cyrus-sasl-clean:
+	-(cd $(CYRUS_SASL_OBJDIR) && make clean)
+
+# fetch distfile for cyrus-sasl
+$(DISTDIR)/$(CYRUS_SASL_DIST):
+	cd $(DISTDIR) && $(FETCH_CMD) $(CYRUS_SASL_URL)
+
+# retrieve cyrus-sasl
+$(CYRUS_SASL_OBJDIR)/.retrieved: $(DISTDIR)/$(CYRUS_SASL_DIST)
+	[ -d $(CYRUS_SASL_OBJDIR) ] || mkdir -p $(CYRUS_SASL_OBJDIR)
+	tar -C $(SRCDIR) -zxf $(DISTDIR)/$(CYRUS_SASL_DIST)
+	# fixes build on Debian:
+	sed 's/#elif WITH_DES/#elif defined(WITH_DES)/' \
+		< $(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c \
+		> $(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c.patched
+	mv $(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c.patched \
+		$(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c
+	touch $@
+
+# configure cyrus-sasl
+$(CYRUS_SASL_OBJDIR)/.configured: $(CYRUS_SASL_OBJDIR)/.retrieved
+	cd $(CYRUS_SASL_OBJDIR) \
+		&& env CFLAGS="-g" $(CYRUS_SASL_SRCDIR)/configure \
+		--with-dbpath=$(PREFIX)/cyrus-sasl/etc/sasldb2 \
+		--with-plugindir=$(PREFIX)/cyrus-sasl/lib/sasl2 \
+		--with-configdir=$(PREFIX)/cyrus-sasl/lib/sasl2 \
+		--with-bdb-libdir=$(PREFIX)/bdb/lib \
+		--with-bdb-incdir=$(PREFIX)/bdb/include \
+		--with-dblib=berkeley \
+		--with-sqlite=$(PREFIX)/sqlite \
+		--prefix=$(PREFIX)/cyrus-sasl
+	touch $@
+
+# compile cyrus-sasl
+$(CYRUS_SASL_OBJDIR)/.compiled: $(CYRUS_SASL_OBJDIR)/.configured
+	(cd $(CYRUS_SASL_OBJDIR) && make)
+	touch $@
+
+# install cyrus-sasl
+$(CYRUS_SASL_OBJDIR)/.installed: $(CYRUS_SASL_OBJDIR)/.compiled
+	(cd $(CYRUS_SASL_OBJDIR) && make install)
+	touch $@
+
+
+#######################################################################
 # svn
 #######################################################################
 
@@ -758,7 +810,7 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)
 			--with-serf="$(PREFIX)/serf" \
 			--with-sqlite="$(PREFIX)/sqlite" \
 			--with-berkeley-db="$(BDB_FLAG)" \
-			--with-sasl="no" \
+			--with-sasl="$(PREFIX)/cyrus-sasl" \
 			--with-ruby-sitedir="$(SVN_PREFIX)/lib/ruby/site_ruby" \
 			--disable-mod-activation \
 			$(JAVAHL_FLAG)

Propchange: subversion/branches/py-tests-as-modules/tools/server-side/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep 15 19:32:26 2010
@@ -1,3 +1,4 @@
 .libs
 svn-populate-node-origins-index
 svnauthz-validate
+svn-rep-sharing-stats

Modified: subversion/branches/py-tests-as-modules/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/win-tests.py?rev=997472&r1=997471&r2=997472&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/win-tests.py (original)
+++ subversion/branches/py-tests-as-modules/win-tests.py Wed Sep 15 19:32:26 2010
@@ -27,7 +27,7 @@ For a list of options, run this script w
 # $HeadURL$
 # $LastChangedRevision$
 
-import os, sys
+import os, sys, subprocess
 import filecmp
 import shutil
 import traceback
@@ -59,6 +59,7 @@ def _usage_exit():
   print("  -u URL, --url=URL      : run ra_dav or ra_svn tests against URL;")
   print("                           will start svnserve for ra_svn tests")
   print("  -v, --verbose          : talk more")
+  print("  -q, --quiet            : talk less")
   print("  -f, --fs-type=type     : filesystem type to use (fsfs is default)")
   print("  -c, --cleanup          : cleanup after running a test")
   print("  -t, --test=TEST        : Run the TEST test (all is default); use")
@@ -76,6 +77,7 @@ def _usage_exit():
   print("  --httpd-daemon         : Run Apache httpd as daemon")
   print("  --httpd-service        : Run Apache httpd as Windows service (default)")
   print("  --http-library         : dav library to use, neon (default) or serf")
+  print("  --javahl               : Run the javahl tests instead of the normal tests")
   print("  --list                 : print test doc strings only")
   print("  --enable-sasl          : enable Cyrus SASL authentication for")
   print("                           svnserve")
@@ -110,22 +112,23 @@ for section in gen_obj.sections.values()
     dll_basename = section.name + "-" + str(gen_obj.version) + ".dll"
     svn_dlls.append(os.path.join("subversion", section.name, dll_basename))
 
-opts, args = my_getopt(sys.argv[1:], 'hrdvct:pu:f:',
-                       ['release', 'debug', 'verbose', 'cleanup', 'test=',
-                        'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack',
+opts, args = my_getopt(sys.argv[1:], 'hrdvqct:pu:f:',
+                       ['release', 'debug', 'verbose', 'quiet', 'cleanup',
+                        'test=', 'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack',
                         'httpd-dir=', 'httpd-port=', 'httpd-daemon',
                         'httpd-server', 'http-library=', 'help',
-                        'fsfs-packing', 'fsfs-sharding=',
+                        'fsfs-packing', 'fsfs-sharding=', 'javahl',
                         'list', 'enable-sasl', 'bin=', 'parallel',
                         'config-file=', 'server-minor-version='])
 if len(args) > 1:
   print('Warning: non-option arguments after the first one will be ignored')
 
 # Interpret the options and set parameters
-base_url, fs_type, verbose, cleanup = None, None, None, None
+base_url, fs_type, verbose, quiet, cleanup = None, None, None, None, None
 repo_loc = 'local repository.'
 objdir = 'Debug'
 log = 'tests.log'
+faillog = 'fails.log'
 run_svnserve = None
 svnserve_args = None
 run_httpd = None
@@ -133,6 +136,7 @@ httpd_port = None
 httpd_service = None
 http_library = 'neon'
 list_tests = None
+test_javahl = None
 enable_sasl = None
 svn_bin = None
 parallel = None
@@ -151,6 +155,8 @@ for opt, val in opts:
     fs_type = val
   elif opt in ('-v', '--verbose'):
     verbose = 1
+  elif opt in ('-q', '--quiet'):
+    quiet = 1
   elif opt in ('-c', '--cleanup'):
     cleanup = 1
   elif opt in ('-t', '--test'):
@@ -179,6 +185,8 @@ for opt, val in opts:
     fsfs_sharding = int(val)
   elif opt == '--fsfs-packing':
     fsfs_packing = 1
+  elif opt == '--javahl':
+    test_javahl = 1
   elif opt == '--list':
     list_tests = 1
   elif opt == '--enable-sasl':
@@ -222,13 +230,16 @@ if base_url:
   repo_loc = 'remote repository ' + base_url + '.'
   if base_url[:4] == 'http':
     log = 'dav-tests.log'
+    faillog = 'dav-fails.log'
   elif base_url[:3] == 'svn':
     log = 'svn-tests.log'
+    faillog = 'svn-fails.log'
     run_svnserve = 1
   else:
     # Don't know this scheme, but who're we to judge whether it's
     # correct or not?
     log = 'url-tests.log'
+    faillog = 'url-fails.log'
 
 # Have to move the executables where the tests expect them to be
 copied_execs = []   # Store copied exec files to avoid the final dir scan
@@ -460,6 +471,7 @@ class Httpd:
       fp.write(self._sys_module('authn_file_module', 'mod_authn_file.so'))
     else:
       fp.write(self._sys_module('auth_module', 'mod_auth.so'))
+    fp.write(self._sys_module('alias_module', 'mod_alias.so'))
     fp.write(self._sys_module('mime_module', 'mod_mime.so'))
     fp.write(self._sys_module('log_config_module', 'mod_log_config.so'))
 
@@ -471,10 +483,16 @@ class Httpd:
     fp.write(self._svn_repo('repositories'))
     fp.write(self._svn_repo('local_tmp'))
 
+    # And two redirects for the redirect tests
+    fp.write('RedirectMatch permanent ^/svn-test-work/repositories/' 
+             'REDIRECT-PERM-(.*)$ /svn-test-work/repositories/$1\n')
+    fp.write('RedirectMatch           ^/svn-test-work/repositories/'
+             'REDIRECT-TEMP-(.*)$ /svn-test-work/repositories/$1\n')
+
     fp.write('TypesConfig     ' + self._quote(self.httpd_mime_types) + '\n')
     fp.write('LogLevel        Debug\n')
     fp.write('HostNameLookups Off\n')
-
+    
     fp.close()
 
   def __del__(self):
@@ -638,24 +656,65 @@ else:
 
 print('Testing %s configuration on %s' % (objdir, repo_loc))
 sys.path.insert(0, os.path.join(abs_srcdir, 'build'))
-import run_tests
-th = run_tests.TestHarness(abs_srcdir, abs_builddir,
-                           os.path.join(abs_builddir, log),
-                           base_url, fs_type, http_library,
-                           server_minor_version, 1, cleanup,
-                           enable_sasl, parallel, config_file,
-                           fsfs_sharding, fsfs_packing,
-                           list_tests, svn_bin)
-old_cwd = os.getcwd()
-try:
-  os.chdir(abs_builddir)
-  failed = th.run(tests_to_run)
-except:
-  os.chdir(old_cwd)
-  raise
-else:
-  os.chdir(old_cwd)
 
+if not test_javahl:
+  import run_tests
+  th = run_tests.TestHarness(abs_srcdir, abs_builddir,
+                             os.path.join(abs_builddir, log),
+                             os.path.join(abs_builddir, faillog),
+                             base_url, fs_type, http_library,
+                             server_minor_version, not quiet,
+                             cleanup, enable_sasl, parallel, config_file,
+                             fsfs_sharding, fsfs_packing,
+                             list_tests, svn_bin)
+  old_cwd = os.getcwd()
+  try:
+    os.chdir(abs_builddir)
+    failed = th.run(tests_to_run)
+  except:
+    os.chdir(old_cwd)
+    raise
+  else:
+    os.chdir(old_cwd)
+else:
+  failed = False
+  args = (
+          'java.exe',
+          '-Dtest.rootdir=' + os.path.join(abs_builddir, 'javahl'),
+          '-Dtest.srcdir=' + os.path.join(abs_srcdir,
+                                          'subversion/bindings/javahl'),
+          '-Dtest.rooturl=',
+          '-Dtest.fstype=' + fs_type ,
+          '-Dtest.tests=',
+          
+          '-Djava.library.path=' 
+                    + os.path.join(abs_objdir,
+                                   'subversion/bindings/javahl/native'),
+          '-classpath', 
+          os.path.join(abs_srcdir, 'subversion/bindings/javahl/classes') +';' +
+            gen_obj.junit_path
+         )
+  
+  sys.stderr.flush()        
+  print('Running org.apache.subversion tests:')
+  sys.stdout.flush()
+  
+  r = subprocess.call(args + tuple(['org.apache.subversion.javahl.RunTests']))
+  sys.stdout.flush()
+  sys.stderr.flush()
+  if (r != 0):
+    print('[Test runner reported failure]')
+    failed = True
+  
+  print('Running org.tigris.subversion tests:')
+  sys.stdout.flush()
+  r = subprocess.call(args + tuple(['org.tigris.subversion.javahl.RunTests']))
+  sys.stdout.flush()
+  sys.stderr.flush()
+  if (r != 0):
+    print('[Test runner reported failure]')
+    failed = True
+  
 # Stop service daemon, if any
 if daemon:
   del daemon