You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2018/01/02 09:47:17 UTC

svn commit: r1819798 [2/2] - in /subversion/branches/shelve-checkpoint: ./ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/util/ notes/api-errata/1.10/ subversion/bindings/swig/perl/native/t/ subversion/include/ subversion/inclu...

Modified: subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py Tue Jan  2 09:47:16 2018
@@ -1610,28 +1610,28 @@ def server_has_mergeinfo():
   return options.server_minor_version >= 5
 
 def server_has_revprop_commit():
-  return options.server_minor_version >= 5
+  return options.server_caps.has_revprop_commit
 
 def server_authz_has_aliases():
-  return options.server_minor_version >= 5
+  return options.server_caps.authz_has_aliases
 
 def server_gets_client_capabilities():
-  return options.server_minor_version >= 5
+  return options.server_caps.gets_client_capabilities
 
 def server_has_partial_replay():
-  return options.server_minor_version >= 5
+  return options.server_caps.has_partial_replay
 
 def server_enforces_UTF8_fspaths_in_verify():
-  return options.server_minor_version >= 6
+  return options.server_caps.enforces_UTF8_fspaths_in_verify
 
 def server_enforces_date_syntax():
-  return options.server_minor_version >= 5
+  return options.server_caps.enforces_date_syntax
 
 def server_has_atomic_revprop():
-  return options.server_minor_version >= 7
+  return options.server_caps.has_atomic_revprop
 
 def server_has_reverse_get_file_revs():
-  return options.server_minor_version >= 8
+  return options.server_caps.has_reverse_get_file_revs
 
 def is_plaintext_password_storage_disabled():
   try:
@@ -2176,6 +2176,19 @@ def _create_parser(usage=None):
 
   return parser
 
+class ServerCaps():
+  """A simple struct that contains the actual server capabilities that don't
+     depend on other settings like FS versions."""
+
+  def __init__(self, options):
+    self.has_revprop_commit = options.server_minor_version >= 5
+    self.authz_has_aliases = options.server_minor_version >= 5
+    self.gets_client_capabilities = options.server_minor_version >= 5
+    self.has_partial_replay = options.server_minor_version >= 5
+    self.enforces_UTF8_fspaths_in_verify = options.server_minor_version >= 6
+    self.enforces_date_syntax = options.server_minor_version >= 5
+    self.has_atomic_revprop = options.server_minor_version >= 7
+    self.has_reverse_get_file_revs = options.server_minor_version >= 8
 
 def parse_options(arglist=sys.argv[1:], usage=None):
   """Parse the arguments in arg_list, and set the global options object with
@@ -2186,6 +2199,12 @@ def parse_options(arglist=sys.argv[1:],
   parser = _create_parser(usage)
   (options, args) = parser.parse_args(arglist)
 
+  # Peg the actual server capabilities.
+  # We tweak the server_minor_version later to accommodate FS restrictions,
+  # but we don't want them to interfere with expectations towards the "pure"
+  # server code.
+  options.server_caps = ServerCaps(options)
+
   # If there are no logging handlers registered yet, then install our
   # own with our custom formatter. (anything currently installed *is*
   # our handler as tested above, in _create_parser)
@@ -2217,8 +2236,16 @@ def parse_options(arglist=sys.argv[1:],
     parser.error("test harness only supports server minor versions 3-%d"
                  % SVN_VER_MINOR)
 
-  # Make sure the server-minor-version matches the fsfs-version parameter.
-  #
+  pass
+
+  return (parser, args)
+
+def tweak_options_for_precooked_repos():
+  """Make sure the server-minor-version matches the fsfs-version parameter
+     for pre-cooked repositories."""
+
+  global options
+
   # Server versions that introduced the respective FSFS formats:
   introducing_version = { 1:1, 2:4, 3:5, 4:6, 6:8, 7:9 }
   if options.fsfs_version:
@@ -2230,12 +2257,8 @@ def parse_options(arglist=sys.argv[1:],
         parser.error("--fsfs-version=%d requires --server-minor-version=%d" \
                      % (options.fsfs_version, introduced_in))
       options.server_minor_version = introduced_in
-    pass
     # ### Add more tweaks here if and when we support pre-cooked versions
     # ### of FSFS repositories.
-  pass
-
-  return (parser, args)
 
 
 def run_tests(test_list, serial_only = False):
@@ -2331,6 +2354,7 @@ def execute_tests(test_list, serial_only
   if not options:
     # Override which tests to run from the commandline
     (parser, args) = parse_options()
+    tweak_options_for_precooked_repos()
     test_selection = args
   else:
     parser = _create_parser()

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_client/conflicts-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_client/conflicts-test.c Tue Jan  2 09:47:16 2018
@@ -540,7 +540,7 @@ create_wc_with_dir_add_vs_dir_add_merge_
       /* Now move the new directory to the colliding path. */
       new_dir_path = svn_relpath_join(trunk_path, new_dir_name, b->pool);
       SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
-      sbox_wc_move(b, move_src_path, new_dir_path);
+      SVN_ERR(sbox_wc_move(b, move_src_path, new_dir_path));
       SVN_ERR(sbox_wc_commit(b, ""));
     }
   new_dir_path = svn_relpath_join(branch_path, new_dir_name, b->pool);

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Tue Jan  2 09:47:16 2018
@@ -1631,8 +1631,8 @@ delta_chain_with_plain(const svn_test_op
   svn_hash_sets(props, "p", svn_string_create(prop_value->data, pool));
 
   hash_rep = svn_stringbuf_create_empty(pool);
-  svn_hash_write2(props, svn_stream_from_stringbuf(hash_rep, pool), "END",
-                  pool);
+  SVN_ERR(svn_hash_write2(props, svn_stream_from_stringbuf(hash_rep, pool),
+                          "END", pool));
 
   SVN_ERR(svn_fs_begin_txn(&txn, fs, rev, pool));
   SVN_ERR(svn_fs_txn_root(&root, txn, pool));

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/authz-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/authz-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/authz-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/authz-test.c Tue Jan  2 09:47:16 2018
@@ -277,9 +277,9 @@ test_authz_parse(const svn_test_opts_t *
 
   printf("[users]\n");
   if (authz->has_anon_rights)
-    print_user_rights(NULL, NULL, 0, &authz->anon_rights, pool);
+    SVN_ERR(print_user_rights(NULL, NULL, 0, &authz->anon_rights, pool));
   if (authz->has_authn_rights)
-    print_user_rights(NULL, NULL, 0, &authz->authn_rights, pool);
+    SVN_ERR(print_user_rights(NULL, NULL, 0, &authz->authn_rights, pool));
   SVN_ERR(svn_iter_apr_hash(NULL, authz->user_rights,
                             print_user_rights, NULL, pool));
   printf("\n\n");

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/dump-load-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/dump-load-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/dump-load-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_repos/dump-load-test.c Tue Jan  2 09:47:16 2018
@@ -81,7 +81,7 @@ test_dump_bad_props(svn_stringbuf_t **du
                              notify_func, notify_baton,
                              NULL, NULL, NULL, NULL,
                              pool));
-  svn_stream_close(stream);
+  SVN_ERR(svn_stream_close(stream));
 
   /* Check that the property appears in the dump data */
   expected_str = apr_psprintf(pool, "K %d\n%s\n"
@@ -131,7 +131,7 @@ test_load_bad_props(svn_stringbuf_t *dum
                              notify_func, notify_baton,
                              NULL, NULL, /*cancellation*/
                              pool));
-  svn_stream_close(stream);
+  SVN_ERR(svn_stream_close(stream));
 
   /* Check the loaded property */
   fs = svn_repos_fs(repos);

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.c Tue Jan  2 09:47:16 2018
@@ -70,12 +70,12 @@ get_config_file_path(const char **cfg_fi
 }
 
 static const char *config_keys[] = { "foo", "a", "b", "c", "d", "e", "f", "g",
-                                     "h", "i", NULL };
+                                     "h", "i", "m", NULL };
 static const char *config_values[] = { "bar", "Aa", "100", "bar",
                                        "a %(bogus)s oyster bar",
                                        "%(bogus)s shmoo %(",
                                        "%Aa", "lyrical bard", "%(unterminated",
-                                       "Aa 100", NULL };
+                                       "Aa 100", "foo bar baz", NULL };
 
 static svn_error_t *
 test_text_retrieval(const svn_test_opts_t *opts,

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.cfg
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.cfg?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.cfg (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/config-test.cfg Tue Jan  2 09:47:16 2018
@@ -45,6 +45,10 @@ j=some %(k)scle
 k=c%(j)sy
 # Depends on a cyclic definition
 l=depends on a %(j)scycle!
+# line continuation
+m = foo
+ bar
+  baz
 
 [UpperCaseSection]
 a=Aa

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c Tue Jan  2 09:47:16 2018
@@ -1762,7 +1762,7 @@ test_rangelist_merge_overlap(apr_pool_t
      svn_string_t * tmp_string;
      svn_rangelist_t *range_list;
 
-     svn_rangelist_to_string(&tmp_string, rangelist, pool);
+     SVN_ERR(svn_rangelist_to_string(&tmp_string, rangelist, pool));
 
      SVN_ERR(svn_rangelist__parse(&range_list, tmp_string->data, pool));
   }

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/priority-queue-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/priority-queue-test.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/priority-queue-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/priority-queue-test.c Tue Jan  2 09:47:16 2018
@@ -125,7 +125,7 @@ verify_queue_order(svn_priority_queue__t
     }
 
   /* the queue should now be empty */
-  verify_empty_queue(queue);
+  SVN_ERR(verify_empty_queue(queue));
 
   return SVN_NO_ERROR;
 }
@@ -154,7 +154,7 @@ test_empty_queue(apr_pool_t *pool)
   svn_priority_queue__t *queue
     = svn_priority_queue__create(elements, compare_func);
 
-  verify_empty_queue(queue);
+  SVN_ERR(verify_empty_queue(queue));
 
   return SVN_NO_ERROR;
 }
@@ -214,7 +214,7 @@ test_update(apr_pool_t *pool)
     }
 
   /* the queue should now be empty */
-  verify_empty_queue(queue);
+  SVN_ERR(verify_empty_queue(queue));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/shelve-checkpoint/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c (original)
+++ subversion/branches/shelve-checkpoint/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c Tue Jan  2 09:47:16 2018
@@ -68,6 +68,7 @@
    use the short option letter as identifier.  */
 typedef enum svn_min__longopt_t {
   opt_auth_password = SVN_OPT_FIRST_LONGOPT_ID,
+  opt_auth_password_from_stdin,
   opt_auth_username,
   opt_config_dir,
   opt_config_options,
@@ -113,6 +114,9 @@ const apr_getopt_option_t svn_min__optio
                     N_("specify a password ARG (caution: on many operating\n"
                        "                             "
                        "systems, other users will be able to see this)")},
+  {"password-from-stdin",
+                    opt_auth_password_from_stdin, 0,
+                    N_("read password from stdin")},
   {"targets",       opt_targets, 1,
                     N_("pass contents of file ARG as additional args")},
   {"depth",         opt_depth, 1,
@@ -209,11 +213,11 @@ const apr_getopt_option_t svn_min__optio
    command to take these arguments allows scripts to just pass them
    willy-nilly to every invocation of 'svn') . */
 const int svn_min__global_options[] =
-{ opt_auth_username, opt_auth_password, opt_no_auth_cache, opt_non_interactive,
-  opt_force_interactive, 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_auth_username, opt_auth_password, opt_auth_password_from_stdin,
+  opt_no_auth_cache, opt_non_interactive, opt_force_interactive,
+  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_config_dir, opt_config_options, 0
 };
 
@@ -417,6 +421,7 @@ sub_main(int *exit_code, int argc, const
   svn_boolean_t interactive_conflicts = FALSE;
   svn_boolean_t force_interactive = FALSE;
   apr_hash_t *cfg_hash;
+  svn_boolean_t read_pass_from_stdin = FALSE;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
@@ -528,6 +533,9 @@ sub_main(int *exit_code, int argc, const
         SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_password,
                                         opt_arg, pool));
         break;
+      case opt_auth_password_from_stdin:
+        read_pass_from_stdin = TRUE;
+        break;
       case opt_no_auth_cache:
         opt_state.no_auth_cache = TRUE;
         break;
@@ -606,6 +614,14 @@ sub_main(int *exit_code, int argc, const
                                   opt_state.non_interactive,
                                   force_interactive);
 
+  /* --password-from-stdin can only be used with --non-interactive */
+  if (read_pass_from_stdin && !opt_state.non_interactive)
+    {
+      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                              _("--password-from-stdin requires "
+                                "--non-interactive"));
+    }
+
   /* ### This really belongs in libsvn_client.  The trouble is,
      there's no one place there to run it from, no
      svn_client_init().  We'd have to add it to all the public
@@ -788,6 +804,12 @@ sub_main(int *exit_code, int argc, const
   }
 #endif
 
+  /* Get password from stdin if necessary */
+  if (read_pass_from_stdin)
+    {
+      SVN_ERR(svn_io_stdin_readline(&opt_state.auth_password, pool, pool));
+    }
+
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
   SVN_ERR(svn_client_create_context2(&ctx, cfg_hash, pool));

Modified: subversion/branches/shelve-checkpoint/tools/client-side/svnconflict/svnconflict.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/client-side/svnconflict/svnconflict.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/client-side/svnconflict/svnconflict.c (original)
+++ subversion/branches/shelve-checkpoint/tools/client-side/svnconflict/svnconflict.c Tue Jan  2 09:47:16 2018
@@ -78,6 +78,7 @@ typedef struct svnconflict_cmd_baton_t
    use the short option letter as identifier.  */
 typedef enum svnconflict_longopt_t {
   opt_auth_password = SVN_OPT_FIRST_LONGOPT_ID,
+  opt_auth_password_from_stdin,
   opt_auth_username,
   opt_config_dir,
   opt_config_options,
@@ -96,6 +97,9 @@ static const apr_getopt_option_t svnconf
                     N_("specify a password ARG (caution: on many operating\n"
                        "                             "
                        "systems, other users will be able to see this)")},
+  {"password-from-stdin",
+                    opt_auth_password_from_stdin, 0,
+                    N_("read password from stdin")},
   {"config-dir",    opt_config_dir, 1,
                     N_("read user configuration files from directory ARG")},
   {"config-option", opt_config_options, 1,
@@ -141,7 +145,8 @@ static svn_error_t * svnconflict_resolve
 
 /* Options that apply to all commands. */
 static const int svnconflict_global_options[] =
-{ opt_auth_username, opt_auth_password, opt_config_dir, opt_config_options, 0 };
+{ opt_auth_username, opt_auth_password, opt_auth_password_from_stdin,
+  opt_config_dir, opt_config_options, 0 };
 
 static const svn_opt_subcommand_desc2_t svnconflict_cmd_table[] =
 {
@@ -363,12 +368,12 @@ svnconflict_list(apr_getopt_t *os, void
                         &conflict, local_abspath, ctx, pool));
 
   if (text_conflicted)
-    svn_cmdline_printf(pool, "text-conflict\n");
+    SVN_ERR(svn_cmdline_printf(pool, "text-conflict\n"));
 
   for (i = 0; i < props_conflicted->nelts; i++)
     {
       const char *propname = APR_ARRAY_IDX(props_conflicted, i, const char *); 
-      svn_cmdline_printf(pool, "prop-conflict: %s\n", propname);
+      SVN_ERR(svn_cmdline_printf(pool, "prop-conflict: %s\n", propname));
     }
 
   if (tree_conflicted)
@@ -380,14 +385,14 @@ svnconflict_list(apr_getopt_t *os, void
                                                        &local_change,
                                                        conflict, ctx,
                                                        pool, pool));
-      svn_cmdline_printf(pool, "tree-conflict: %s %s\n",
-                         incoming_change, local_change);
+      SVN_ERR(svn_cmdline_printf(pool, "tree-conflict: %s %s\n",
+                                 incoming_change, local_change));
     }
 
   return SVN_NO_ERROR;
 }
 
-static void
+static svn_error_t *
 print_conflict_options(apr_array_header_t *options, apr_pool_t *pool)
 {
   int i;
@@ -401,8 +406,9 @@ print_conflict_options(apr_array_header_
       option = APR_ARRAY_IDX(options, i, svn_client_conflict_option_t *);
       id = svn_client_conflict_option_get_id(option);
       label = svn_client_conflict_option_get_label(option, pool);
-      svn_cmdline_printf(pool, "%d: %s\n", id, label);
+      SVN_ERR(svn_cmdline_printf(pool, "%d: %s\n", id, label));
     }
+  return SVN_NO_ERROR;
 }
 
 /* This implements the `svn_opt_subcommand_t' interface. */
@@ -433,7 +439,7 @@ svnconflict_options_text(apr_getopt_t *o
   SVN_ERR(svn_client_conflict_text_get_resolution_options(&options,
                                                           conflict, ctx,
                                                           pool, pool));
-  print_conflict_options(options, pool);
+  SVN_ERR(print_conflict_options(options, pool));
 
   return SVN_NO_ERROR;
 }
@@ -466,7 +472,7 @@ svnconflict_options_prop(apr_getopt_t *o
   SVN_ERR(svn_client_conflict_prop_get_resolution_options(&options,
                                                           conflict, ctx,
                                                           pool, pool));
-  print_conflict_options(options, pool);
+  SVN_ERR(print_conflict_options(options, pool));
 
   return SVN_NO_ERROR;
 }
@@ -500,7 +506,7 @@ svnconflict_options_tree(apr_getopt_t *o
   SVN_ERR(svn_client_conflict_tree_get_resolution_options(&options,
                                                           conflict, ctx,
                                                           pool, pool));
-  print_conflict_options(options, pool);
+  SVN_ERR(print_conflict_options(options, pool));
 
   return SVN_NO_ERROR;
 }
@@ -639,6 +645,7 @@ sub_main(int *exit_code, int argc, const
   svn_auth_baton_t *ab;
   svn_config_t *cfg_config;
   apr_hash_t *cfg_hash;
+  svn_boolean_t read_pass_from_stdin = FALSE;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
@@ -704,6 +711,9 @@ sub_main(int *exit_code, int argc, const
         SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_password,
                                         opt_arg, pool));
         break;
+      case opt_auth_password_from_stdin:
+        read_pass_from_stdin = TRUE;
+        break;
       case opt_config_dir:
         SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
         opt_state.config_dir = svn_dirent_internal_style(utf8_opt_arg, pool);
@@ -845,6 +855,13 @@ sub_main(int *exit_code, int argc, const
 
   cfg_config = svn_hash_gets(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG);
 
+  /* Get password from stdin if necessary */
+  if (read_pass_from_stdin)
+    {
+      SVN_ERR(svn_io_stdin_readline(&opt_state.auth_password, pool, pool));
+    }
+
+
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
   SVN_ERR(svn_client_create_context2(&ctx, cfg_hash, pool));

Modified: subversion/branches/shelve-checkpoint/tools/dev/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dev/svnmover/svnmover.c?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dev/svnmover/svnmover.c (original)
+++ subversion/branches/shelve-checkpoint/tools/dev/svnmover/svnmover.c Tue Jan  2 09:47:16 2018
@@ -2436,7 +2436,7 @@ do_put_file(svn_branch__txn_t *txn,
     else
       SVN_ERR(svn_stream_for_stdin2(&src, FALSE, scratch_pool));
 
-    svn_stringbuf_from_stream(&text, src, 0, scratch_pool);
+    SVN_ERR(svn_stringbuf_from_stream(&text, src, 0, scratch_pool));
   }
   payload = svn_element__payload_create_file(props, text, scratch_pool);
 
@@ -4332,7 +4332,8 @@ sub_main(int *exit_code, int argc, const
     trust_server_cert_opt,
     trust_server_cert_failures_opt,
     ui_opt,
-    colour_opt
+    colour_opt,
+    auth_password_from_stdin_opt
   };
   static const apr_getopt_option_t options[] = {
     {"verbose", 'v', 0, ""},
@@ -4341,6 +4342,7 @@ sub_main(int *exit_code, int argc, const
     {"file", 'F', 1, ""},
     {"username", 'u', 1, ""},
     {"password", 'p', 1, ""},
+    {"password-from-stdin", auth_password_from_stdin_opt, 1, ""},
     {"root-url", 'U', 1, ""},
     {"revision", 'r', 1, ""},
     {"branch-id", 'B', 1, ""},
@@ -4387,6 +4389,7 @@ sub_main(int *exit_code, int argc, const
   const char *log_msg;
   svn_tristate_t coloured_output = svn_tristate_false;
   svnmover_wc_t *wc;
+  svn_boolean_t read_pass_from_stdin = FALSE;
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
@@ -4431,6 +4434,9 @@ sub_main(int *exit_code, int argc, const
         case 'p':
           password = apr_pstrdup(pool, arg);
           break;
+        case auth_password_from_stdin_opt:
+          read_pass_from_stdin = TRUE;
+          break;
         case 'U':
           SVN_ERR(svn_utf_cstring_to_utf8(&anchor_url, arg, pool));
           if (! svn_path_is_url(anchor_url))
@@ -4553,6 +4559,13 @@ sub_main(int *exit_code, int argc, const
                                   "--non-interactive"));
     }
 
+  /* --password-from-stdin can only be used with --non-interactive */
+  if (read_pass_from_stdin && !non_interactive)
+    {
+      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                              _("--password-from-stdin requires "
+                                "--non-interactive"));
+    }
 
   /* Now initialize the client context */
 
@@ -4580,6 +4593,12 @@ sub_main(int *exit_code, int argc, const
                                             "svnmover: ", "--config-option"));
     }
 
+  /* Get password from stdin if necessary */
+  if (read_pass_from_stdin)
+    {
+      SVN_ERR(svn_io_stdin_readline(&password, pool, pool));
+    }
+
   SVN_ERR(svn_client_create_context2(&ctx, cfg_hash, pool));
 
   cfg_config = svn_hash_gets(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG);

Modified: subversion/branches/shelve-checkpoint/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dev/unix-build/Makefile.svn?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/shelve-checkpoint/tools/dev/unix-build/Makefile.svn Tue Jan  2 09:47:16 2018
@@ -1467,6 +1467,7 @@ SERF_FLAG=--with-serf="$(PREFIX)/serf"
 # serf >= 1.3.0 is built with scons and no longer sets up rpath linker flags,
 # so we have to do that ourselves :(
 SERF_LDFLAG=-Wl,-rpath,$(PREFIX)/serf/lib -Wl,-rpath,$(PREFIX)/bdb/lib
+LZ4_LDFLAG=-Wl,-rpath,$(PREFIX)/lz4/lib
 MOD_DAV_SVN=modules/svn-$(WC)/mod_dav_svn.so
 MOD_AUTHZ_SVN=modules/svn-$(WC)/mod_authz_svn.so
 MOD_DONTDOTHAT=modules/svn-$(WC)/mod_dontdothat.so
@@ -1501,7 +1502,7 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)
 	$(RUBY_OBJDIR)/.installed $(PYTHON_OBJDIR)/.installed
 	cd $(SVN_SRCDIR) && ./autogen.sh
 	cd $(svn_builddir) && \
-		env LDFLAGS="-L$(PREFIX)/neon/lib -L$(PREFIX)/apr/lib $(SERF_LDFLAG) -L$(PREFIX)/gettext/lib -L$(PREFIX)/iconv/lib" \
+		env LDFLAGS="-L$(PREFIX)/neon/lib -L$(PREFIX)/apr/lib $(SERF_LDFLAG) $(LZ4_LDFLAG) -L$(PREFIX)/gettext/lib -L$(PREFIX)/iconv/lib" \
 			CFLAGS="-I$(PREFIX)/gettext/include -DAPR_POOL_DEBUG" \
 			CXXFLAGS="-I$(PREFIX)/gettext/include -DAPR_POOL_DEBUG" \
 			LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$$LD_LIBRARY_PATH" \

Modified: subversion/branches/shelve-checkpoint/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dist/backport.pl?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dist/backport.pl (original)
+++ subversion/branches/shelve-checkpoint/tools/dist/backport.pl Tue Jan  2 09:47:16 2018
@@ -1297,7 +1297,8 @@ sub nominate_main {
   # Done!
   system "$SVN diff -- $STATUS";
   if (prompt "Commit this nomination? ") {
-    system "$SVN commit -m '* STATUS: Nominate r$revnums[0].' -- $STATUS";
+    my $header = join ', ', map "r$_", @revnums;
+    system "$SVN commit -m '* STATUS: Nominate $header.' -- $STATUS";
     exit $?;
   }
   elsif (!$had_local_mods or prompt "Revert STATUS (destroying local mods)? ") {

Modified: subversion/branches/shelve-checkpoint/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dist/release.py?rev=1819798&r1=1819797&r2=1819798&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dist/release.py (original)
+++ subversion/branches/shelve-checkpoint/tools/dist/release.py Tue Jan  2 09:47:16 2018
@@ -174,7 +174,7 @@ class Version(object):
             ver_tag = '" (Alpha %d)"' % self.pre_num
             ver_numtag = '"-alpha%d"' % self.pre_num
         elif self.pre == 'beta':
-            ver_tag = '" (Beta %d)"' % args.version.pre_num
+            ver_tag = '" (Beta %d)"' % self.pre_num
             ver_numtag = '"-beta%d"' % self.pre_num
         elif self.pre == 'rc':
             ver_tag = '" (Release Candidate %d)"' % self.pre_num
@@ -1174,6 +1174,173 @@ def get_keys(args):
         fd.seek(0)
         subprocess.check_call(['gpg', '--import'], stdin=fd)
 
+def add_to_changes_dict(changes_dict, audience, section, change, revision):
+    # Normalize arguments
+    if audience:
+        audience = audience.upper()
+    if section:
+        section = section.lower()
+    change = change.strip()
+    
+    if not audience in changes_dict:
+        changes_dict[audience] = dict()
+    if not section in changes_dict[audience]:
+        changes_dict[audience][section] = dict()
+    
+    changes = changes_dict[audience][section]
+    if change in changes:
+        changes[change].add(revision)
+    else:
+        changes[change] = set([revision])
+        
+def print_section(changes_dict, audience, section, title, mandatory=False):
+    if audience in changes_dict:
+        audience_changes = changes_dict[audience]
+        if mandatory or (section in audience_changes):
+            if title:
+                print('  - %s:' % title)
+        if section in audience_changes:
+            print_changes(audience_changes[section])
+        elif mandatory:
+            print('    (none)')
+
+def print_changes(changes):
+    # Print in alphabetical order, so entries with the same prefix are together
+    for change in sorted(changes):
+        revs = changes[change]
+        rev_string = 'r' + str(min(revs)) + (' et al' if len(revs) > 1 else '')
+        print('    * %s (%s)' % (change, rev_string))
+
+def write_changelog(args):
+    'Write changelog, parsed from commit messages'
+    # Changelog lines are lines with the following format:
+    #   '['[audience[:section]]']' <message>
+    # or:
+    #   <message> '['[audience[:section]]']'
+    # where audience = U (User-visible) or D (Developer-visible)
+    #       section = general|major|minor|client|server|clientserver|other|api|bindings
+    #                 (section is optional and is treated case-insensitively)
+    #       message = the actual text for CHANGES
+    #
+    # This means the "changes label" can be used as prefix or suffix, and it
+    # can also be left empty (which results in an uncategorized changes entry),
+    # if the committer isn't sure where the changelog entry belongs.
+    #
+    # Putting [skip], [ignore], [c:skip] or [c:ignore] somewhere in the
+    # log message means this commit must be ignored for Changelog processing
+    # (ignored even with the --include-unlabeled-summaries option).
+    # 
+    # If there is no changes label anywhere in the commit message, and the
+    # --include-unlabeled-summaries option is used, we'll consider the summary
+    # line of the commit message (= first line except if it starts with a *)
+    # as an uncategorized changes entry, except if it contains "status",
+    # "changes", "post-release housekeeping" or "follow-up".
+    #
+    # Examples:
+    #   [U:major] Better interactive conflict resolution for tree conflicts
+    #   ra_serf: Adjustments for serf versions with HTTP/2 support [U:minor]
+    #   [U] Fix 'svn diff URL@REV WC' wrongly looks up URL@HEAD (issue #4597)
+    #   Fix bug with canonicalizing Window-specific drive-relative URL []
+    #   New svn_ra_list() API function [D:api]
+    #   [D:bindings] JavaHL: Allow access to constructors of a couple JavaHL classes
+
+    branch = secure_repos + '/' + args.branch
+    previous = secure_repos + '/' + args.previous
+    include_unlabeled = args.include_unlabeled
+    
+    mergeinfo = subprocess.check_output(['svn', 'mergeinfo', '--show-revs',
+                    'eligible', '--log', branch, previous]).splitlines()
+    
+    separator_pattern = re.compile('^-{72}$')
+    revline_pattern = re.compile('^r(\d+) \| [^\|]+ \| [^\|]+ \| \d+ lines?$')
+    changes_prefix_pattern = re.compile('^\[(U|D)?:?([^\]]+)?\](.+)$')
+    changes_suffix_pattern = re.compile('^(.+)\[(U|D)?:?([^\]]+)?\]$')
+    
+    changes_dict = dict()  # audience -> (section -> (change -> set(revision)))
+    revision = -1
+    got_firstline = False
+    unlabeled_summary = None
+    changes_ignore = False
+    audience = None
+    section = None
+    message = None
+    
+    for line in mergeinfo:
+        if separator_pattern.match(line):
+            # New revision section. Reset variables.
+            # If there's an unlabeled summary from a previous section, and
+            # include_unlabeled is True, put it into uncategorized_changes.
+            if include_unlabeled and unlabeled_summary and not changes_ignore:
+                add_to_changes_dict(changes_dict, None, None,
+                                    unlabeled_summary, revision)
+            revision = -1
+            got_firstline = False
+            unlabeled_summary = None
+            changes_ignore = False
+            audience = None
+            section = None
+            message = None
+            continue
+
+        revmatch = revline_pattern.match(line)
+        if revmatch and (revision == -1):
+            # A revision line: get the revision number
+            revision = int(revmatch.group(1))
+            logging.debug('Changelog processing revision r%d' % revision)
+            continue
+
+        if line.strip() == '':
+            # Skip empty / whitespace lines
+            continue
+
+        if not got_firstline:
+            got_firstline = True
+            if (not re.search('status|changes|post-release housekeeping|follow-up|^\*',
+                              line, re.IGNORECASE)
+                    and not changes_prefix_pattern.match(line)
+                    and not changes_suffix_pattern.match(line)):
+                unlabeled_summary = line
+
+        if re.search('\[(c:)?(skip|ignore)\]', line, re.IGNORECASE):
+            changes_ignore = True
+            
+        prefix_match = changes_prefix_pattern.match(line)
+        if prefix_match:
+            audience = prefix_match.group(1)
+            section = prefix_match.group(2)
+            message = prefix_match.group(3)
+            add_to_changes_dict(changes_dict, audience, section, message, revision)
+
+        suffix_match = changes_suffix_pattern.match(line)
+        if suffix_match:
+            message = suffix_match.group(1)
+            audience = suffix_match.group(2)
+            section = suffix_match.group(3)
+            add_to_changes_dict(changes_dict, audience, section, message, revision)
+
+    # Output the sorted changelog entries
+    # 1) Uncategorized changes
+    print_section(changes_dict, None, None, None)
+    print
+    # 2) User-visible changes
+    print(' User-visible changes:')
+    print_section(changes_dict, 'U', None, None)
+    print_section(changes_dict, 'U', 'general', 'General')
+    print_section(changes_dict, 'U', 'major', 'Major new features')
+    print_section(changes_dict, 'U', 'minor', 'Minor new features and improvements')
+    print_section(changes_dict, 'U', 'client', 'Client-side bugfixes', mandatory=True)
+    print_section(changes_dict, 'U', 'server', 'Server-side bugfixes', mandatory=True)
+    print_section(changes_dict, 'U', 'clientserver', 'Client-side and server-side bugfixes')
+    print_section(changes_dict, 'U', 'other', 'Other tool improvements and bugfixes')
+    print_section(changes_dict, 'U', 'bindings', 'Bindings bugfixes', mandatory=True)
+    print
+    # 3) Developer-visible changes
+    print(' Developer-visible changes:')
+    print_section(changes_dict, 'D', None, None)
+    print_section(changes_dict, 'D', 'general', 'General', mandatory=True)
+    print_section(changes_dict, 'D', 'api', 'API changes', mandatory=True)
+    print_section(changes_dict, 'D', 'bindings', 'Bindings')
+
 #----------------------------------------------------------------------
 # Main entry point for argument parsing and handling
 
@@ -1338,6 +1505,29 @@ def main():
                             separate subcommand.''')
     subparser.set_defaults(func=cleanup)
 
+    # write-changelog
+    subparser = subparsers.add_parser('write-changelog',
+                    help='''Output to stdout changelog entries parsed from
+                            commit messages, optionally labeled with a category
+                            like [U:client], [D:api], [U], ...''')
+    subparser.set_defaults(func=write_changelog)
+    subparser.add_argument('branch',
+                    help='''The branch (or tag or trunk), relative to
+                            ^/subversion/, of which to generate the
+                            changelog, when compared to "previous".''')
+    subparser.add_argument('previous',
+                    help='''The "previous" branch or tag, relative to 
+                            ^/subversion/, to compare "branch" against.''')
+    subparser.add_argument('--include-unlabeled-summaries',
+                    dest='include_unlabeled',
+                    action='store_true', default=False,
+                    help='''Include summary lines that do not have a changes
+                            label, unless an explicit [c:skip] or [c:ignore]
+                            is part of the commit message (except if the
+                            summary line contains 'STATUS', 'CHANGES',
+                            'Post-release housekeeping', 'Follow-up' or starts
+                            with '*').''')
+    
     # Parse the arguments
     args = parser.parse_args()