subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1438999 [7/7] - in /subversion/branches/windows-build-update: ./ build/generator/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_diff/ subversion/libsvn_ra_serf/ subversion/libsvn_repos/ subvers...
Date Sun, 27 Jan 2013 00:01:59 GMT
Modified: subversion/branches/windows-build-update/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/windows-build-update/subversion/tests/libsvn_wc/op-depth-test.c?rev=1438999&r1=1438998&r2=1438999&view=diff
==============================================================================
--- subversion/branches/windows-build-update/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/windows-build-update/subversion/tests/libsvn_wc/op-depth-test.c Sun
Jan 27 00:01:57 2013
@@ -5704,6 +5704,8 @@ nested_moves2(const svn_test_opts_t *opt
   SVN_ERR(sbox_wc_mkdir(&b, "A/A/A/A/A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/A/A/A/A/A"));
   SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "X"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
 
   SVN_ERR(sbox_wc_move(&b, "A/A/A/A/A/A", "C"));
   SVN_ERR(sbox_wc_move(&b, "A/A/A/A", "D"));
@@ -5712,6 +5714,7 @@ nested_moves2(const svn_test_opts_t *opt
   {
     nodes_row_t nodes[] = {
       {0, "",            "normal",       0, ""},
+      {0, "X",           "normal",       2, "X"},
       {0, "A",           "normal",       1, "A"},
       {0, "A/A",         "normal",       1, "A/A"},
       {0, "A/A/A",       "normal",       1, "A/A/A"},
@@ -5740,9 +5743,289 @@ nested_moves2(const svn_test_opts_t *opt
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
+
+  SVN_ERR(sbox_wc_update(&b, "A", 2));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",            "normal",       0, ""},
+      {0, "X",           "normal",       2, "X"},
+      {0, "A",           "normal",       2, "A"},
+      {0, "A/A",         "normal",       2, "A/A"},
+      {0, "A/A/A",       "normal",       2, "A/A/A"},
+      {0, "A/A/A/A",     "normal",       2, "A/A/A/A"},
+      {0, "A/A/A/A/A",   "normal",       2, "A/A/A/A/A"},
+      {0, "A/A/A/A/A/A", "normal",       2, "A/A/A/A/A/A"},
+      {2, "A/A",         "base-deleted", NO_COPY_FROM, "E"},
+      {2, "A/A/A",       "base-deleted", NO_COPY_FROM},
+      {2, "A/A/A/A",     "base-deleted", NO_COPY_FROM},
+      {2, "A/A/A/A/A",   "base-deleted", NO_COPY_FROM},
+      {2, "A/A/A/A/A/A", "base-deleted", NO_COPY_FROM},
+      {1, "E",           "normal",       2, "A/A", MOVED_HERE},
+      {1, "E/A",         "normal",       2, "A/A/A", MOVED_HERE},
+      {1, "E/A/A",       "normal",       2, "A/A/A/A", MOVED_HERE},
+      {1, "E/A/A/A",     "normal",       2, "A/A/A/A/A", MOVED_HERE},
+      {1, "E/A/A/A/A",   "normal",       2, "A/A/A/A/A/A", MOVED_HERE},
+      {3, "E/A/A",       "base-deleted", NO_COPY_FROM, "D"},
+      {3, "E/A/A/A",     "base-deleted", NO_COPY_FROM},
+      {3, "E/A/A/A/A",   "base-deleted", NO_COPY_FROM},
+      {1, "D",           "normal",       2, "A/A/A/A", MOVED_HERE},
+      {1, "D/A",         "normal",       2, "A/A/A/A/A", MOVED_HERE},
+      {1, "D/A/A",       "normal",       2, "A/A/A/A/A/A", MOVED_HERE},
+      {3, "D/A/A",       "base-deleted", NO_COPY_FROM, "C"},
+      {1, "C",           "normal",       2, "A/A/A/A/A/A", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+move_in_delete(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "move_in_delete", opts, pool));
+
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C/D"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C/D/E"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "X"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+
+  SVN_ERR(sbox_wc_move(&b, "A/B/C", "C2"));
+  SVN_ERR(sbox_wc_delete(&b, "A/B"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",        "normal",       1, ""},
+      {0, "A",       "normal",       1, "A"},
+      {0, "A/B",     "normal",       1, "A/B"},
+      {0, "A/B/C",   "normal",       1, "A/B/C"},
+      {2, "A/B",     "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C",   "base-deleted", NO_COPY_FROM, "C2"},
+      {1, "C2",      "normal",       1, "A/B/C", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  /* This currently fails because the tree-conflict is recorded on the
+     deleted A/B, not the moved A/B/C. */
+  SVN_ERR(sbox_wc_resolve(&b, "A/B", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",        "normal",       1, ""},
+      {0, "A",       "normal",       1, "A"},
+      {0, "A/B",     "normal",       1, "A/B"},
+      {0, "A/B/C",   "normal",       1, "A/B/C"},
+      {0, "A/B/C/D", "normal",       1, "A/B/C/D"},
+      {2, "A/B",     "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C",   "base-deleted", NO_COPY_FROM, "C2"},
+      {2, "A/B/C/D", "base-deleted", NO_COPY_FROM},
+      {1, "C2",      "normal",       1, "A/B/C", MOVED_HERE},
+      {1, "C2/D",    "normal",       1, "A/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+switch_move(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "switch_move", opts, pool));
+
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/D"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/D/E"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_copy(&b, "A", "X"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "X/B/D/E/F"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_switch(&b, "/A"));
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+
+  SVN_ERR(sbox_wc_move(&b, "B/C", "C2"));
+  SVN_ERR(sbox_wc_move(&b, "B/D", "D2"));
+  SVN_ERR(sbox_wc_move(&b, "D2/E", "D2/E2"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",      "normal",       2, "A"},
+      {0, "B",     "normal",       2, "A/B"},
+      {0, "B/C",   "normal",       2, "A/B/C"},
+      {0, "B/D",   "normal",       2, "A/B/D"},
+      {0, "B/D/E", "normal",       2, "A/B/D/E"},
+      {2, "B/C",   "base-deleted", NO_COPY_FROM, "C2"},
+      {2, "B/D",   "base-deleted", NO_COPY_FROM, "D2"},
+      {2, "B/D/E", "base-deleted", NO_COPY_FROM},
+      {1, "C2",    "normal",       2, "A/B/C", MOVED_HERE},
+      {1, "D2",    "normal",       2, "A/B/D", MOVED_HERE},
+      {1, "D2/E",  "normal",       2, "A/B/D/E", MOVED_HERE},
+      {2, "D2/E",  "base-deleted", NO_COPY_FROM, "D2/E2"},
+      {2, "D2/E2", "normal",       2, "A/B/D/E", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Switch "bumps" revisions and paths and raises conflicts just like
+     update. */
+  SVN_ERR(sbox_wc_switch(&b, "/X"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",        "normal",       3, "X"},
+      {0, "B",       "normal",       3, "X/B"},
+      {0, "B/C",     "normal",       3, "X/B/C"},
+      {0, "B/D",     "normal",       3, "X/B/D"},
+      {0, "B/D/E",   "normal",       3, "X/B/D/E"},
+      {0, "B/D/E/F", "normal",       3, "X/B/D/E/F"},
+      {2, "B/C",     "base-deleted", NO_COPY_FROM, "C2"},
+      {2, "B/D",     "base-deleted", NO_COPY_FROM, "D2"},
+      {2, "B/D/E",   "base-deleted", NO_COPY_FROM},
+      {2, "B/D/E/F", "base-deleted", NO_COPY_FROM},
+      {1, "C2",      "normal",       3, "X/B/C", MOVED_HERE},
+      {1, "D2",      "normal",       2, "A/B/D", MOVED_HERE},
+      {1, "D2/E",    "normal",       2, "A/B/D/E", MOVED_HERE},
+      {2, "D2/E",    "base-deleted", NO_COPY_FROM, "D2/E2"},
+      {2, "D2/E2",   "normal",       2, "A/B/D/E", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Conflicts from switch are resolved just like those from update. */
+  SVN_ERR(sbox_wc_resolve(&b, "B/D", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",        "normal",       3, "X"},
+      {0, "B",       "normal",       3, "X/B"},
+      {0, "B/C",     "normal",       3, "X/B/C"},
+      {0, "B/D",     "normal",       3, "X/B/D"},
+      {0, "B/D/E",   "normal",       3, "X/B/D/E"},
+      {0, "B/D/E/F", "normal",       3, "X/B/D/E/F"},
+      {2, "B/C",     "base-deleted", NO_COPY_FROM, "C2"},
+      {2, "B/D",     "base-deleted", NO_COPY_FROM, "D2"},
+      {2, "B/D/E",   "base-deleted", NO_COPY_FROM},
+      {2, "B/D/E/F", "base-deleted", NO_COPY_FROM},
+      {1, "C2",      "normal",       3, "X/B/C", MOVED_HERE},
+      {1, "D2",      "normal",       3, "X/B/D", MOVED_HERE},
+      {1, "D2/E",    "normal",       3, "X/B/D/E", MOVED_HERE},
+      {1, "D2/E/F",  "normal",       3, "X/B/D/E/F", MOVED_HERE},
+      {2, "D2/E",    "base-deleted", NO_COPY_FROM, "D2/E2"},
+      {2, "D2/E/F",  "base-deleted", NO_COPY_FROM},
+      {2, "D2/E2",   "normal",       2, "A/B/D/E", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_resolve(&b, "D2/E", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",        "normal",       3, "X"},
+      {0, "B",       "normal",       3, "X/B"},
+      {0, "B/C",     "normal",       3, "X/B/C"},
+      {0, "B/D",     "normal",       3, "X/B/D"},
+      {0, "B/D/E",   "normal",       3, "X/B/D/E"},
+      {0, "B/D/E/F", "normal",       3, "X/B/D/E/F"},
+      {2, "B/C",     "base-deleted", NO_COPY_FROM, "C2"},
+      {2, "B/D",     "base-deleted", NO_COPY_FROM, "D2"},
+      {2, "B/D/E",   "base-deleted", NO_COPY_FROM},
+      {2, "B/D/E/F", "base-deleted", NO_COPY_FROM},
+      {1, "C2",      "normal",       3, "X/B/C", MOVED_HERE},
+      {1, "D2",      "normal",       3, "X/B/D", MOVED_HERE},
+      {1, "D2/E",    "normal",       3, "X/B/D/E", MOVED_HERE},
+      {1, "D2/E/F",  "normal",       3, "X/B/D/E/F", MOVED_HERE},
+      {2, "D2/E",    "base-deleted", NO_COPY_FROM, "D2/E2"},
+      {2, "D2/E/F",  "base-deleted", NO_COPY_FROM},
+      {2, "D2/E2",   "normal",       3, "X/B/D/E", MOVED_HERE},
+      {2, "D2/E2/F", "normal",       3, "X/B/D/E/F", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+move_replace(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "move_replace", opts, pool));
+
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "B"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "B/X"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+
+  SVN_ERR(sbox_wc_move(&b, "A", "X"));
+  SVN_ERR(sbox_wc_move(&b, "B", "A"));
+  SVN_ERR(sbox_wc_move(&b, "X", "B"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",  "normal",       1, ""},
+      {0, "A", "normal",       1, "A"},
+      {0, "B", "normal",       1, "B"},
+      {1, "A", "normal",       1, "B", FALSE, "B", TRUE},
+      {1, "B", "normal",       1, "A", FALSE, "A", TRUE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",    "normal",       2, ""},
+      {0, "A",   "normal",       2, "A"},
+      {0, "B",   "normal",       2, "B"},
+      {0, "B/X", "normal",       2, "B/X"},
+      {1, "A",   "normal",       1, "B", FALSE, "B", TRUE},
+      {1, "B",   "normal",       2, "A", FALSE, "A", TRUE},
+      {1, "B/X", "base-deleted", NO_COPY_FROM},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_resolve(&b, "B", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",    "normal",       2, ""},
+      {0, "A",   "normal",       2, "A"},
+      {0, "B",   "normal",       2, "B"},
+      {0, "B/X", "normal",       2, "B/X"},
+      {1, "A",   "normal",       2, "B", FALSE, "B", TRUE},
+      {1, "A/X", "normal",       2, "B/X", MOVED_HERE},
+      {1, "B",   "normal",       2, "A", FALSE, "A", TRUE},
+      {1, "B/X", "base-deleted", NO_COPY_FROM},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+
+  return SVN_NO_ERROR;
+}
 
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
@@ -5854,5 +6137,11 @@ struct svn_test_descriptor_t test_funcs[
                        "move_update_delete_mods"),
     SVN_TEST_OPTS_PASS(nested_moves2,
                        "nested_moves2"),
+    SVN_TEST_OPTS_XFAIL(move_in_delete,
+                       "move_in_delete (issue 4303)"),
+    SVN_TEST_OPTS_PASS(switch_move,
+                       "switch_move"),
+    SVN_TEST_OPTS_XFAIL(move_replace,
+                       "move_replace"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/windows-build-update/subversion/tests/svn_test_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/windows-build-update/subversion/tests/svn_test_fs.c?rev=1438999&r1=1438998&r2=1438999&view=diff
==============================================================================
--- subversion/branches/windows-build-update/subversion/tests/svn_test_fs.c (original)
+++ subversion/branches/windows-build-update/subversion/tests/svn_test_fs.c Sun Jan 27 00:01:57
2013
@@ -213,7 +213,10 @@ svn_test__create_repos(svn_repos_t **rep
   if (apr_stat(&finfo, name, APR_FINFO_TYPE, pool) == APR_SUCCESS)
     {
       if (finfo.filetype == APR_DIR)
-        SVN_ERR(svn_repos_delete(name, pool));
+        SVN_ERR_W(svn_io_remove_dir2(name, TRUE, NULL, NULL, pool),
+                  apr_psprintf(pool,
+                               "cannot create repos '%s' there is already "
+                               "a directory of that name", name));
       else
         return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
                                  "there is already a file named '%s'", name);

Propchange: subversion/branches/windows-build-update/tools/dev/fsfs-access-map.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: subversion/branches/windows-build-update/tools/dev/fsfs-reorg.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: subversion/branches/windows-build-update/tools/server-side/fsfs-stats.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/windows-build-update/tools/server-side/svnauthz.c
URL: http://svn.apache.org/viewvc/subversion/branches/windows-build-update/tools/server-side/svnauthz.c?rev=1438999&r1=1438998&r2=1438999&view=diff
==============================================================================
--- subversion/branches/windows-build-update/tools/server-side/svnauthz.c (original)
+++ subversion/branches/windows-build-update/tools/server-side/svnauthz.c Sun Jan 27 00:01:57
2013
@@ -39,7 +39,8 @@ enum svnauthz__cmdline_options_t
   svnauthz__username,
   svnauthz__path,
   svnauthz__repos,
-  svnauthz__is
+  svnauthz__is,
+  svnauthz__groups_file
 };
 
 /* Option codes and descriptions.
@@ -66,6 +67,7 @@ static const apr_getopt_option_t options
      "                             "
      "   no    no access\n")
   },
+  {"groups-file", svnauthz__groups_file, 1, ("path to the global groups file")},
   {0, 0, 0, 0}
 };
 
@@ -74,6 +76,7 @@ struct svnauthz_opt_state
   svn_boolean_t help;
   svn_boolean_t version;
   const char *authz_file;
+  const char *groups_file;
   const char *username;
   const char *fspath;
   const char *repos_name;
@@ -85,6 +88,8 @@ struct svnauthz_opt_state
 /* The name of this binary in 1.7 and earlier. */
 #define SVNAUTHZ_COMPAT_NAME "svnauthz-validate"
 
+/* Libtool command prefix */
+#define SVNAUTHZ_LT_PREFIX "lt-"
 
 
 /*** Subcommands. */
@@ -120,8 +125,9 @@ static const svn_opt_subcommand_desc2_t 
    {'t'} },
   {"accessof", subcommand_accessof, {0} /* no aliases */,
    ("Print or test the permissions set by an authz file for a specific circumstance.\n"
-    "usage: 1. svnauthz accessof [--username USER] TARGET\n"
-    "       2. svnauthz accessof [--username USER] -t TXN REPOS_PATH FILE_PATH\n\n" 
+    "usage: 1. svnauthz accessof [--username USER] [--groups-file GROUPS_FILE] TARGET\n"
+    "       2. svnauthz accessof [--username USER] [--groups-file GROUPS_FILE] \\\n"
+    "                            -t TXN REPOS_PATH FILE_PATH\n\n"
     "  1. Prints the access of USER based on TARGET.\n"
     "     TARGET can be a path to a file or an absolute file:// URL to an authz\n"
     "     file in a repository, but cannot be a repository relative URL (^/).\n\n"
@@ -129,7 +135,8 @@ static const svn_opt_subcommand_desc2_t 
     "     transaction TXN in the repository at REPOS_PATH.\n\n"
     "  If the --username argument is omitted then access of an anonymous user\n"
     "  will be printed.  If --path argument is omitted prints if any access\n"
-    "  to the repo is allowed.\n\n"
+    "  to the repo is allowed.  If --groups-file is specified, the groups from\n"
+    "  GROUPS_FILE will be used.\n\n"
     "Outputs one of the following:\n"
     "     rw    write access (which also implies read)\n"
     "      r    read access\n"
@@ -140,7 +147,8 @@ static const svn_opt_subcommand_desc2_t 
     "    2   operational error\n"
     "    3   when --is argument doesn't match\n"
     ),
-   {'t', svnauthz__username, svnauthz__path, svnauthz__repos, svnauthz__is} },
+   {'t', svnauthz__username, svnauthz__path, svnauthz__repos, svnauthz__is,
+    svnauthz__groups_file} },
   { NULL, NULL, {0}, NULL, {0} }
 };
 
@@ -176,20 +184,40 @@ subcommand_help(apr_getopt_t *os, void *
   return SVN_NO_ERROR;
 }
 
+/* Loads the fs FILENAME contents into *CONTENTS ensuring that the
+   corresponding node is a file. Using POOL for allocations. */
+static svn_error_t *
+read_file_contents(svn_stream_t **contents, const char *filename,
+                   svn_fs_root_t *root, apr_pool_t *pool)
+{
+  svn_node_kind_t node_kind;
+
+  /* Make sure the path is a file */
+  SVN_ERR(svn_fs_check_path(&node_kind, root, filename, pool));
+  if (node_kind != svn_node_file)
+    return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
+                             "Path '%s' is not a file", filename);
+
+  SVN_ERR(svn_fs_file_contents(contents, root, filename, pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Loads the authz config into *AUTHZ from the file at AUTHZ_FILE
-   in repository at REPOS_PATH from the transaction TXN_NAME.  Using
-   POOL for allocations. */
+   in repository at REPOS_PATH from the transaction TXN_NAME.  If GROUPS_FILE
+   is set, the resulting *AUTHZ will be constructed from AUTHZ_FILE with
+   global groups taken from GROUPS_FILE.  Using POOL for allocations. */
 static svn_error_t *
 get_authz_from_txn(svn_authz_t **authz, const char *repos_path,
-                   const char *authz_file, const char *txn_name,
-                   apr_pool_t *pool)
+                   const char *authz_file, const char *groups_file,
+                   const char *txn_name, apr_pool_t *pool)
 {
   svn_repos_t *repos;
   svn_fs_t *fs;
   svn_fs_txn_t *txn;
   svn_fs_root_t *root;
-  svn_node_kind_t node_kind;
-  svn_stream_t *contents;
+  svn_stream_t *authz_contents;
+  svn_stream_t *groups_contents;
   svn_error_t *err;
 
   /* Open up the repository and find the transaction root */
@@ -198,14 +226,16 @@ get_authz_from_txn(svn_authz_t **authz, 
   SVN_ERR(svn_fs_open_txn(&txn, fs, txn_name, pool));
   SVN_ERR(svn_fs_txn_root(&root, txn, pool));
 
-  /* Make sure the path is a file */
-  SVN_ERR(svn_fs_check_path(&node_kind, root, authz_file, pool));
-  if (node_kind != svn_node_file)
-    return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
-                             "Path '%s' is not a file", authz_file);
+  /* Get the authz file contents. */
+  SVN_ERR(read_file_contents(&authz_contents, authz_file, root, pool));
 
-  SVN_ERR(svn_fs_file_contents(&contents, root, authz_file, pool));
-  err = svn_repos_authz_parse(authz, contents, pool);
+  /* Get the groups file contents if needed. */
+  if (groups_file)
+    SVN_ERR(read_file_contents(&groups_contents, groups_file, root, pool));
+  else
+    groups_contents = NULL;
+
+  err = svn_repos_authz_parse(authz, authz_contents, groups_contents, pool);
 
   /* Add the filename to the error stack since the parser doesn't have it. */
   if (err != SVN_NO_ERROR)
@@ -216,8 +246,10 @@ get_authz_from_txn(svn_authz_t **authz, 
 }
 
 /* Loads the authz config into *AUTHZ from OPT_STATE->AUTHZ_FILE.  If
-   OPT_STATE->TXN is set then OPT_STATE->AUTHZ_FILE is treated as a fspath
-   in repository at OPT_STATE->REPOS_PATH. */
+   OPT_STATE->GROUPS_FILE is set, loads the global groups from it.
+   If OPT_STATE->TXN is set then OPT_STATE->AUTHZ_FILE and
+   OPT_STATE->GROUPS_FILE are treated as fspaths in repository at
+   OPT_STATE->REPOS_PATH. */
 static svn_error_t *
 get_authz(svn_authz_t **authz, struct svnauthz_opt_state *opt_state,
           apr_pool_t *pool)
@@ -225,10 +257,14 @@ get_authz(svn_authz_t **authz, struct sv
   /* Read the access file and validate it. */
   if (opt_state->txn)
     return get_authz_from_txn(authz, opt_state->repos_path,
-                              opt_state->authz_file, opt_state->txn, pool);
+                              opt_state->authz_file,
+                              opt_state->groups_file,
+                              opt_state->txn, pool);
 
   /* Else */
-  return svn_repos_authz_read2(authz, opt_state->authz_file, TRUE, NULL, pool);
+  return svn_repos_authz_read2(authz, opt_state->authz_file,
+                               opt_state->groups_file,
+                               TRUE, NULL, pool);
 }
 
 static svn_error_t *
@@ -362,12 +398,65 @@ use_compat_mode(const char *cmd, apr_poo
   cmd = svn_dirent_internal_style(cmd, pool);
   cmd = svn_dirent_basename(cmd, NULL);
 
+  /* Skip over the Libtool command prefix if it exists on the command. */
+  if (0 == strncmp(SVNAUTHZ_LT_PREFIX, cmd, sizeof(SVNAUTHZ_LT_PREFIX)-1))
+    cmd += sizeof(SVNAUTHZ_LT_PREFIX) - 1;
+
   /* Deliberately look only for the start of the name to deal with
      the executable extension on some platforms. */
   return 0 == strncmp(SVNAUTHZ_COMPAT_NAME, cmd,
                       sizeof(SVNAUTHZ_COMPAT_NAME)-1);
 }
 
+/* Canonicalize ACCESS_FILE into *CANONICALIZED_ACCESS_FILE based on the type
+   of argument.  Error out on unsupported path types.  If WITHIN_TXN is set,
+   ACCESS_FILE has to be a fspath in the repo.  Use POOL for allocations. */
+static svn_error_t *
+canonicalize_access_file(const char **canonicalized_access_file,
+                         const char *access_file,
+                         svn_boolean_t within_txn,
+                         apr_pool_t *pool)
+{
+  if (svn_path_is_repos_relative_url(access_file))
+    {
+      /* Can't accept repos relative urls since we don't have the path to
+       * the repository. */
+      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                               ("'%s' is a repository relative URL when it "
+                               "should be a local path or file:// URL"),
+                               access_file);
+    }
+  else if (svn_path_is_url(access_file))
+    {
+      if (within_txn)
+        {
+          /* Don't allow urls with transaction argument. */
+          return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                   ("'%s' is a URL when it should be a "
+                                   "repository-relative path"),
+                                   access_file);
+        }
+
+      *canonicalized_access_file = svn_uri_canonicalize(access_file, pool);
+    }
+  else if (within_txn)
+    {
+      /* Transaction flag means this has to be a fspath to the access file
+       * in the repo. */
+      *canonicalized_access_file =
+          svn_fspath__canonicalize(access_file, pool);
+    }
+  else
+    {
+      /* If it isn't a URL and there's no transaction flag then it's a
+       * dirent to the access file on local disk. */
+      *canonicalized_access_file =
+          svn_dirent_internal_style(access_file, pool);
+    }
+
+  return SVN_NO_ERROR;
+}
+
 static int
 sub_main(int argc, const char *argv[], apr_pool_t *pool)
 {
@@ -386,7 +475,7 @@ sub_main(int argc, const char *argv[], a
 
   /* Initialize opt_state */
   opt_state.username = opt_state.fspath = opt_state.repos_name = NULL;
-  opt_state.txn = opt_state.repos_path = NULL;
+  opt_state.txn = opt_state.repos_path = opt_state.groups_file = NULL;
 
   /* Parse options. */
   SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
@@ -437,6 +526,11 @@ sub_main(int argc, const char *argv[], a
             case svnauthz__is:
               SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.is, arg, pool));
               break;
+            case svnauthz__groups_file:
+              SVN_INT_ERR(
+                  svn_utf_cstring_to_utf8(&opt_state.groups_file,
+                                          arg, pool));
+              break;
             default:
                 {
                   SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
@@ -537,47 +631,18 @@ sub_main(int argc, const char *argv[], a
       SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.authz_file, os->argv[os->ind],
                                           pool));
 
-      /* Canonicalize opt_state.authz_file appropriately */
-      if (svn_path_is_repos_relative_url(opt_state.authz_file))
-        {
-          /* Can't accept repos relative urls since we don't have the path to
-           * the repository. */
-          err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                  ("'%s' is a repository relative URL when it "
-                                   "should be a local path or file:// URL"),
-                                  opt_state.authz_file);
-          return EXIT_ERROR(err, EXIT_FAILURE);
-        }
-      else if (svn_path_is_url(opt_state.authz_file))
-        {
-          if (opt_state.txn) 
-            {
-              /* don't allow urls with transaction argument */
-              err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                      ("'%s' is a URL when it should be a "
-                                       "repository-relative path"),
-                                      opt_state.authz_file);
-              return EXIT_ERROR(err, EXIT_FAILURE);
-            }
-
-          opt_state.authz_file = svn_uri_canonicalize(opt_state.authz_file,
-                                                      pool);
+      /* Canonicalize opt_state.authz_file appropriately. */
+      SVN_INT_ERR(canonicalize_access_file(&opt_state.authz_file,
+                                           opt_state.authz_file,
+                                           opt_state.txn != NULL, pool));
+
+      /* Same for opt_state.groups_file if it is present. */
+      if (opt_state.groups_file)
+        {
+          SVN_INT_ERR(canonicalize_access_file(&opt_state.groups_file,
+                                               opt_state.groups_file,
+                                               opt_state.txn != NULL, pool));
         }
-      else if (opt_state.txn)
-        {
-          /* Transaction flag means this has to be a fspath to the authz_file
-           * in the repo. */
-          opt_state.authz_file =
-              svn_fspath__canonicalize(opt_state.authz_file, pool);
-        }
-      else
-        {
-          /* If it isn't a URL and there's no transaction flag then it's a
-           * dirent to a authz_file on local disk.  */
-          opt_state.authz_file = svn_dirent_internal_style(opt_state.authz_file,
-                                                           pool);
-        }
-
     }
 
   /* Check that the subcommand wasn't passed any inappropriate options. */

Modified: subversion/branches/windows-build-update/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/windows-build-update/win-tests.py?rev=1438999&r1=1438998&r2=1438999&view=diff
==============================================================================
--- subversion/branches/windows-build-update/win-tests.py (original)
+++ subversion/branches/windows-build-update/win-tests.py Sun Jan 27 00:01:57 2013
@@ -307,8 +307,7 @@ def copy_changed_file(src, tgt):
 def copy_execs(baton, dirname, names):
   copied_execs = baton
   for name in names:
-    ext = os.path.splitext(name)[1]
-    if ext != ".exe":
+    if not name.endswith('.exe'):
       continue
     src = os.path.join(dirname, name)
     tgt = os.path.join(abs_builddir, dirname, name)
@@ -667,7 +666,9 @@ if create_dirs:
     os.chdir(abs_objdir)
     baton = copied_execs
     for dirpath, dirs, files in os.walk('subversion'):
-      copy_execs(baton, dirpath, dirs + files)
+      copy_execs(baton, dirpath, files)
+    for dirpath, dirs, files in os.walk('tools/server-side'):
+      copy_execs(baton, dirpath, files)
   except:
     os.chdir(old_cwd)
     raise



Mime
View raw message