You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/01/03 15:00:44 UTC

svn commit: r1649205 [28/30] - in /subversion/branches/authzperf: ./ build/ build/ac-macros/ notes/ subversion/bindings/ctypes-python/ subversion/bindings/cxxhl/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/bindings/swig/ s...

Modified: subversion/branches/authzperf/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnmucc/svnmucc.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/authzperf/subversion/svnmucc/svnmucc.c Sat Jan  3 14:00:41 2015
@@ -251,14 +251,21 @@ sanitize_url(const char *url,
   return svn_uri_canonicalize(url, pool);
 }
 
+static void
+usage(apr_pool_t *pool)
+{
+  svn_error_clear(svn_cmdline_fprintf
+                  (stderr, pool, _("Type 'svnmucc --help' for usage.\n")));
+}
+
 /* Print a usage message on STREAM. */
 static void
-usage(FILE *stream, apr_pool_t *pool)
+help(FILE *stream, apr_pool_t *pool)
 {
   svn_error_clear(svn_cmdline_fputs(
     _("usage: svnmucc ACTION...\n"
       "Subversion multiple URL command client.\n"
-      "Type 'svnmucc --version' to see the program version.\n"
+      "Type 'svnmucc --version' to see the program version and RA modules.\n"
       "\n"
       "  Perform one or more Subversion repository URL-based ACTIONs, committing\n"
       "  the result as a (single) new revision.\n"
@@ -288,9 +295,18 @@ usage(FILE *stream, apr_pool_t *pool)
       "                           prompt only if standard input is a terminal)\n"
       "  --force-interactive    : do interactive prompting even if standard\n"
       "                           input is not a terminal\n"
-      "  --trust-server-cert    : accept SSL server certificates from unknown\n"
-      "                           certificate authorities without prompting (but\n"
-      "                           only with '--non-interactive')\n"
+      "  --trust-server-cert    : deprecated; same as --trust-unknown-ca\n"
+      "  --trust-unknown-ca     : with --non-interactive, accept SSL server\n"
+      "                           certificates from unknown certificate authorities\n"
+      "  --trust-cn-mismatch    : with --non-interactive, accept SSL server\n"
+      "                           certificates even if the server hostname does not\n"
+      "                           match the certificate's common name attribute\n"
+      "  --trust-expired        : with --non-interactive, accept expired SSL server\n"
+      "                           certificates\n"
+      "  --trust-not-yet-valid  : with --non-interactive, accept SSL server\n"
+      "                           certificates from the future\n"
+      "  --trust-other-failure  : with --non-interactive, accept SSL server\n"
+      "                           certificates with failures other than the above\n"
       "  -X [--extra-args] ARG  : append arguments from file ARG (one per line;\n"
       "                           use \"-\" to read from standard input)\n"
       "  --config-dir ARG       : use ARG to override the config directory\n"
@@ -308,7 +324,7 @@ insufficient(void)
 }
 
 static svn_error_t *
-display_version(apr_getopt_t *os, apr_pool_t *pool)
+display_version(apr_pool_t *pool)
 {
   const char *ra_desc_start
     = "The following repository access (RA) modules are available:\n\n";
@@ -317,7 +333,7 @@ display_version(apr_getopt_t *os, apr_po
   version_footer = svn_stringbuf_create(ra_desc_start, pool);
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
-  SVN_ERR(svn_opt_print_help4(os, "svnmucc", TRUE, FALSE, FALSE,
+  SVN_ERR(svn_opt_print_help4(NULL, "svnmucc", TRUE, FALSE, FALSE,
                               version_footer->data,
                               NULL, NULL, NULL, NULL, NULL, pool));
 
@@ -455,7 +471,12 @@ sub_main(int *exit_code, int argc, const
     with_revprop_opt,
     non_interactive_opt,
     force_interactive_opt,
-    trust_server_cert_opt
+    trust_server_cert_opt,
+    trust_server_cert_unknown_ca_opt,
+    trust_server_cert_cn_mismatch_opt,
+    trust_server_cert_expired_opt,
+    trust_server_cert_not_yet_valid_opt,
+    trust_server_cert_other_failure_opt,
   };
   static const apr_getopt_option_t options[] = {
     {"message", 'm', 1, ""},
@@ -471,6 +492,11 @@ sub_main(int *exit_code, int argc, const
     {"non-interactive", non_interactive_opt, 0, ""},
     {"force-interactive", force_interactive_opt, 0, ""},
     {"trust-server-cert", trust_server_cert_opt, 0, ""},
+    {"trust-unknown-ca", trust_server_cert_unknown_ca_opt, 0, ""},
+    {"trust-cn-mismatch", trust_server_cert_cn_mismatch_opt, 0, ""},
+    {"trust-expired", trust_server_cert_expired_opt, 0, ""},
+    {"trust-not-yet-valid", trust_server_cert_not_yet_valid_opt, 0, ""},
+    {"trust-other-failure", trust_server_cert_other_failure_opt, 0, ""},
     {"config-dir", config_dir_opt, 1, ""},
     {"config-option",  config_inline_opt, 1, ""},
     {"no-auth-cache",  no_auth_cache_opt, 0, ""},
@@ -485,8 +511,14 @@ sub_main(int *exit_code, int argc, const
   apr_array_header_t *config_options;
   svn_boolean_t non_interactive = FALSE;
   svn_boolean_t force_interactive = FALSE;
-  svn_boolean_t trust_server_cert = FALSE;
+  svn_boolean_t trust_unknown_ca = FALSE;
+  svn_boolean_t trust_cn_mismatch = FALSE;
+  svn_boolean_t trust_expired = FALSE;
+  svn_boolean_t trust_not_yet_valid = FALSE;
+  svn_boolean_t trust_other_failure = FALSE;
   svn_boolean_t no_auth_cache = FALSE;
+  svn_boolean_t show_version = FALSE;
+  svn_boolean_t show_help = FALSE;
   svn_revnum_t base_revision = SVN_INVALID_REVNUM;
   apr_array_header_t *action_args;
   apr_hash_t *revprops = apr_hash_make(pool);
@@ -514,7 +546,11 @@ sub_main(int *exit_code, int argc, const
       if (APR_STATUS_IS_EOF(status))
         break;
       if (status != APR_SUCCESS)
-        return svn_error_wrap_apr(status, "getopt failure");
+        {
+          usage(pool);
+          *exit_code = EXIT_FAILURE;
+          return SVN_NO_ERROR;
+        }
       switch(opt)
         {
         case 'm':
@@ -567,8 +603,21 @@ sub_main(int *exit_code, int argc, const
         case force_interactive_opt:
           force_interactive = TRUE;
           break;
-        case trust_server_cert_opt:
-          trust_server_cert = TRUE;
+        case trust_server_cert_opt: /* backward compat */
+        case trust_server_cert_unknown_ca_opt:
+          trust_unknown_ca = TRUE;
+          break;
+        case trust_server_cert_cn_mismatch_opt:
+          trust_cn_mismatch = TRUE;
+          break;
+        case trust_server_cert_expired_opt:
+          trust_expired = TRUE;
+          break;
+        case trust_server_cert_not_yet_valid_opt:
+          trust_not_yet_valid = TRUE;
+          break;
+        case trust_server_cert_other_failure_opt:
+          trust_other_failure = TRUE;
           break;
         case config_dir_opt:
           SVN_ERR(svn_utf_cstring_to_utf8(&config_dir, arg, pool));
@@ -582,15 +631,27 @@ sub_main(int *exit_code, int argc, const
           no_auth_cache = TRUE;
           break;
         case version_opt:
-          SVN_ERR(display_version(opts, pool));
-          return SVN_NO_ERROR;
+          show_version = TRUE;
+          break;
         case 'h':
         case '?':
-          usage(stdout, pool);
-          return SVN_NO_ERROR;
+          show_help = TRUE;
+          break;
         }
     }
 
+  if (show_help)
+    {
+      help(stdout, pool);
+      return SVN_NO_ERROR;
+    }
+
+  if (show_version)
+    {
+      SVN_ERR(display_version(pool));
+      return SVN_NO_ERROR;
+    }
+
   if (non_interactive && force_interactive)
     {
       return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -601,11 +662,28 @@ sub_main(int *exit_code, int argc, const
     non_interactive = !svn_cmdline__be_interactive(non_interactive,
                                                    force_interactive);
 
-  if (trust_server_cert && !non_interactive)
+  if (!non_interactive)
     {
+      if (trust_unknown_ca)
       return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                              _("--trust-server-cert requires "
+                              _("--trust-unknown-ca requires "
                                 "--non-interactive"));
+      if (trust_cn_mismatch)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-cn-mismatch requires "
+                                  "--non-interactive"));
+      if (trust_expired)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-expired requires "
+                                  "--non-interactive"));
+      if (trust_not_yet_valid)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-not-yet-valid requires "
+                                  "--non-interactive"));
+      if (trust_other_failure)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-other-failure requires "
+                                  "--non-interactive"));
     }
 
   /* Copy the rest of our command-line arguments to an array,
@@ -663,17 +741,22 @@ sub_main(int *exit_code, int argc, const
   SVN_ERR(svn_client_create_context2(&ctx, cfg_hash, pool));
 
   cfg_config = svn_hash_gets(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG);
-  SVN_ERR(svn_cmdline_create_auth_baton(&ctx->auth_baton,
-                                        non_interactive,
-                                        username,
-                                        password,
-                                        config_dir,
-                                        no_auth_cache,
-                                        trust_server_cert,
-                                        cfg_config,
-                                        ctx->cancel_func,
-                                        ctx->cancel_baton,
-                                        pool));
+  SVN_ERR(svn_cmdline_create_auth_baton2(
+            &ctx->auth_baton,
+            non_interactive,
+            username,
+            password,
+            config_dir,
+            no_auth_cache,
+            trust_unknown_ca,
+            trust_cn_mismatch,
+            trust_expired,
+            trust_not_yet_valid,
+            trust_other_failure,
+            cfg_config,
+            ctx->cancel_func,
+            ctx->cancel_baton,
+            pool));
 
   lmb.non_interactive = non_interactive;
   lmb.ctx = ctx;
@@ -711,7 +794,7 @@ sub_main(int *exit_code, int argc, const
       else if (! strcmp(action_string, "?") || ! strcmp(action_string, "h")
                || ! strcmp(action_string, "help"))
         {
-          usage(stdout, pool);
+          help(stdout, pool);
           return SVN_NO_ERROR;
         }
       else
@@ -872,7 +955,7 @@ sub_main(int *exit_code, int argc, const
   if (! actions->nelts)
     {
       *exit_code = EXIT_FAILURE;
-      usage(stderr, pool);
+      help(stderr, pool);
       return SVN_NO_ERROR;
     }
 

Modified: subversion/branches/authzperf/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnrdump/load_editor.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/authzperf/subversion/svnrdump/load_editor.c Sat Jan  3 14:00:41 2015
@@ -320,16 +320,7 @@ renumber_mergeinfo_revs(svn_string_t **f
                                    subpool, subpool));
     }
 
-  SVN_ERR(svn_mergeinfo_sort(final_mergeinfo, subpool));
-
-  /* Mergeinfo revision sources for r0 and r1 are invalid; you can't merge r0
-     or r1.  However, svndumpfilter can be abused to produce r1 merge source
-     revs.  So if we encounter any, then strip them out, no need to put them
-     into the load target. */
-  SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(&final_mergeinfo,
-                                                    final_mergeinfo,
-                                                    1, 0, FALSE,
-                                                    subpool, subpool));
+  SVN_ERR(svn_mergeinfo__canonicalize_ranges(final_mergeinfo, subpool));
 
   SVN_ERR(svn_mergeinfo_to_string(final_val, final_mergeinfo, pool));
   svn_pool_destroy(subpool);
@@ -887,6 +878,56 @@ set_revision_property(void *baton,
   return SVN_NO_ERROR;
 }
 
+/* Adjust mergeinfo:
+ *   - normalize line endings (if all CRLF, change to LF; but error if mixed);
+ *   - adjust revision numbers (see renumber_mergeinfo_revs());
+ *   - adjust paths (see prefix_mergeinfo_paths()).
+ */
+static svn_error_t *
+adjust_mergeinfo_property(struct revision_baton *rb,
+                          svn_string_t **new_value_p,
+                          const svn_string_t *old_value,
+                          apr_pool_t *result_pool)
+{
+  struct parse_baton *pb = rb->pb;
+  svn_string_t prop_val = *old_value;
+
+  /* Tolerate mergeinfo with "\r\n" line endings because some
+     dumpstream sources might contain as much.  If so normalize
+     the line endings to '\n' and notify that we have made this
+     correction. */
+  if (strstr(prop_val.data, "\r"))
+    {
+      const char *prop_eol_normalized;
+
+      SVN_ERR(svn_subst_translate_cstring2(prop_val.data,
+                                           &prop_eol_normalized,
+                                           "\n",  /* translate to LF */
+                                           FALSE, /* no repair */
+                                           NULL,  /* no keywords */
+                                           FALSE, /* no expansion */
+                                           result_pool));
+      prop_val.data = prop_eol_normalized;
+      prop_val.len = strlen(prop_eol_normalized);
+
+      /* ### TODO: notify? */
+    }
+
+  /* Renumber mergeinfo as appropriate. */
+  SVN_ERR(renumber_mergeinfo_revs(new_value_p, &prop_val, rb,
+                                  result_pool));
+
+  if (pb->parent_dir)
+    {
+      /* Prefix the merge source paths with PB->parent_dir. */
+      /* ASSUMPTION: All source paths are included in the dump stream. */
+      SVN_ERR(prefix_mergeinfo_paths(new_value_p, *new_value_p,
+                                     pb->parent_dir, result_pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 set_node_property(void *baton,
                   const char *name,
@@ -898,46 +939,10 @@ set_node_property(void *baton,
 
   if (value && strcmp(name, SVN_PROP_MERGEINFO) == 0)
     {
-      svn_string_t *renumbered_mergeinfo;
-      svn_string_t prop_val;
-
-      /* Tolerate mergeinfo with "\r\n" line endings because some
-         dumpstream sources might contain as much.  If so normalize
-         the line endings to '\n' and make a notification to
-         PARSE_BATON->FEEDBACK_STREAM that we have made this
-         correction. */
-      if (strstr(value->data, "\r"))
-        {
-          const char *prop_eol_normalized;
+      svn_string_t *new_value;
 
-          SVN_ERR(svn_subst_translate_cstring2(value->data,
-                                               &prop_eol_normalized,
-                                               "\n",  /* translate to LF */
-                                               FALSE, /* no repair */
-                                               NULL,  /* no keywords */
-                                               FALSE, /* no expansion */
-                                               pool));
-          prop_val.data = prop_eol_normalized;
-          prop_val.len = strlen(prop_eol_normalized);
-          value = &prop_val;
-
-          /* ### TODO: notify? */
-        }
-
-      /* Renumber mergeinfo as appropriate. */
-      SVN_ERR(renumber_mergeinfo_revs(&renumbered_mergeinfo, value,
-                                      nb->rb, pool));
-      value = renumbered_mergeinfo;
-
-      if (nb->rb->pb->parent_dir)
-        {
-          /* Prefix the merge source paths with PB->parent_dir. */
-          /* ASSUMPTION: All source paths are included in the dump stream. */
-          svn_string_t *mergeinfo_val;
-          SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value,
-                                         nb->rb->pb->parent_dir, pool));
-          value = mergeinfo_val;
-        }
+      SVN_ERR(adjust_mergeinfo_property(nb->rb, &new_value, value, pool));
+      value = new_value;
     }
 
   SVN_ERR(svn_rdump__normalize_prop(name, &value, pool));

Modified: subversion/branches/authzperf/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnrdump/svnrdump.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/authzperf/subversion/svnrdump/svnrdump.c Sat Jan  3 14:00:41 2015
@@ -84,6 +84,11 @@ enum svn_svnrdump__longopt_t
     opt_force_interactive,
     opt_incremental,
     opt_trust_server_cert,
+    opt_trust_server_cert_unknown_ca,
+    opt_trust_server_cert_cn_mismatch,
+    opt_trust_server_cert_expired,
+    opt_trust_server_cert_not_yet_valid,
+    opt_trust_server_cert_other_failure,
     opt_version
   };
 
@@ -93,6 +98,11 @@ enum svn_svnrdump__longopt_t
                                    opt_auth_password, \
                                    opt_auth_nocache, \
                                    opt_trust_server_cert, \
+                                   opt_trust_server_cert_unknown_ca, \
+                                   opt_trust_server_cert_cn_mismatch, \
+                                   opt_trust_server_cert_expired, \
+                                   opt_trust_server_cert_not_yet_valid, \
+                                   opt_trust_server_cert_other_failure, \
                                    opt_non_interactive, \
                                    opt_force_interactive
 
@@ -154,11 +164,29 @@ static const apr_getopt_option_t svnrdum
                          "                             "
                          "    servers:global:http-library=serf")},
     {"trust-server-cert", opt_trust_server_cert, 0,
-                      N_("accept SSL server certificates from unknown\n"
+                      N_("deprecated; same as --trust-unknown-ca")},
+    {"trust-unknown-ca", opt_trust_server_cert_unknown_ca, 0,
+                      N_("with --non-interactive, accept SSL server\n"
                          "                             "
-                         "certificate authorities without prompting (but only\n"
+                         "certificates from unknown certificate authorities")},
+    {"trust-cn-mismatch", opt_trust_server_cert_cn_mismatch, 0,
+                      N_("with --non-interactive, accept SSL server\n"
                          "                             "
-                         "with '--non-interactive')") },
+                         "certificates even if the server hostname does not\n"
+                         "                             "
+                         "match the certificate's common name attribute")},
+    {"trust-expired", opt_trust_server_cert_expired, 0,
+                      N_("with --non-interactive, accept expired SSL server\n"
+                         "                             "
+                         "certificates")},
+    {"trust-not-yet-valid", opt_trust_server_cert_not_yet_valid, 0,
+                      N_("with --non-interactive, accept SSL server\n"
+                         "                             "
+                         "certificates from the future")},
+    {"trust-other-failure", opt_trust_server_cert_other_failure, 0,
+                      N_("with --non-interactive, accept SSL server\n"
+                         "                             "
+                         "certificates with failures other than the above")},
     {0, 0, 0, 0}
   };
 
@@ -352,7 +380,11 @@ init_client_context(svn_client_ctx_t **c
                     const char *config_dir,
                     const char *repos_url,
                     svn_boolean_t no_auth_cache,
-                    svn_boolean_t trust_server_cert,
+                    svn_boolean_t trust_unknown_ca,
+                    svn_boolean_t trust_cn_mismatch,
+                    svn_boolean_t trust_expired,
+                    svn_boolean_t trust_not_yet_valid,
+                    svn_boolean_t trust_other_failure,
                     apr_array_header_t *config_options,
                     apr_pool_t *pool)
 {
@@ -416,11 +448,14 @@ init_client_context(svn_client_ctx_t **c
   ctx->cancel_func = check_cancel;
 
   /* Default authentication providers for non-interactive use */
-  SVN_ERR(svn_cmdline_create_auth_baton(&(ctx->auth_baton), non_interactive,
-                                        username, password, config_dir,
-                                        no_auth_cache, trust_server_cert,
-                                        cfg_config, ctx->cancel_func,
-                                        ctx->cancel_baton, pool));
+  SVN_ERR(svn_cmdline_create_auth_baton2(&(ctx->auth_baton), non_interactive,
+                                         username, password, config_dir,
+                                         no_auth_cache, trust_unknown_ca,
+                                         trust_cn_mismatch, trust_expired,
+                                         trust_not_yet_valid,
+                                         trust_other_failure,
+                                         cfg_config, ctx->cancel_func,
+                                         ctx->cancel_baton, pool));
   *ctx_p = ctx;
   return SVN_NO_ERROR;
 }
@@ -837,7 +872,11 @@ sub_main(int *exit_code, int argc, const
   const char *username = NULL;
   const char *password = NULL;
   svn_boolean_t no_auth_cache = FALSE;
-  svn_boolean_t trust_server_cert = FALSE;
+  svn_boolean_t trust_unknown_ca = FALSE;
+  svn_boolean_t trust_cn_mismatch = FALSE;
+  svn_boolean_t trust_expired = FALSE;
+  svn_boolean_t trust_not_yet_valid = FALSE;
+  svn_boolean_t trust_other_failure = FALSE;
   svn_boolean_t non_interactive = FALSE;
   svn_boolean_t force_interactive = FALSE;
   apr_array_header_t *config_options = NULL;
@@ -959,8 +998,21 @@ sub_main(int *exit_code, int argc, const
           SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
           svn_hash_sets(opt_baton->skip_revprops, opt_arg, opt_arg);
           break;
-        case opt_trust_server_cert:
-          trust_server_cert = TRUE;
+        case opt_trust_server_cert: /* backward compat */
+        case opt_trust_server_cert_unknown_ca:
+          trust_unknown_ca = TRUE;
+          break;
+        case opt_trust_server_cert_cn_mismatch:
+          trust_cn_mismatch = TRUE;
+          break;
+        case opt_trust_server_cert_expired:
+          trust_expired = TRUE;
+          break;
+        case opt_trust_server_cert_not_yet_valid:
+          trust_not_yet_valid = TRUE;
+          break;
+        case opt_trust_server_cert_other_failure:
+          trust_other_failure = TRUE;
           break;
         case opt_config_option:
           if (!config_options)
@@ -1076,12 +1128,29 @@ sub_main(int *exit_code, int argc, const
       return SVN_NO_ERROR;
     }
 
-  /* --trust-server-cert can only be used with --non-interactive */
-  if (trust_server_cert && !non_interactive)
+  /* --trust-* can only be used with --non-interactive */
+  if (!non_interactive)
     {
+      if (trust_unknown_ca)
       return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                              _("--trust-server-cert requires "
+                              _("--trust-unknown-ca requires "
                                 "--non-interactive"));
+      if (trust_cn_mismatch)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-cn-mismatch requires "
+                                  "--non-interactive"));
+      if (trust_expired)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-expired requires "
+                                  "--non-interactive"));
+      if (trust_not_yet_valid)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-not-yet-valid requires "
+                                  "--non-interactive"));
+      if (trust_other_failure)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-other-failure requires "
+                                  "--non-interactive"));
     }
 
   /* Expect one more non-option argument:  the repository URL. */
@@ -1128,7 +1197,11 @@ sub_main(int *exit_code, int argc, const
                               config_dir,
                               opt_baton->url,
                               no_auth_cache,
-                              trust_server_cert,
+                              trust_unknown_ca,
+                              trust_cn_mismatch,
+                              trust_expired,
+                              trust_not_yet_valid,
+                              trust_other_failure,
                               config_options,
                               pool));
 

Modified: subversion/branches/authzperf/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnserve/svnserve.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/authzperf/subversion/svnserve/svnserve.c Sat Jan  3 14:00:41 2015
@@ -271,6 +271,8 @@ static const apr_getopt_option_t svnserv
         "                             "
         "Default is 16.\n"
         "                             "
+        "0 switches to dynamically sized caches.\n"
+        "                             "
         "[used for FSFS and FSX repositories only]")},
     {"cache-txdeltas", SVNSERVE_OPT_CACHE_TXDELTAS, 1,
      N_("enable or disable caching of deltas between older\n"

Modified: subversion/branches/authzperf/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnsync/svnsync.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnsync/svnsync.c (original)
+++ subversion/branches/authzperf/subversion/svnsync/svnsync.c Sat Jan  3 14:00:41 2015
@@ -68,6 +68,11 @@ enum svnsync__opt {
   svnsync_opt_disable_locking,
   svnsync_opt_version,
   svnsync_opt_trust_server_cert,
+  svnsync_opt_trust_server_cert_unknown_ca,
+  svnsync_opt_trust_server_cert_cn_mismatch,
+  svnsync_opt_trust_server_cert_expired,
+  svnsync_opt_trust_server_cert_not_yet_valid,
+  svnsync_opt_trust_server_cert_other_failure,
   svnsync_opt_allow_non_empty,
   svnsync_opt_steal_lock
 };
@@ -78,6 +83,11 @@ enum svnsync__opt {
                              svnsync_opt_auth_username, \
                              svnsync_opt_auth_password, \
                              svnsync_opt_trust_server_cert, \
+                             svnsync_opt_trust_server_cert_unknown_ca, \
+                             svnsync_opt_trust_server_cert_cn_mismatch, \
+                             svnsync_opt_trust_server_cert_expired, \
+                             svnsync_opt_trust_server_cert_not_yet_valid, \
+                             svnsync_opt_trust_server_cert_other_failure, \
                              svnsync_opt_source_username, \
                              svnsync_opt_source_password, \
                              svnsync_opt_sync_username, \
@@ -194,11 +204,29 @@ static const apr_getopt_option_t svnsync
                           "                             "
                           "see --source-password and --sync-password)") },
     {"trust-server-cert", svnsync_opt_trust_server_cert, 0,
-                       N_("accept SSL server certificates from unknown\n"
-                          "                             "
-                          "certificate authorities without prompting (but only\n"
-                          "                             "
-                          "with '--non-interactive')") },
+                      N_("deprecated; same as --trust-unknown-ca")},
+    {"trust-unknown-ca", svnsync_opt_trust_server_cert_unknown_ca, 0,
+                      N_("with --non-interactive, accept SSL server\n"
+                         "                             "
+                         "certificates from unknown certificate authorities")},
+    {"trust-cn-mismatch", svnsync_opt_trust_server_cert_cn_mismatch, 0,
+                      N_("with --non-interactive, accept SSL server\n"
+                         "                             "
+                         "certificates even if the server hostname does not\n"
+                         "                             "
+                         "match the certificate's common name attribute")},
+    {"trust-expired", svnsync_opt_trust_server_cert_expired, 0,
+                      N_("with --non-interactive, accept expired SSL server\n"
+                         "                             "
+                         "certificates")},
+    {"trust-not-yet-valid", svnsync_opt_trust_server_cert_not_yet_valid, 0,
+                      N_("with --non-interactive, accept SSL server\n"
+                         "                             "
+                         "certificates from the future")},
+    {"trust-other-failure", svnsync_opt_trust_server_cert_other_failure, 0,
+                      N_("with --non-interactive, accept SSL server\n"
+                         "                             "
+                         "certificates with failures other than the above")},
     {"source-username", svnsync_opt_source_username, 1,
                        N_("connect to source repository with username ARG") },
     {"source-password", svnsync_opt_source_password, 1,
@@ -252,7 +280,11 @@ static const apr_getopt_option_t svnsync
 
 typedef struct opt_baton_t {
   svn_boolean_t non_interactive;
-  svn_boolean_t trust_server_cert;
+  svn_boolean_t trust_server_cert_unknown_ca;
+  svn_boolean_t trust_server_cert_cn_mismatch;
+  svn_boolean_t trust_server_cert_expired;
+  svn_boolean_t trust_server_cert_not_yet_valid;
+  svn_boolean_t trust_server_cert_other_failure;
   svn_boolean_t no_auth_cache;
   svn_auth_baton_t *source_auth_baton;
   svn_auth_baton_t *sync_auth_baton;
@@ -732,8 +764,10 @@ open_target_session(svn_ra_session_t **t
 /*** `svnsync init' ***/
 
 /* Initialize the repository associated with RA session TO_SESSION,
- * using information found in BATON, while the repository is
- * locked.  Implements `with_locked_func_t' interface.
+ * using information found in BATON.
+ *
+ * Implements `with_locked_func_t' interface.  The caller has
+ * acquired a lock on the repository if locking is needed.
  */
 static svn_error_t *
 do_initialize(svn_ra_session_t *to_session,
@@ -1371,8 +1405,10 @@ replay_rev_finished(svn_revnum_t revisio
 }
 
 /* Synchronize the repository associated with RA session TO_SESSION,
- * using information found in BATON, while the repository is
- * locked.  Implements `with_locked_func_t' interface.
+ * using information found in BATON.
+ *
+ * Implements `with_locked_func_t' interface.  The caller has
+ * acquired a lock on the repository if locking is needed.
  */
 static svn_error_t *
 do_synchronize(svn_ra_session_t *to_session,
@@ -1565,8 +1601,10 @@ synchronize_cmd(apr_getopt_t *os, void *
 /*** `svnsync copy-revprops' ***/
 
 /* Copy revision properties to the repository associated with RA
- * session TO_SESSION, using information found in BATON, while the
- * repository is locked.  Implements `with_locked_func_t' interface.
+ * session TO_SESSION, using information found in BATON.
+ *
+ * Implements `with_locked_func_t' interface.  The caller has
+ * acquired a lock on the repository if locking is needed.
  */
 static svn_error_t *
 do_copy_revprops(svn_ra_session_t *to_session,
@@ -1969,8 +2007,25 @@ sub_main(int *exit_code, int argc, const
             force_interactive = TRUE;
             break;
 
-          case svnsync_opt_trust_server_cert:
-            opt_baton.trust_server_cert = TRUE;
+          case svnsync_opt_trust_server_cert: /* backwards compat */
+          case svnsync_opt_trust_server_cert_unknown_ca:
+            opt_baton.trust_server_cert_unknown_ca = TRUE;
+            break;
+
+          case svnsync_opt_trust_server_cert_cn_mismatch:
+            opt_baton.trust_server_cert_cn_mismatch = TRUE;
+            break;
+
+          case svnsync_opt_trust_server_cert_expired:
+            opt_baton.trust_server_cert_expired = TRUE;
+            break;
+
+          case svnsync_opt_trust_server_cert_not_yet_valid:
+            opt_baton.trust_server_cert_not_yet_valid = TRUE;
+            break;
+
+          case svnsync_opt_trust_server_cert_other_failure:
+            opt_baton.trust_server_cert_other_failure = TRUE;
             break;
 
           case svnsync_opt_no_auth_cache:
@@ -2156,12 +2211,29 @@ sub_main(int *exit_code, int argc, const
                                 "mutually exclusive"));
     }
 
-  /* --trust-server-cert can only be used with --non-interactive */
-  if (opt_baton.trust_server_cert && !opt_baton.non_interactive)
+  /* --trust-* can only be used with --non-interactive */
+  if (!opt_baton.non_interactive)
     {
-      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                              _("--trust-server-cert requires "
-                                "--non-interactive"));
+      if (opt_baton.trust_server_cert_unknown_ca)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-unknown-ca requires "
+                                  "--non-interactive"));
+      if (opt_baton.trust_server_cert_cn_mismatch)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-cn-mismatch requires "
+                                  "--non-interactive"));
+      if (opt_baton.trust_server_cert_expired)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-expired requires "
+                                  "--non-interactive"));
+      if (opt_baton.trust_server_cert_not_yet_valid)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-not-yet-valid requires "
+                                  "--non-interactive"));
+      if (opt_baton.trust_server_cert_other_failure)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--trust-other-failure requires "
+                                  "--non-interactive"));
     }
 
   SVN_ERR(svn_config_ensure(opt_baton.config_dir, pool));
@@ -2273,27 +2345,37 @@ sub_main(int *exit_code, int argc, const
   apr_signal(SIGXFSZ, SIG_IGN);
 #endif
 
-  err = svn_cmdline_create_auth_baton(&opt_baton.source_auth_baton,
-                                      opt_baton.non_interactive,
-                                      opt_baton.source_username,
-                                      opt_baton.source_password,
-                                      opt_baton.config_dir,
-                                      opt_baton.no_auth_cache,
-                                      opt_baton.trust_server_cert,
-                                      config,
-                                      check_cancel, NULL,
-                                      pool);
+  err = svn_cmdline_create_auth_baton2(
+          &opt_baton.source_auth_baton,
+          opt_baton.non_interactive,
+          opt_baton.source_username,
+          opt_baton.source_password,
+          opt_baton.config_dir,
+          opt_baton.no_auth_cache,
+          opt_baton.trust_server_cert_unknown_ca,
+          opt_baton.trust_server_cert_cn_mismatch,
+          opt_baton.trust_server_cert_expired,
+          opt_baton.trust_server_cert_not_yet_valid,
+          opt_baton.trust_server_cert_other_failure,
+          config,
+          check_cancel, NULL,
+          pool);
   if (! err)
-    err = svn_cmdline_create_auth_baton(&opt_baton.sync_auth_baton,
-                                        opt_baton.non_interactive,
-                                        opt_baton.sync_username,
-                                        opt_baton.sync_password,
-                                        opt_baton.config_dir,
-                                        opt_baton.no_auth_cache,
-                                        opt_baton.trust_server_cert,
-                                        config,
-                                        check_cancel, NULL,
-                                        pool);
+    err = svn_cmdline_create_auth_baton2(
+            &opt_baton.sync_auth_baton,
+            opt_baton.non_interactive,
+            opt_baton.sync_username,
+            opt_baton.sync_password,
+            opt_baton.config_dir,
+            opt_baton.no_auth_cache,
+            opt_baton.trust_server_cert_unknown_ca,
+            opt_baton.trust_server_cert_cn_mismatch,
+            opt_baton.trust_server_cert_expired,
+            opt_baton.trust_server_cert_not_yet_valid,
+            opt_baton.trust_server_cert_other_failure,
+            config,
+            check_cancel, NULL,
+            pool);
   if (! err)
     err = (*subcommand->cmd_func)(os, &opt_baton, pool);
   if (err)

Modified: subversion/branches/authzperf/subversion/svnsync/sync.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnsync/sync.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnsync/sync.c (original)
+++ subversion/branches/authzperf/subversion/svnsync/sync.c Sat Jan  3 14:00:41 2015
@@ -34,6 +34,8 @@
 #include "svn_subst.h"
 #include "svn_string.h"
 
+#include "private/svn_string_private.h"
+
 #include "sync.h"
 
 #include "svn_private_config.h"
@@ -83,6 +85,90 @@ normalize_string(const svn_string_t **st
   return SVN_NO_ERROR;
 }
 
+/* Remove r0 references from the mergeinfo string *STR.
+ *
+ * r0 was never a valid mergeinfo reference and cannot be committed with
+ * recent servers, but can be committed through a server older than 1.6.18
+ * for HTTP or older than 1.6.17 for the other protocols. See issue #4476
+ * "Mergeinfo containing r0 makes svnsync and dump and load fail".
+ *
+ * Set *WAS_CHANGED to TRUE if *STR was changed, otherwise to FALSE.
+ */
+static svn_error_t *
+remove_r0_mergeinfo(const svn_string_t **str,
+                    svn_boolean_t *was_changed,
+                    apr_pool_t *result_pool,
+                    apr_pool_t *scratch_pool)
+{
+  svn_stringbuf_t *new_str = svn_stringbuf_create_empty(result_pool);
+  apr_array_header_t *lines;
+  int i;
+
+  SVN_ERR_ASSERT(*str && (*str)->data);
+
+  *was_changed = FALSE;
+
+  /* for each line */
+  lines = svn_cstring_split((*str)->data, "\n", FALSE, scratch_pool);
+
+  for (i = 0; i < lines->nelts; i++)
+    {
+      char *line = APR_ARRAY_IDX(lines, i, char *);
+      char *colon;
+
+      /* split at the last colon */
+      colon = strrchr(line, ':');
+
+      if (! colon)
+        return svn_error_createf(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
+                                 _("Missing colon in svn:mergeinfo "
+                                   "property"));
+
+      /* remove r0 */
+      if (colon[1] == '0')
+        {
+          char *rangelist;
+
+          rangelist = colon + 1;
+
+          if (strncmp(rangelist, "0*,", 3) == 0)
+            {
+              rangelist += 3;
+            }
+          else if (strcmp(rangelist, "0*") == 0
+                   || strncmp(rangelist, "0,", 2) == 0
+                   || strncmp(rangelist, "0-1*", 4) == 0
+                   || strncmp(rangelist, "0-1,", 4) == 0
+                   || strcmp(rangelist, "0-1") == 0)
+            {
+              rangelist += 2;
+            }
+          else if (strcmp(rangelist, "0") == 0)
+            {
+              rangelist += 1;
+            }
+          else if (strncmp(rangelist, "0-", 2) == 0)
+            {
+              rangelist[0] = '1';
+            }
+
+          /* reassemble */
+          if (new_str->len)
+            svn_stringbuf_appendbyte(new_str, '\n');
+          svn_stringbuf_appendbytes(new_str, line, colon + 1 - line);
+          svn_stringbuf_appendcstr(new_str, rangelist);
+        }
+    }
+
+  if (strcmp((*str)->data, new_str->data) != 0)
+    {
+      *was_changed = TRUE;
+    }
+
+  *str = svn_stringbuf__morph_into_string(new_str);
+  return SVN_NO_ERROR;
+}
+
 
 /* Normalize the encoding and line ending style of the values of properties
  * in REV_PROPS that "need translation" (according to
@@ -153,6 +239,7 @@ typedef struct edit_baton_t {
   svn_boolean_t got_textdeltas;
   svn_revnum_t base_revision;
   svn_boolean_t quiet;
+  svn_boolean_t mergeinfo_tweaked;  /* Did we tweak svn:mergeinfo? */
   svn_boolean_t strip_mergeinfo;    /* Are we stripping svn:mergeinfo? */
   svn_boolean_t migrate_svnmerge;   /* Are we converting svnmerge.py data? */
   svn_boolean_t mergeinfo_stripped; /* Did we strip svn:mergeinfo? */
@@ -414,8 +501,19 @@ change_file_prop(void *file_baton,
   if (svn_prop_needs_translation(name))
     {
       svn_boolean_t was_normalized;
+      svn_boolean_t mergeinfo_tweaked = FALSE;
+
+      /* Normalize encoding to UTF-8, and EOL style to LF. */
       SVN_ERR(normalize_string(&value, &was_normalized,
                                eb->source_prop_encoding, pool, pool));
+      /* Correct malformed mergeinfo. */
+      if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
+        {
+          SVN_ERR(remove_r0_mergeinfo(&value, &mergeinfo_tweaked,
+                                      pool, pool));
+          if (mergeinfo_tweaked)
+            eb->mergeinfo_tweaked = TRUE;
+        }
       if (was_normalized)
         (*(eb->normalized_node_props_counter))++;
     }
@@ -513,8 +611,19 @@ change_dir_prop(void *dir_baton,
   if (svn_prop_needs_translation(name))
     {
       svn_boolean_t was_normalized;
+      svn_boolean_t mergeinfo_tweaked = FALSE;
+
+      /* Normalize encoding to UTF-8, and EOL style to LF. */
       SVN_ERR(normalize_string(&value, &was_normalized, eb->source_prop_encoding,
                                pool, pool));
+      /* Maybe adjust svn:mergeinfo. */
+      if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
+        {
+          SVN_ERR(remove_r0_mergeinfo(&value, &mergeinfo_tweaked,
+                                      pool, pool));
+          if (mergeinfo_tweaked)
+            eb->mergeinfo_tweaked = TRUE;
+        }
       if (was_normalized)
         (*(eb->normalized_node_props_counter))++;
     }
@@ -548,6 +657,10 @@ close_edit(void *edit_baton,
     {
       if (eb->got_textdeltas)
         SVN_ERR(svn_cmdline_printf(pool, "\n"));
+      if (eb->mergeinfo_tweaked)
+        SVN_ERR(svn_cmdline_printf(pool,
+                                   "NOTE: Adjusted Subversion mergeinfo in "
+                                   "this revision.\n"));
       if (eb->mergeinfo_stripped)
         SVN_ERR(svn_cmdline_printf(pool,
                                    "NOTE: Dropped Subversion mergeinfo "

Modified: subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py Sat Jan  3 14:00:41 2015
@@ -2003,7 +2003,7 @@ def delete_keep_local_twice(sbox):
     logger.warn('Directory was really deleted')
     raise svntest.Failure
 
-@Wimp("Fails with recent httpd", cond_func=svntest.main.is_ra_type_dav)
+@XFail(svntest.main.is_mod_dav_url_quoting_broken)
 def special_paths_in_repos(sbox):
   "use folders with names like 'c:hi'"
 
@@ -2011,16 +2011,21 @@ def special_paths_in_repos(sbox):
   test_file_source = os.path.join(sbox.repo_dir, 'format')
   repo_url       = sbox.repo_url
 
-  for test_url in [ sbox.repo_url + '/c:hi',
-                    sbox.repo_url + '/C:',
-                    sbox.repo_url + '/C&',
-                    sbox.repo_url + '/C<',
-                    sbox.repo_url + '/C# hi',
-                    sbox.repo_url + '/C\\ri',
-                    sbox.repo_url + '/C?',
-                    sbox.repo_url + '/C+',
-                    sbox.repo_url + '/C%']:
+  test_urls = [ sbox.repo_url + '/c:hi',
+                sbox.repo_url + '/C:',
+                sbox.repo_url + '/C&',
+                sbox.repo_url + '/C<',
+                sbox.repo_url + '/C# hi',
+                sbox.repo_url + '/C?',
+                sbox.repo_url + '/C+',
+                sbox.repo_url + '/C%']
 
+  # On Windows Apache HTTPD breaks '\' for us :(
+  if not (svntest.main.is_os_windows() and
+          svntest.main.is_ra_type_dav()):
+    test_urls += [ sbox.repo_url + '/C\\ri' ]
+
+  for test_url in test_urls:
     test_file_url = test_url + '/' + test_url[test_url.rindex('/')+1:]
 
     # do some manipulations on a folder which problematic names

Modified: subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py Sat Jan  3 14:00:41 2015
@@ -560,7 +560,7 @@ def no_copy_overwrites(sbox):
   # Repeat the last command.  It should *fail* because A/D/H/G already exists.
   svntest.actions.run_and_verify_svn(
     "Whoa, I was able to overwrite a directory!",
-    None, svntest.verify.AnyOutput,
+    None, ".*'/A/D/H/G'.*",
     'cp', dirURL1, dirURL2,
     '-m', 'fooogle')
 

Modified: subversion/branches/authzperf/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/davautocheck.sh?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/davautocheck.sh Sat Jan  3 14:00:41 2015
@@ -264,8 +264,6 @@ HTTPD=$(get_prog_name $httpd) || fail "H
 "$HTTPD" -v 1>/dev/null 2>&1 \
   || fail "HTTPD '$HTTPD' doesn't start properly"
 
-say "Using '$HTTPD'..."
-
 HTPASSWD=$(get_prog_name htpasswd htpasswd2) \
   || fail "Could not find htpasswd or htpasswd2"
 [ -x $HTPASSWD ] \

Modified: subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py Sat Jan  3 14:00:41 2015
@@ -2795,23 +2795,26 @@ def include_immediate_dir_externals(sbox
 
 
 @Issue(4085)
-@XFail()
 def shadowing(sbox):
   "external shadows an existing dir"
 
-  sbox.build(read_only=True)
+  sbox.build()
   wc_dir = sbox.wc_dir
 
   # Setup external: /A/B/F as 'C' child of /A
   externals_prop = "^/A/B/F C\n"
+  change_external(sbox.ospath('A'), externals_prop, commit=False)
+
+  # An update errors out because the external is shadowed by an existing dir
+  svntest.main.run_svn("W205011: Error handling externals definition for '%s'"
+    % (sbox.wc_dir) + "/A/C", 'update', wc_dir)
+
+  # Remove the shadowed directory to unblock the external
+  svntest.main.run_svn(None, 'rm', sbox.repo_url + '/A/C', '-m', 'remove A/C')
+
+  # The next update should fetch the external and not error out
+  sbox.simple_update()
 
-  raised = False
-  try:
-    change_external(sbox.ospath('A'), externals_prop, commit=False)
-  except:
-    raised = True
-  if not raised:
-    raise svntest.Failure("Creating conflicting child 'C' of 'A' didn't error")
 
 # Test for issue #4093 'remapping a file external can segfault due to
 # "deleted" props'.
@@ -3118,7 +3121,7 @@ def move_with_file_externals(sbox):
   sbox.simple_commit()
   sbox.simple_update()
 
-@Issue(4185)
+@Issue(4185,4529)
 def pinned_externals(sbox):
   "pinned external"
 
@@ -3131,6 +3134,7 @@ def pinned_externals(sbox):
   sbox.simple_mkdir('Z')
   sbox.simple_commit('')
 
+  repo_X_C = repo_url + '/X/C'
   repo_X_mu = repo_url + '/X/mu'
 
   expected_output = verify.RegexOutput(
@@ -3150,20 +3154,18 @@ def pinned_externals(sbox):
                           'old-rev       -r 1  ' + repo_X_mu + '\n' +
                                     repo_X_mu + ' new-plain\n' +
                           '-r1  ' + repo_X_mu + ' new-rev\n' +
-                                    repo_X_mu + '@1 new-peg\n',
+                                    repo_X_mu + '@1 new-peg\n'
+                          '-r1  ' + repo_X_C + ' new-dir-rev\n',
                       'Z')
 
-  expected_output = svntest.wc.State(wc_dir, {
-    'A/D'               : Item(status=' U'),
-    'A/D/exdir_E/beta'  : Item(status='A '),
-    'A/D/exdir_E/alpha' : Item(status='A '),
-  })
   expected_error = "svn: E205011: Failure.*externals"
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({
     # The interesting values
     'Z/old-plain'       : Item(contents="This is the file 'mu'.\n"),
     'Z/new-plain'       : Item(contents="This is the file 'mu'.\n"),
+    'Z/new-rev'         : Item(contents="This is the file 'mu'.\n"),
+    'Z/new-dir-rev'     : Item(),
 
     # And verifying X
     'X/D/H/psi'         : Item(contents="This is the file 'psi'.\n"),
@@ -3228,7 +3230,6 @@ def update_dir_external_shallow(sbox):
                                         sbox.ospath('A/B/E'))
 
 @Issue(4411)
-@XFail()
 def switch_parent_relative_file_external(sbox):
   "switch parent-relative file external"
 
@@ -3444,6 +3445,41 @@ def update_deletes_file_external(sbox):
   sbox.simple_update()
   
 
+@Issue(4519)
+def switch_relative_externals(sbox):
+  "switch relative externals"
+
+  sbox.build(create_wc=False)
+
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                                         '-U', sbox.repo_url, '-m', 'Q',
+                                         'mkdir', 'branches',
+                                         'cp', '1', 'A', 'trunk',
+                                         'cp', '1', 'A', 'branches/A',
+                                         'propset', 'svn:externals',
+                                            '../C dirExC\n ../mu fileExMu',
+                                            'trunk/B',
+                                         'propset', 'svn:externals',
+                                            '../C dirExC\n ../mu fileExMu',
+                                            'branches/A/B')
+
+  wc = sbox.add_wc_path('wc')
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'co', sbox.repo_url + '/trunk', wc)
+
+  # This forgets to update some externals data
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'switch', sbox.repo_url + '/branches/A', wc)
+
+  # This upgrade makes the following update fail
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'upgrade', wc)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'up', wc)
+
+
 ########################################################################
 # Run the tests
 
@@ -3500,7 +3536,8 @@ test_list = [ None,
               file_external_unversioned_obstruction,
               file_external_versioned_obstruction,
               update_external_peg_rev,
-              update_deletes_file_external
+              update_deletes_file_external,
+              switch_relative_externals,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/authzperf/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Sat Jan  3 14:00:41 2015
@@ -122,9 +122,18 @@ Global options:
                              only if standard input is a terminal device)
   --force-interactive      : do interactive prompting even if standard input
                              is not a terminal device
-  --trust-server-cert      : accept SSL server certificates from unknown
-                             certificate authorities without prompting (but only
-                             with '--non-interactive')
+  --trust-server-cert      : deprecated; same as --trust-unknown-ca
+  --trust-unknown-ca       : with --non-interactive, accept SSL server
+                             certificates from unknown certificate authorities
+  --trust-cn-mismatch      : with --non-interactive, accept SSL server
+                             certificates even if the server hostname does not
+                             match the certificate's common name attribute
+  --trust-expired          : with --non-interactive, accept expired SSL server
+                             certificates
+  --trust-not-yet-valid    : with --non-interactive, accept SSL server
+                             certificates from the future
+  --trust-other-failure    : with --non-interactive, accept SSL server
+                             certificates with failures other than the above
   --config-dir ARG         : read user configuration files from directory ARG
   --config-option ARG      : set user configuration option in the format:
                                  FILE:SECTION:OPTION=[VALUE]
@@ -206,9 +215,18 @@ Global options:
                              only if standard input is a terminal device)
   --force-interactive      : do interactive prompting even if standard input
                              is not a terminal device
-  --trust-server-cert      : accept SSL server certificates from unknown
-                             certificate authorities without prompting (but only
-                             with '--non-interactive')
+  --trust-server-cert      : deprecated; same as --trust-unknown-ca
+  --trust-unknown-ca       : with --non-interactive, accept SSL server
+                             certificates from unknown certificate authorities
+  --trust-cn-mismatch      : with --non-interactive, accept SSL server
+                             certificates even if the server hostname does not
+                             match the certificate's common name attribute
+  --trust-expired          : with --non-interactive, accept expired SSL server
+                             certificates
+  --trust-not-yet-valid    : with --non-interactive, accept SSL server
+                             certificates from the future
+  --trust-other-failure    : with --non-interactive, accept SSL server
+                             certificates with failures other than the above
   --config-dir ARG         : read user configuration files from directory ARG
   --config-option ARG      : set user configuration option in the format:
                                  FILE:SECTION:OPTION=[VALUE]

Modified: subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py Sat Jan  3 14:00:41 2015
@@ -1964,7 +1964,6 @@ def lock_hook_messages(sbox):
                                            expected_err, actual_stderr)
 
 
-@XFail(svntest.main.is_ra_type_dav)
 def failing_post_hooks(sbox):
   "locking with failing post-lock and post-unlock"
 
@@ -1978,20 +1977,25 @@ def failing_post_hooks(sbox):
   pi_path = sbox.ospath('A/D/G/pi')
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.tweak('A/D/G/pi', writelocked='K')
-  expected_fail_err_re = ".*error text"
-  
+
+  if svntest.main.is_ra_type_dav():
+    expected_lock_err = []
+    expected_unlock_err = '.*svn: E165009: Unlock succeeded.*' #
+  else:
+    expected_unlock_err = expected_lock_err = ".*error text"
+
   # Failing post-lock doesn't stop lock being created.
-  svntest.actions.run_and_verify_svn2(None, "'pi' locked by user",
-                                      expected_fail_err_re, 1,
-                                      'lock', '-m', '', pi_path)
+  svntest.actions.run_and_verify_svn(None, "'pi' locked by user",
+                                     expected_lock_err,
+                                     'lock', '-m', '', pi_path)
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   expected_status.tweak('A/D/G/pi', writelocked=None)
 
   # Failing post-unlock doesn't stop lock being removed.
-  svntest.actions.run_and_verify_svn2(None, "'pi' unlocked",
-                                      expected_fail_err_re, 1,
-                                      'unlock', pi_path)
+  svntest.actions.run_and_verify_svn(None, "'pi' unlocked",
+                                     expected_unlock_err,
+                                     'unlock', pi_path)
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 @XFail()
@@ -2351,6 +2355,26 @@ def lock_commit_bump(sbox):
   svntest.actions.run_and_verify_info(expected_infos, 
                                       sbox.ospath('iota'))
 
+def copy_dir_with_locked_file(sbox):
+  "copy a directory containing a locked file"
+
+  sbox.build()
+  AA_url = sbox.repo_url + '/AA'
+  AA2_url = sbox.repo_url + '/AA2'
+  A_url = sbox.repo_url + '/A'
+  mu_url = A_url + '/mu'
+
+  svntest.main.run_svn(None, 'lock', '-m', 'locked', mu_url)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'cp', A_url, AA_url,
+                                     '-m', '')
+
+  expected_err = "svn: E160037: .*no matching lock-token available"
+  svntest.actions.run_and_verify_svn(None, None, expected_err,
+                                     'mv', A_url, AA2_url,
+                                     '-m', '')
+
 
 ########################################################################
 # Run the tests
@@ -2416,6 +2440,7 @@ test_list = [ None,
               dav_lock_refresh,
               delete_locked_file_with_percent,
               lock_commit_bump,
+              copy_dir_with_locked_file,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/authzperf/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/patch_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/patch_tests.py Sat Jan  3 14:00:41 2015
@@ -4689,6 +4689,397 @@ def patch_git_rename(sbox):
                                        expected_output, expected_disk,
                                        expected_status, expected_skip)
 
+@Issue(4533)
+def patch_hunk_avoid_reorder(sbox):
+  """avoid reordering hunks"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_append('A/mu',
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n'
+                     'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n' 'YY\n'
+                     'GG\n' 'HH\n' 'II\n' 'JJ\n' 'KK\n' 'LL\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     'MM\n' 'NN\n' 'OO\n' 'PP\n' 'QQ\n' 'RR\n'
+                     'SS\n' 'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n'
+                     'YY\n' 'ZZ\n', truncate=True)
+  sbox.simple_commit()
+
+  # two hunks, first matches at offset +18, second matches at both -13
+  # and +18 but we want the second match as it is after the first
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 1)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -13,6 +13,7 @@\n",
+    " MM\n",
+    " NN\n",
+    " OO\n",
+    "+11111\n",
+    " PP\n",
+    " QQ\n",
+    " RR\n",
+    "@@ -20,6 +20,7 @@\n",
+    " TT\n",
+    " UU\n",
+    " VV\n",
+    "+22222\n",
+    " WW\n",
+    " XX\n",
+    " YY\n",
+    ]
+
+  patch_file_path = make_patch_path(sbox)
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -13,6 +13,7 @@ with offset 18\n',
+    '>         applied hunk @@ -20,6 +20,7 @@ with offset 18\n'
+    ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents=
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n'
+                     'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n' 'YY\n'
+                     'GG\n' 'HH\n' 'II\n' 'JJ\n' 'KK\n' 'LL\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     'MM\n' 'NN\n' 'OO\n' '11111\n' 'PP\n' 'QQ\n' 'RR\n'
+                     'SS\n' 'TT\n' 'UU\n' 'VV\n' '22222\n' 'WW\n' 'XX\n'
+                     'YY\n' 'ZZ\n')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='M ', wc_rev=2)
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  sbox.simple_revert('A/mu')
+
+  # change patch so second hunk matches at both -14 and +17, we still
+  # want the second match
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 1)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -13,6 +13,7 @@\n",
+    " MM\n",
+    " NN\n",
+    " OO\n",
+    "+11111\n",
+    " PP\n",
+    " QQ\n",
+    " RR\n",
+    "@@ -21,6 +21,7 @@\n",
+    " TT\n",
+    " UU\n",
+    " VV\n",
+    "+22222\n",
+    " WW\n",
+    " XX\n",
+    " YY\n",
+    ]
+
+  patch_file_path = make_patch_path(sbox)
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -13,6 +13,7 @@ with offset 18\n',
+    '>         applied hunk @@ -21,6 +21,7 @@ with offset 17\n'
+    ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents=
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n'
+                     'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n' 'YY\n'
+                     'GG\n' 'HH\n' 'II\n' 'JJ\n' 'KK\n' 'LL\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     'MM\n' 'NN\n' 'OO\n' '11111\n' 'PP\n' 'QQ\n' 'RR\n'
+                     'SS\n' 'TT\n' 'UU\n' 'VV\n' '22222\n' 'WW\n' 'XX\n'
+                     'YY\n' 'ZZ\n')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='M ', wc_rev=2)
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  sbox.simple_revert('A/mu')
+
+@XFail()
+@Issue(4533)
+def patch_hunk_avoid_reorder2(sbox):
+  """avoid reordering hunks 2"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_append('A/mu',
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n'
+                     'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n' 'YY\n'
+                     'GG\n' 'HH\n' 'II\n' 'JJ\n' 'KK\n' 'LL\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     'MM\n' 'NN\n' 'OO\n' 'PP\n' 'QQ\n' 'RR\n'
+                     'SS\n' 'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n'
+                     'YY\n' 'ZZ\n', truncate=True)
+  sbox.simple_commit()
+
+  # two hunks, first matches at offset +18, second matches at both -13
+  # change patch so second hunk matches at both -12 and +19, we still
+  # want the second match
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 1)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -13,6 +13,7 @@\n",
+    " MM\n",
+    " NN\n",
+    " OO\n",
+    "+11111\n",
+    " PP\n",
+    " QQ\n",
+    " RR\n",
+    "@@ -19,6 +19,7 @@\n",
+    " TT\n",
+    " UU\n",
+    " VV\n",
+    "+22222\n",
+    " WW\n",
+    " XX\n",
+    " YY\n",
+    ]
+
+  patch_file_path = make_patch_path(sbox)
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -13,6 +13,7 @@ with offset 18\n',
+    '>         applied hunk @@ -19,6 +19,7 @@ with offset 19\n'
+    ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents=
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n'
+                     'TT\n' 'UU\n' 'VV\n' 'WW\n' 'XX\n' 'YY\n'
+                     'GG\n' 'HH\n' 'II\n' 'JJ\n' 'KK\n' 'LL\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     '33333\n' '33333\n' '33333\n'
+                     'MM\n' 'NN\n' 'OO\n' '11111\n' 'PP\n' 'QQ\n' 'RR\n'
+                     'SS\n' 'TT\n' 'UU\n' 'VV\n' '22222\n' 'WW\n' 'XX\n'
+                     'YY\n' 'ZZ\n')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='M ', wc_rev=2)
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+@Issue(4533)
+def patch_hunk_reorder(sbox):
+  """hunks that reorder"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_append('A/mu',
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n' 'GG\n'
+                     'HH\n' 'II\n' 'JJ\n' 'KK\n' 'LL\n' 'MM\n' 'NN\n',
+                     truncate=True)
+  sbox.simple_commit()
+
+  # Two hunks match in opposite order
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 1)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -2,6 +2,7 @@\n",
+    " II\n",
+    " JJ\n",
+    " KK\n",
+    "+11111\n",
+    " LL\n",
+    " MM\n",
+    " NN\n",
+    "@@ -9,6 +10,7 @@\n",
+    " BB\n",
+    " CC\n",
+    " DD\n",
+    "+22222\n",
+    " EE\n",
+    " FF\n",
+    " GG\n",
+    ]
+
+  patch_file_path = make_patch_path(sbox)
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -9,6 +10,7 @@ with offset -7\n',
+    '>         applied hunk @@ -2,6 +2,7 @@ with offset 7\n',
+    ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents=
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' '22222\n' 'EE\n' 'FF\n' 'GG\n'
+                     'HH\n' 'II\n' 'JJ\n' 'KK\n' '11111\n' 'LL\n' 'MM\n' 'NN\n')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='M ', wc_rev=2)
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+@XFail()
+def patch_hunk_overlap(sbox):
+  """hunks that overlap"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_append('A/mu',
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' 'EE\n' 'FF\n'
+                     'GG\n' 'HH\n' 'II\n', truncate=True)
+  sbox.simple_commit()
+
+  # Two hunks that overlap when applied, GNU patch can apply both hunks.
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 1)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -2,6 +2,7 @@\n",
+    " BB\n",
+    " CC\n",
+    " DD\n",
+    "+11111\n",
+    " EE\n",
+    " FF\n",
+    " GG\n",
+    "@@ -9,6 +10,7 @@\n",
+    " DD\n",
+    " EE\n",
+    " FF\n",
+    "+22222\n",
+    " GG\n",
+    " HH\n",
+    " II\n",
+    ]
+
+  patch_file_path = make_patch_path(sbox)
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -9,6 +10,7 @@ with offset -5\n',
+    ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents=
+                     'AA\n' 'BB\n' 'CC\n' 'DD\n' '11111\n' 'EE\n' 'FF\n'
+                     '22222\n' 'GG\n' 'HH\n' 'II\n')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='M ', wc_rev=2)
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+def patch_delete_modified(sbox):
+  """patch delete modified"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # A patch that deletes beta.
+  unidiff_patch = [
+    "Index: A/B/E/beta\n",
+    "===================================================================\n",
+    "--- A/B/E/beta	(revision 1)\n",
+    "+++ A/B/E/beta	(working copy)\n",
+    "@@ -1 +0,0 @@\n",
+    "-This is the file 'beta'.\n",
+    ]
+
+  patch_file_path = make_patch_path(sbox)
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  # First application deletes beta
+  expected_output = [
+    'D         %s\n' % sbox.ospath('A/B/E/beta'),
+    ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('A/B/E/beta')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/B/E/beta', status='D ')
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  # Second application skips
+  expected_output = [
+    'Skipped \'%s\'\n' % sbox.ospath('A/B/E/beta'),
+  ] + svntest.main.summary_of_conflicts(skipped_paths=1)
+  expected_skip = wc.State('', {
+    sbox.ospath('A/B/E/beta') :  Item(verb='Skipped'),
+  })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  # Third application, with file present even though state is 'D', also skips
+  sbox.simple_append('A/B/E/beta', 'Modified', truncate=True)
+  expected_disk.add({'A/B/E/beta' : Item(contents='Modified')})
+  expected_output = [
+    'Skipped \'%s\'\n' % sbox.ospath('A/B/E/beta'),
+  ] + svntest.main.summary_of_conflicts(skipped_paths=1)
+  expected_skip = wc.State('', {
+    sbox.ospath('A/B/E/beta') :  Item(verb='Skipped'),
+  })
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  # Revert and modify beta, fourth application gives a text conflict.
+  sbox.simple_revert('A/B/E/beta')
+  sbox.simple_append('A/B/E/beta', 'Modified', truncate=True)
+
+  expected_output = [
+    'C         %s\n' % sbox.ospath('A/B/E/beta'),
+    '>         rejected hunk @@ -1,1 +0,0 @@\n',
+  ] + svntest.main.summary_of_conflicts(text_conflicts=1)
+  expected_skip = wc.State('', { })
+  reject_file_contents = [
+    "--- A/B/E/beta\n",
+    "+++ A/B/E/beta\n",
+    "@@ -1,1 +0,0 @@\n",
+    "-This is the file 'beta'.\n",
+  ]
+  expected_disk.add({'A/B/E/beta.svnpatch.rej'
+                     : Item(contents=''.join(reject_file_contents))
+                     })
+  expected_status.tweak('A/B/E/beta', status='M ')
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
 ########################################################################
 #Run the tests
 
@@ -4741,7 +5132,12 @@ test_list = [ None,
               patch_apply_no_fuz,
               patch_lacking_trailing_eol_on_context,
               patch_with_custom_keywords,
-              patch_git_rename
+              patch_git_rename,
+              patch_hunk_avoid_reorder,
+              patch_hunk_avoid_reorder2,
+              patch_hunk_reorder,
+              patch_hunk_overlap,
+              patch_delete_modified,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/authzperf/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/redirect_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/redirect_tests.py Sat Jan  3 14:00:41 2015
@@ -178,6 +178,33 @@ def redirected_nonroot_update(sbox):
   verify_url(wc_dir, checkout_url)
 
 #----------------------------------------------------------------------
+@SkipUnless(svntest.main.is_ra_type_dav)
+def redirected_externals(sbox):
+  "redirected externals"
+
+  sbox.build()
+
+  sbox.simple_propset('svn:externals',
+                      '^/A/B/E/alpha fileX\n'
+                      '^/A/B/F dirX',
+                      'A/C')
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  wc_dir = sbox.add_wc_path("my")
+  co_url = sbox.redirected_root_url()
+  exit_code, out, err = svntest.main.run_svn(None, 'co', co_url, wc_dir)
+  if err:
+    raise svntest.Failure
+  if not redirect_regex.match(out[0]):
+    raise svntest.Failure
+
+  verify_url(wc_dir, sbox.repo_url)
+  verify_url(sbox.ospath('A/C/fileX'), sbox.repo_url + '/A/B/E/alpha',
+             wc_path_is_file=True)
+  verify_url(sbox.ospath('A/C/dirX'), sbox.repo_url + '/A/B/F')
+
+#----------------------------------------------------------------------
 
 ########################################################################
 # Run the tests
@@ -188,6 +215,7 @@ test_list = [ None,
               redirected_checkout,
               redirected_update,
               redirected_nonroot_update,
+              redirected_externals,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/authzperf/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/svnadmin_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/svnadmin_tests.py Sat Jan  3 14:00:41 2015
@@ -32,6 +32,7 @@ import shutil
 import sys
 import threading
 import time
+import gzip
 
 logger = logging.getLogger()
 
@@ -86,12 +87,6 @@ def check_hotcopy_fsfs_fsx(src, dst):
                                 "source" % src_dirent)
       # Compare all files in this directory
       for src_file in src_files:
-        # Exclude temporary files
-        if src_file == 'rev-prop-atomics.shm':
-          continue
-        if src_file == 'rev-prop-atomics.mutex':
-          continue
-
         # Ignore auto-created empty lock files as they may or may not
         # be present and are neither required by nor do they harm to
         # the destination repository.
@@ -143,7 +138,7 @@ def check_hotcopy_fsfs_fsx(src, dst):
         # the hotcopy destination (i.e. a fresh cache generation)
         if src_file == 'revprop-generation':
           f2 = open(dst_path, 'r')
-          revprop_gen = int(f2.read().strip())
+          revprop_gen = int(f2.read().strip().split()[1])
           if revprop_gen != 0:
               raise svntest.Failure("Hotcopy destination has non-zero " +
                                     "revprop generation")
@@ -392,7 +387,9 @@ def set_changed_path_list(sbox, revision
     footer_length = ord(contents[length-1]);
     footer = contents[length - footer_length - 1:length-1]
     l2p_offset = long(footer.split(' ')[0])
-    p2l_offset = long(footer.split(' ')[1])
+    l2p_checksum = footer.split(' ')[1]
+    p2l_offset = long(footer.split(' ')[2])
+    p2l_checksum = footer.split(' ')[3]
 
     idx = FSFS_Index(sbox, revision)
     (offset, item_len, item_type) = idx.get_item(1)
@@ -405,7 +402,8 @@ def set_changed_path_list(sbox, revision
     file_len = body_len + len(changes) + 1
     p2l_offset += file_len - l2p_offset
 
-    header = str(file_len) + ' ' + str(p2l_offset)
+    header = str(file_len) + ' ' + l2p_checksum + ' ' \
+           + str(p2l_offset) + ' ' + p2l_checksum
     header += chr(len(header))
     header = '\n' + indexes + header
 
@@ -2928,6 +2926,49 @@ def freeze_same_uuid(sbox):
                                           sys.executable, '-c', 'True')
 
 
+@Skip(svntest.main.is_fs_type_fsx)
+def upgrade(sbox):
+  "upgrade --compatible-version=1.3"
+
+  sbox.build(create_wc=False, minor_version=3)
+  svntest.actions.run_and_verify_svnadmin(None, None, [], "upgrade",
+                                          sbox.repo_dir)
+  # Does the repository work after upgrade?
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                     'Committed revision 2.\n'], [], 'mkdir',
+                                     '-m', svntest.main.make_log_msg(),
+                                     sbox.repo_url + '/dir')
+
+def load_txdelta(sbox):
+  "exercising svn_txdelta_target on BDB"
+
+  test_create(sbox)
+
+  # This dumpfile produced a BDB repository that generated cheksum
+  # mismatches on read caused by the improper handling of
+  # svn_txdelta_target ops.  The bug was fixed by r1640832.
+
+  dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
+                                   'svnadmin_tests_data',
+                                   'load_txdelta.dump.gz')
+  dumpfile = gzip.open(dumpfile_location).read()
+
+  load_dumpstream(sbox, dumpfile)
+
+  # Verify would fail with a checksum mismatch:
+  # * Error verifying revision 14.
+  # svnadmin: E200014: MD5 checksum mismatch on representation 'r':
+  #    expected:  5182e8876ed894dc7fe28f6ff5b2fee6
+  #      actual:  5121f82875508863ad70daa8244e6947
+
+  exit_code, output, errput = svntest.main.run_svnadmin("verify", sbox.repo_dir)
+  if errput:
+    raise SVNUnexpectedStderr(errput)
+  if svntest.verify.verify_outputs(
+    "Output of 'svnadmin verify' is unexpected.", None, output, None,
+    ".*Verified revision *"):
+    raise svntest.Failure
+
 ########################################################################
 # Run the tests
 
@@ -2980,6 +3021,8 @@ test_list = [ None,
               fsfs_hotcopy_progress_with_revprop_changes,
               fsfs_hotcopy_progress_old,
               freeze_same_uuid,
+              upgrade,
+              load_txdelta,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/authzperf/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/svndumpfilter_tests.py Sat Jan  3 14:00:41 2015
@@ -323,9 +323,9 @@ def filter_mergeinfo_revs_outside_of_dum
   # --skip-missing-merge-soruces which should strip out any revisions < 6.
   # Then we'll load the filtered result into an empty repository.  This
   # should offset the incoming mergeinfo by -5.  In addition, any mergeinfo
-  # revisions that are adjusted to r1 should be removed because that implies
-  # a merge of -r0:1, which is impossible.  The resulting mergeinfo should
-  # look like this:
+  # referring to the initial revision in the dump file (r6) should be
+  # removed because the change it refers to (r5:6) is not wholly within the
+  # dumpfile.  The resulting mergeinfo should look like this:
   #
   #   Properties on 'branches/B1':
   #     svn:mergeinfo

Modified: subversion/branches/authzperf/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/svnrdump_tests.py?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/svnrdump_tests.py Sat Jan  3 14:00:41 2015
@@ -70,13 +70,17 @@ def build_repos(sbox):
   # Create an empty repository.
   svntest.main.create_repos(sbox.repo_dir)
 
-def compare_repos_dumps(svnrdump_sbox, svnadmin_dumpfile):
+def compare_repos_dumps(svnrdump_sbox, svnadmin_dumpfile,
+                        bypass_prop_validation=False):
   """Compare two dumpfiles, one created from SVNRDUMP_SBOX, and other given
   by SVNADMIN_DUMPFILE.  The dumpfiles do not need to match linewise, as the
   SVNADMIN_DUMPFILE contents will first be loaded into a repository and then
   re-dumped to do the match, which should generate the same dumpfile as
   dumping SVNRDUMP_SBOX."""
 
+  ### Note: The call from run_dump_test() passes the expected and actual
+  ### parameters in the opposite order to that implied by the parameter names.
+
   svnrdump_contents = svntest.actions.run_and_verify_dump(
                                                     svnrdump_sbox.repo_dir)
 
@@ -84,7 +88,8 @@ def compare_repos_dumps(svnrdump_sbox, s
   svntest.main.safe_rmtree(svnadmin_sbox.repo_dir)
   svntest.main.create_repos(svnadmin_sbox.repo_dir)
 
-  svntest.actions.run_and_verify_load(svnadmin_sbox.repo_dir, svnadmin_dumpfile)
+  svntest.actions.run_and_verify_load(svnadmin_sbox.repo_dir, svnadmin_dumpfile,
+                                      bypass_prop_validation)
 
   svnadmin_contents = svntest.actions.run_and_verify_dump(
                                                     svnadmin_sbox.repo_dir)
@@ -150,7 +155,9 @@ def run_dump_test(sbox, dumpfile_name, e
       None)
 
   else:
-    compare_repos_dumps(sbox, svnadmin_dumpfile)
+    ### Note: This call passes the expected and actual parameters in the
+    ### opposite order to that implied by the parameter names.
+    compare_repos_dumps(sbox, svnrdump_dumpfile, bypass_prop_validation)
 
 def run_load_test(sbox, dumpfile_name, expected_dumpfile_name = None,
                   expect_deltas = True):
@@ -799,6 +806,25 @@ def load_prop_change_in_non_deltas_dump(
                                           [], [], 0,
                                           '-q', 'load', sbox.repo_url)
 
+#----------------------------------------------------------------------
+
+@Issue(4476)
+def dump_mergeinfo_contains_r0(sbox):
+  "dump: mergeinfo that contains r0"
+  ### We pass the original dump file name as 'expected_dumpfile_name' because
+  ### run_dump_test is currently broken when we don't.
+  run_dump_test(sbox, "mergeinfo-contains-r0.dump",
+                bypass_prop_validation=True)
+
+#----------------------------------------------------------------------
+
+@XFail()
+@Issue(4476)
+def load_mergeinfo_contains_r0(sbox):
+  "load: mergeinfo that contains r0"
+  run_load_test(sbox, "mergeinfo-contains-r0.dump",
+                expected_dumpfile_name="mergeinfo-contains-r0.expected.dump")
+
 
 ########################################################################
 # Run the tests
@@ -855,6 +881,8 @@ test_list = [ None,
               only_trunk_range_dump,
               only_trunk_A_range_dump,
               load_prop_change_in_non_deltas_dump,
+              dump_mergeinfo_contains_r0,
+              load_mergeinfo_contains_r0,
              ]
 
 if __name__ == '__main__':