You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/15 10:52:18 UTC

svn commit: r1532250 [30/37] - in /subversion/branches/cache-server: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/ contrib/server-side/fsfsfixer/ contrib/se...

Modified: subversion/branches/cache-server/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svn/util.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svn/util.c (original)
+++ subversion/branches/cache-server/subversion/svn/util.c Tue Oct 15 08:52:06 2013
@@ -41,6 +41,7 @@
 #include <apr_general.h>
 #include <apr_lib.h>
 
+#include "svn_private_config.h"
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "svn_ctype.h"
@@ -58,7 +59,6 @@
 #include "svn_xml.h"
 #include "svn_time.h"
 #include "svn_props.h"
-#include "svn_private_config.h"
 #include "cl.h"
 
 #include "private/svn_token.h"
@@ -343,22 +343,17 @@ svn_cl__get_log_message(const char **log
   *tmp_file = NULL;
   if (lmb->message)
     {
-      svn_stringbuf_t *log_msg_buf = svn_stringbuf_create(lmb->message, pool);
-      svn_string_t *log_msg_str = apr_pcalloc(pool, sizeof(*log_msg_str));
-
-      /* Trim incoming messages of the EOF marker text and the junk
-         that follows it.  */
-      truncate_buffer_at_prefix(&(log_msg_buf->len), log_msg_buf->data,
-                                EDITOR_EOF_PREFIX);
+      svn_string_t *log_msg_str = svn_string_create(lmb->message, pool);
 
-      /* Make a string from a stringbuf, sharing the data allocation. */
-      log_msg_str->data = log_msg_buf->data;
-      log_msg_str->len = log_msg_buf->len;
       SVN_ERR_W(svn_subst_translate_string2(&log_msg_str, FALSE, FALSE,
                                             log_msg_str, lmb->message_encoding,
                                             FALSE, pool, pool),
                 _("Error normalizing log message to internal format"));
 
+      /* Strip off the EOF marker text and the junk that follows it. */
+      truncate_buffer_at_prefix(&(log_msg_str->len), (char *)log_msg_str->data,
+                                EDITOR_EOF_PREFIX);
+
       *log_msg = log_msg_str->data;
       return SVN_NO_ERROR;
     }
@@ -466,7 +461,7 @@ svn_cl__get_log_message(const char **log
       if (msg_string)
         message = svn_stringbuf_create_from_string(msg_string, pool);
 
-      /* Strip the prefix from the buffer. */
+      /* Strip off the EOF marker text and the junk that follows it. */
       if (message)
         truncate_buffer_at_prefix(&message->len, message->data,
                                   EDITOR_EOF_PREFIX);
@@ -1012,46 +1007,6 @@ svn_cl__local_style_skip_ancestor(const 
   return svn_dirent_local_style(relpath ? relpath : path, pool);
 }
 
-/* Return a string of the form "PATH_OR_URL@REVISION". */
-static const char *
-path_for_display(const char *path_or_url,
-                 const svn_opt_revision_t *revision,
-                 apr_pool_t *pool)
-{
-  const char *rev_str = svn_opt__revision_to_string(revision, pool);
-
-  if (! svn_path_is_url(path_or_url))
-    path_or_url = svn_dirent_local_style(path_or_url, pool);
-  return apr_psprintf(pool, "%s@%s", path_or_url, rev_str);
-}
-
-svn_error_t *
-svn_cl__check_related_source_and_target(const char *path_or_url1,
-                                        const svn_opt_revision_t *revision1,
-                                        const char *path_or_url2,
-                                        const svn_opt_revision_t *revision2,
-                                        svn_client_ctx_t *ctx,
-                                        apr_pool_t *pool)
-{
-  const char *ancestor_url;
-  svn_revnum_t ancestor_rev;
-
-  SVN_ERR(svn_client__youngest_common_ancestor(
-            &ancestor_url, &ancestor_rev,
-            path_or_url1, revision1, path_or_url2, revision2,
-            ctx, pool, pool));
-
-  if (ancestor_url == NULL)
-    {
-      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                               _("Source and target have no common ancestor: "
-                                 "'%s' and '%s'"),
-                               path_for_display(path_or_url1, revision1, pool),
-                               path_for_display(path_or_url2, revision2, pool));
-    }
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets,
                                                const char *propname,

Modified: subversion/branches/cache-server/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svn_private_config.hw?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svn_private_config.hw (original)
+++ subversion/branches/cache-server/subversion/svn_private_config.hw Tue Oct 15 08:52:06 2013
@@ -48,7 +48,6 @@
 #define SVN_FS_WANT_DB_MINOR    0
 #define SVN_FS_WANT_DB_PATCH    14
 
-
 /* Path separator for local filesystem */
 #define SVN_PATH_LOCAL_SEPARATOR '\\'
 
@@ -58,6 +57,9 @@
 /* Link fs fs library into the fs library */
 #define SVN_LIBSVN_FS_LINKS_FS_FS
 
+/* Link fs fs library into the fs library */
+#define SVN_LIBSVN_FS_LINKS_FS_X
+
 /* Link local repos access library to client */
 #define SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
 
@@ -101,6 +103,21 @@
 #define dgettext(domain, x) (x)
 #endif
 
+/* compiler hints as supported by MS VC */
+#if defined(SVN_DEBUG)
+# define SVN__FORCE_INLINE
+# define SVN__PREVENT_INLINE
+#elif defined(_MSC_VER)
+# define SVN__FORCE_INLINE __forceinline
+# define SVN__PREVENT_INLINE __declspec(noinline)
+#else
+# define SVN__FORCE_INLINE
+# define SVN__PREVENT_INLINE
+#endif
+
+#define SVN__PREDICT_TRUE(x)  (x)
+#define SVN__PREDICT_FALSE(x)  (x)
+
 #endif /* SVN_PRIVATE_CONFIG_HW */
 
 /* Inclusion of Berkeley DB header */

Modified: subversion/branches/cache-server/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnadmin/svnadmin.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/cache-server/subversion/svnadmin/svnadmin.c Tue Oct 15 08:52:06 2013
@@ -25,6 +25,7 @@
 #include <apr_file_io.h>
 #include <apr_signal.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_cmdline.h"
@@ -39,6 +40,7 @@
 #include "svn_cache_config.h"
 #include "svn_version.h"
 #include "svn_props.h"
+#include "svn_sorts.h"
 #include "svn_time.h"
 #include "svn_user.h"
 #include "svn_xml.h"
@@ -47,8 +49,6 @@
 #include "private/svn_subr_private.h"
 #include "private/svn_cmdline_private.h"
 
-#include "svn_private_config.h"
-
 
 /*** Code. ***/
 
@@ -140,7 +140,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 
@@ -177,6 +177,7 @@ enum svnadmin__cmdline_options_t
   {
     svnadmin__version = SVN_OPT_FIRST_LONGOPT_ID,
     svnadmin__incremental,
+    svnadmin__keep_going,
     svnadmin__deltas,
     svnadmin__ignore_uuid,
     svnadmin__force_uuid,
@@ -242,7 +243,9 @@ static const apr_getopt_option_t options
      N_("set repos UUID to that found in stream, if any")},
 
     {"fs-type",       svnadmin__fs_type, 1,
-     N_("type of repository: 'fsfs' (default) or 'bdb'")},
+     N_("type of repository:\n"
+        "                             'fsfs' (default), 'bdb' or 'fsx'\n"
+        "                             CAUTION: FSX is for EXPERIMENTAL use only!")},
 
     {"parent-dir",    svnadmin__parent_dir, 1,
      N_("load at specified directory in repository")},
@@ -285,6 +288,9 @@ static const apr_getopt_option_t options
     {"pre-1.6-compatible",     svnadmin__pre_1_6_compatible, 0,
      N_("deprecated; see --compatible-version")},
 
+    {"keep-going",    svnadmin__keep_going, 0,
+     N_("continue verification after detecting a corruption")},
+
     {"memory-cache-size",     'M', 1,
      N_("size of the extra in-memory cache in MB used to\n"
         "                             minimize redundant operations. Default: 16.\n"
@@ -359,7 +365,7 @@ static const svn_opt_subcommand_desc2_t 
 
   {"hotcopy", subcommand_hotcopy, {0}, N_
    ("usage: svnadmin hotcopy REPOS_PATH NEW_REPOS_PATH\n\n"
-    "Makes a hot copy of a repository.\n"
+    "Make a hot copy of a repository.\n"
     "If --incremental is passed, data which already exists at the destination\n"
     "is not copied again.  Incremental mode is implemented for FSFS repositories.\n"),
    {svnadmin__clean_logs, svnadmin__incremental} },
@@ -415,7 +421,7 @@ static const svn_opt_subcommand_desc2_t 
    ("usage: svnadmin pack REPOS_PATH\n\n"
     "Possibly compact the repository into a more efficient storage model.\n"
     "This may not apply to all repositories, in which case, exit.\n"),
-   {'q'} },
+   {'q', 'M'} },
 
   {"recover", subcommand_recover, {0}, N_
    ("usage: svnadmin recover REPOS_PATH\n\n"
@@ -467,7 +473,7 @@ static const svn_opt_subcommand_desc2_t 
 
   {"unlock", subcommand_unlock, {0}, N_
    ("usage: svnadmin unlock REPOS_PATH LOCKED_PATH USERNAME TOKEN\n\n"
-    "Unlocked LOCKED_PATH (as USERNAME) after verifying that the token\n"
+    "Unlock LOCKED_PATH (as USERNAME) after verifying that the token\n"
     "associated with the lock matches TOKEN.  Use --bypass-hooks to avoid\n"
     "triggering the pre-unlock and post-unlock hook scripts.\n"),
    {svnadmin__bypass_hooks} },
@@ -487,8 +493,8 @@ static const svn_opt_subcommand_desc2_t 
 
   {"verify", subcommand_verify, {0}, N_
    ("usage: svnadmin verify REPOS_PATH\n\n"
-    "Verifies the data stored in the repository.\n"),
-  {'t', 'r', 'q', 'M'} },
+    "Verify the data stored in the repository.\n"),
+  {'t', 'r', 'q', svnadmin__keep_going, 'M'} },
 
   { NULL, NULL, {0}, NULL, {0} }
 };
@@ -499,9 +505,6 @@ struct svnadmin_opt_state
 {
   const char *repository_path;
   const char *fs_type;                              /* --fs-type */
-  svn_boolean_t pre_1_4_compatible;                 /* --pre-1.4-compatible */
-  svn_boolean_t pre_1_5_compatible;                 /* --pre-1.5-compatible */
-  svn_boolean_t pre_1_6_compatible;                 /* --pre-1.6-compatible */
   svn_version_t *compatible_version;                /* --compatible-version */
   svn_opt_revision_t start_revision, end_revision;  /* -r X[:Y] */
   const char *txn_id;                               /* -t TXN */
@@ -519,6 +522,7 @@ struct svnadmin_opt_state
   svn_boolean_t clean_logs;                         /* --clean-logs */
   svn_boolean_t bypass_hooks;                       /* --bypass-hooks */
   svn_boolean_t wait;                               /* --wait */
+  svn_boolean_t keep_going;                         /* --keep-going */
   svn_boolean_t bypass_prop_validation;             /* --bypass-prop-validation */
   enum svn_repos_load_uuid uuid_action;             /* --ignore-uuid,
                                                        --force-uuid */
@@ -617,6 +621,17 @@ parse_args(apr_array_header_t **args,
 }
 
 
+/* This implements 'svn_error_malfunction_handler_t. */
+static svn_error_t *
+crashtest_malfunction_handler(svn_boolean_t can_return,
+                              const char *file,
+                              int line,
+                              const char *expr)
+{
+  abort();
+  return SVN_NO_ERROR; /* Not reached. */
+}
+
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
 subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -624,7 +639,14 @@ subcommand_crashtest(apr_getopt_t *os, v
   struct svnadmin_opt_state *opt_state = baton;
   svn_repos_t *repos;
 
+  (void)svn_error_set_malfunction_handler(crashtest_malfunction_handler);
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+  SVN_ERR(svn_cmdline_printf(pool,
+                             _("Successfully opened repository '%s'.\n"
+                               "Will now crash to simulate a crashing "
+                               "server process.\n"),
+                             svn_dirent_local_style(opt_state->repository_path,
+                                                    pool)));
   SVN_ERR_MALFUNCTION();
 
   /* merely silence a compiler warning (this will never be executed) */
@@ -668,17 +690,6 @@ subcommand_create(apr_getopt_t *os, void
       svn_hash_sets(fs_config, SVN_FS_CONFIG_FS_TYPE, opt_state->fs_type);
     }
 
-  /* Prior to 1.8, we had explicit options to specify compatibility
-     with a handful of prior Subversion releases. */
-  if (opt_state->pre_1_4_compatible)
-    svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE, "1");
-  if (opt_state->pre_1_5_compatible)
-    svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE, "1");
-  if (opt_state->pre_1_6_compatible)
-    svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE, "1");
-
-  /* In 1.8, we figured out that we didn't have to keep extending this
-     madness indefinitely. */
   if (opt_state->compatible_version)
     {
       if (! svn_version__at_least(opt_state->compatible_version, 1, 4, 0))
@@ -689,6 +700,39 @@ subcommand_create(apr_getopt_t *os, void
         svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE, "1");
       if (! svn_version__at_least(opt_state->compatible_version, 1, 8, 0))
         svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE, "1");
+      /* In 1.9, we figured out that we didn't have to keep extending this
+         madness indefinitely. */
+      svn_hash_sets(fs_config, SVN_FS_CONFIG_COMPATIBLE_VERSION,
+                    apr_psprintf(pool, "%d.%d.%d%s%s",
+                                 opt_state->compatible_version->major,
+                                 opt_state->compatible_version->minor,
+                                 opt_state->compatible_version->patch,
+                                 opt_state->compatible_version->tag
+                                 ? "-" : "",
+                                 opt_state->compatible_version->tag));
+    }
+
+  if (opt_state->compatible_version)
+    {
+      if (! svn_version__at_least(opt_state->compatible_version, 1, 1, 0)
+          /* ### TODO: this NULL check hard-codes knowledge of the library's
+                       default fs-type value */
+          && (opt_state->fs_type == NULL
+              || !strcmp(opt_state->fs_type, SVN_FS_TYPE_FSFS)))
+        {
+          return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                  _("Repositories compatible with 1.0.x must "
+                                    "use --fs-type=bdb"));
+        }
+
+      if (! svn_version__at_least(opt_state->compatible_version, 1, 9, 0)
+          && opt_state->fs_type && !strcmp(opt_state->fs_type, SVN_FS_TYPE_FSX))
+        {
+          return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                   _("Repositories compatible with 1.8.x or "
+                                     "earlier cannot use --fs-type=%s"),
+                                   SVN_FS_TYPE_FSX);
+        }
     }
 
   SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
@@ -759,7 +803,6 @@ repos_notify_handler(void *baton,
                      apr_pool_t *scratch_pool)
 {
   svn_stream_t *feedback_stream = baton;
-  apr_size_t len;
 
   switch (notify->action)
   {
@@ -769,6 +812,16 @@ repos_notify_handler(void *baton,
                                         notify->warning_str));
       return;
 
+    case svn_repos_notify_failure:
+      if (notify->revision != SVN_INVALID_REVNUM)
+        svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                    _("* Error verifying revision %ld.\n"),
+                                    notify->revision));
+      if (notify->err)
+        svn_handle_error2(notify->err, stderr, FALSE /* non-fatal */,
+                          "svnadmin: ");
+      return;
+
     case svn_repos_notify_dump_rev_end:
       svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
                                         _("* Dumped revision %ld.\n"),
@@ -783,7 +836,7 @@ repos_notify_handler(void *baton,
 
     case svn_repos_notify_verify_rev_structure:
       if (notify->revision == SVN_INVALID_REVNUM)
-        svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+        svn_error_clear(svn_stream_puts(feedback_stream,
                                 _("* Verifying repository metadata ...\n")));
       else
         svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
@@ -871,13 +924,11 @@ repos_notify_handler(void *baton,
       return;
 
     case svn_repos_notify_load_node_done:
-      len = 7;
-      svn_error_clear(svn_stream_write(feedback_stream, _(" done.\n"), &len));
+      svn_error_clear(svn_stream_puts(feedback_stream, _(" done.\n")));
       return;
 
     case svn_repos_notify_load_copied_node:
-      len = 9;
-      svn_error_clear(svn_stream_write(feedback_stream, "COPIED...", &len));
+      svn_error_clear(svn_stream_puts(feedback_stream, "COPIED..."));
       return;
 
     case svn_repos_notify_load_txn_start:
@@ -905,7 +956,7 @@ repos_notify_handler(void *baton,
       return;
 
     case svn_repos_notify_recover_start:
-      svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+      svn_error_clear(svn_stream_puts(feedback_stream,
                              _("Repository lock acquired.\n"
                                "Please wait; recovering the"
                                " repository may take some time...\n")));
@@ -918,6 +969,35 @@ repos_notify_handler(void *baton,
                                " repository may take some time...\n")));
       return;
 
+    case svn_repos_notify_pack_revprops:
+      {
+        const char *shardstr = apr_psprintf(scratch_pool,
+                                            "%" APR_INT64_T_FMT,
+                                            notify->shard);
+        svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                              _("Packing revision properties"
+                                " in shard %s..."),
+                              shardstr));
+        return;
+      }
+
+    case svn_repos_notify_cleanup_revprops:
+      {
+        const char *shardstr = apr_psprintf(scratch_pool,
+                                            "%" APR_INT64_T_FMT,
+                                            notify->shard);
+        svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                              _("Removing non-packed revision properties"
+                                " in shard %s..."),
+                              shardstr));
+        return;
+      }
+
+    case svn_repos_notify_format_bumped:
+      svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                            _("Bumped repository format to %ld\n"),
+                            notify->revision));
+
     default:
       return;
   }
@@ -1100,6 +1180,7 @@ subcommand_help(apr_getopt_t *os, void *
   struct svnadmin_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]\n"
+      "Subversion repository administration tool.\n"
       "Type 'svnadmin help <subcommand>' for help on a specific subcommand.\n"
       "Type 'svnadmin --version' to see the program version and FS modules.\n"
       "\n"
@@ -1606,10 +1687,12 @@ subcommand_verify(apr_getopt_t *os, void
   if (! opt_state->quiet)
     progress_stream = recode_stream_create(stdout, pool);
 
-  return svn_repos_verify_fs2(repos, lower, upper,
-                              !opt_state->quiet
-                                ? repos_notify_handler : NULL,
-                              progress_stream, check_cancel, NULL, pool);
+  return svn_error_trace(svn_repos_verify_fs3(repos, lower, upper,
+                                              opt_state->keep_going,
+                                              !opt_state->quiet
+                                              ? repos_notify_handler : NULL,
+                                              progress_stream, check_cancel,
+                                              NULL, pool));
 }
 
 /* This implements `svn_opt_subcommand_t'. */
@@ -1636,6 +1719,7 @@ subcommand_info(apr_getopt_t *os, void *
   struct svnadmin_opt_state *opt_state = baton;
   svn_repos_t *repos;
   svn_fs_t *fs;
+  int fs_format;
 
   /* Expect no more arguments. */
   SVN_ERR(parse_args(NULL, os, 0, 0, pool));
@@ -1647,7 +1731,7 @@ subcommand_info(apr_getopt_t *os, void *
                                                     pool)));
 
   {
-    int repos_format, fs_format, minor;
+    int repos_format, minor;
     svn_version_t *repos_version, *fs_version;
     SVN_ERR(svn_repos_info_format(&repos_format, &repos_version,
                                   repos, pool, pool));
@@ -1656,8 +1740,7 @@ subcommand_info(apr_getopt_t *os, void *
 
     SVN_ERR(svn_fs_info_format(&fs_format, &fs_version,
                                fs, pool, pool));
-    SVN_ERR(svn_cmdline_printf(pool, _("Filesystem Format: %d\n"),
-                               fs_format));
+    /* fs_format will be printed later. */
 
     SVN_ERR_ASSERT(repos_version->major == SVN_VER_MAJOR);
     SVN_ERR_ASSERT(fs_version->major == SVN_VER_MAJOR);
@@ -1673,19 +1756,21 @@ subcommand_info(apr_getopt_t *os, void *
   {
     apr_hash_t *capabilities_set;
     apr_array_header_t *capabilities;
-    char *as_string;
+    int i;
 
     SVN_ERR(svn_repos_capabilities(&capabilities_set, repos, pool, pool));
-    SVN_ERR(svn_hash_keys(&capabilities, capabilities_set, pool));
-    as_string = svn_cstring_join(capabilities, ",", pool);
+    capabilities = svn_sort__hash(capabilities_set,
+                                  svn_sort_compare_items_lexically,
+                                  pool);
 
-    /* Delete the trailing comma. */
-    if (as_string[0])
-      as_string[strlen(as_string)-1] = '\0';
-
-    if (capabilities->nelts)
-      SVN_ERR(svn_cmdline_printf(pool, _("Repository Capabilities: %s\n"),
-                                 as_string));
+    for (i = 0; i < capabilities->nelts; i++)
+      {
+        svn_sort__item_t *item = &APR_ARRAY_IDX(capabilities, i,
+                                                svn_sort__item_t);
+        const char *capability = item->key;
+        SVN_ERR(svn_cmdline_printf(pool, _("Repository Capability: %s\n"),
+                                   capability));
+      }
   }
 
   {
@@ -1694,6 +1779,8 @@ subcommand_info(apr_getopt_t *os, void *
     SVN_ERR(svn_fs_info(&info, fs, pool, pool));
     SVN_ERR(svn_cmdline_printf(pool, _("Filesystem Type: %s\n"),
                                info->fs_type));
+    SVN_ERR(svn_cmdline_printf(pool, _("Filesystem Format: %d\n"),
+                               fs_format));
     if (!strcmp(info->fs_type, SVN_FS_TYPE_FSFS))
       {
         const svn_fs_fsfs_info_t *fsfs_info = (const void *)info;
@@ -1709,12 +1796,15 @@ subcommand_info(apr_getopt_t *os, void *
           SVN_ERR(svn_cmdline_printf(pool, _("FSFS Shard Size: %d\n"),
                                      fsfs_info->shard_size));
 
-        if (fsfs_info->min_unpacked_rev + fsfs_info->shard_size > youngest + 1)
-          SVN_ERR(svn_cmdline_printf(pool, _("FSFS Packed: yes\n")));
-        else if (fsfs_info->min_unpacked_rev)
-          SVN_ERR(svn_cmdline_printf(pool, _("FSFS Packed: partly\n")));
-        else
-          SVN_ERR(svn_cmdline_printf(pool, _("FSFS Packed: no\n")));
+        /* Print packing statistics, if enabled on the FS. */
+        if (fsfs_info->shard_size)
+          {
+            const int shard_size = fsfs_info->shard_size;
+            const long shards_packed = fsfs_info->min_unpacked_rev / shard_size;
+            const long shards_full = (youngest + 1) / shard_size;
+            SVN_ERR(svn_cmdline_printf(pool, _("FSFS Shards Packed: %ld/%ld\n"),
+                                       shards_packed, shards_full));
+          }
       }
   }
 
@@ -1725,7 +1815,9 @@ subcommand_info(apr_getopt_t *os, void *
     SVN_ERR(svn_fs_info_config_files(&files, fs, pool, pool));
     for (i = 0; i < files->nelts; i++)
       SVN_ERR(svn_cmdline_printf(pool, _("Configuration File: %s\n"),
-                                 APR_ARRAY_IDX(files, i, const char *)));
+                                 svn_dirent_local_style(
+                                   APR_ARRAY_IDX(files, i, const char *),
+                                   pool)));
   }
 
   /* 'svn info' prints an extra newline here, to support multiple targets.
@@ -2175,13 +2267,19 @@ sub_main(int argc, const char *argv[], a
         opt_state.uuid_action = svn_repos_load_uuid_force;
         break;
       case svnadmin__pre_1_4_compatible:
-        opt_state.pre_1_4_compatible = TRUE;
+        opt_state.compatible_version = apr_pcalloc(pool, sizeof(svn_version_t));
+        opt_state.compatible_version->major = 1;
+        opt_state.compatible_version->minor = 3;
         break;
       case svnadmin__pre_1_5_compatible:
-        opt_state.pre_1_5_compatible = TRUE;
+        opt_state.compatible_version = apr_pcalloc(pool, sizeof(svn_version_t));
+        opt_state.compatible_version->major = 1;
+        opt_state.compatible_version->minor = 4;
         break;
       case svnadmin__pre_1_6_compatible:
-        opt_state.pre_1_6_compatible = TRUE;
+        opt_state.compatible_version = apr_pcalloc(pool, sizeof(svn_version_t));
+        opt_state.compatible_version->major = 1;
+        opt_state.compatible_version->minor = 5;
         break;
       case svnadmin__compatible_version:
         {
@@ -2221,6 +2319,9 @@ sub_main(int argc, const char *argv[], a
           opt_state.compatible_version = compatible_version;
         }
         break;
+      case svnadmin__keep_going:
+        opt_state.keep_going = TRUE;
+        break;
       case svnadmin__fs_type:
         SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool));
         break;

Propchange: subversion/branches/cache-server/subversion/svnauth/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 15 08:52:06 2013
@@ -0,0 +1,2 @@
+svnauth
+.libs

Modified: subversion/branches/cache-server/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svndumpfilter/svndumpfilter.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/cache-server/subversion/svndumpfilter/svndumpfilter.c Tue Oct 15 08:52:06 2013
@@ -1146,6 +1146,7 @@ subcommand_help(apr_getopt_t *os, void *
   struct svndumpfilter_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svndumpfilter SUBCOMMAND [ARGS & OPTIONS ...]\n"
+      "Subversion repository dump filtering tool.\n"
       "Type 'svndumpfilter help <subcommand>' for help on a "
       "specific subcommand.\n"
       "Type 'svndumpfilter --version' to see the program version.\n"
@@ -1176,7 +1177,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/branches/cache-server/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnlook/svnlook.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/cache-server/subversion/svnlook/svnlook.c Tue Oct 15 08:52:06 2013
@@ -34,6 +34,7 @@
 #define APR_WANT_STRFUNC
 #include <apr_want.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_cmdline.h"
 #include "svn_types.h"
@@ -47,6 +48,7 @@
 #include "svn_time.h"
 #include "svn_utf.h"
 #include "svn_subst.h"
+#include "svn_sorts.h"
 #include "svn_opt.h"
 #include "svn_props.h"
 #include "svn_diff.h"
@@ -56,8 +58,7 @@
 #include "private/svn_diff_private.h"
 #include "private/svn_cmdline_private.h"
 #include "private/svn_fspath.h"
-
-#include "svn_private_config.h"
+#include "private/svn_io_private.h"
 
 
 /*** Some convenience macros and types. ***/
@@ -395,7 +396,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 
@@ -982,12 +983,21 @@ print_diff_tree(svn_stream_t *out_stream
               SVN_ERR(generate_label(&new_label, root, path, pool));
 
               /* We deal in streams, but svn_io_run_diff2() deals in file
-                 handles, unfortunately, so we need to make these temporary
-                 files, and then copy the contents to our stream. */
-              SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
-                        svn_io_file_del_on_pool_cleanup, pool, pool));
-              SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
-                        svn_io_file_del_on_pool_cleanup, pool, pool));
+                 handles, so we may need to make temporary files and then
+                 copy the contents to our stream. */
+              outfile = svn_stream__aprfile(out_stream);
+              if (outfile)
+                outfilename = NULL;
+              else
+                SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
+                          svn_io_file_del_on_pool_cleanup, pool, pool));
+              SVN_ERR(svn_stream_for_stderr(&err_stream, pool));
+              errfile = svn_stream__aprfile(err_stream);
+              if (errfile)
+                errfilename = NULL;
+              else
+                SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
+                          svn_io_file_del_on_pool_cleanup, pool, pool));
 
               SVN_ERR(svn_io_run_diff2(".",
                                        diff_cmd_argv,
@@ -997,21 +1007,25 @@ print_diff_tree(svn_stream_t *out_stream
                                        &exitcode, outfile, errfile,
                                        c->diff_cmd, pool));
 
-              SVN_ERR(svn_io_file_close(outfile, pool));
-              SVN_ERR(svn_io_file_close(errfile, pool));
-
               /* Now, open and copy our files to our output streams. */
-              SVN_ERR(svn_stream_for_stderr(&err_stream, pool));
-              SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
-                                               pool, pool));
-              SVN_ERR(svn_stream_copy3(stream,
-                                       svn_stream_disown(out_stream, pool),
-                                       NULL, NULL, pool));
-              SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
-                                               pool, pool));
-              SVN_ERR(svn_stream_copy3(stream,
-                                       svn_stream_disown(err_stream, pool),
-                                       NULL, NULL, pool));
+              if (outfilename)
+                {
+                  SVN_ERR(svn_io_file_close(outfile, pool));
+                  SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
+                                                   pool, pool));
+                  SVN_ERR(svn_stream_copy3(stream,
+                                           svn_stream_disown(out_stream, pool),
+                                           NULL, NULL, pool));
+                }
+              if (errfilename)
+                {
+                  SVN_ERR(svn_io_file_close(errfile, pool));
+                  SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
+                                                   pool, pool));
+                  SVN_ERR(svn_stream_copy3(stream,
+                                           svn_stream_disown(err_stream, pool),
+                                           NULL, NULL, pool));
+                }
 
               SVN_ERR(svn_stream_printf_from_utf8(out_stream, encoding, pool,
                                                   "\n"));
@@ -1167,7 +1181,6 @@ print_tree(svn_fs_root_t *root,
 {
   apr_pool_t *subpool;
   apr_hash_t *entries;
-  apr_hash_index_t *hi;
   const char* name;
 
   SVN_ERR(check_cancel(NULL));
@@ -1215,11 +1228,18 @@ print_tree(svn_fs_root_t *root,
   /* Recursively handle the node's children. */
   if (recurse || (indentation == 0))
     {
+      apr_array_header_t *sorted_entries;
+      int i;
+
       SVN_ERR(svn_fs_dir_entries(&entries, root, path, pool));
       subpool = svn_pool_create(pool);
-      for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
-        {
-          svn_fs_dirent_t *entry = svn__apr_hash_index_val(hi);
+      sorted_entries = svn_sort__hash(entries,
+                                      svn_sort_compare_items_lexically, pool);
+      for (i = 0; i < sorted_entries->nelts; i++)
+        {
+          svn_sort__item_t item = APR_ARRAY_IDX(sorted_entries, i,
+                                                svn_sort__item_t);
+          svn_fs_dirent_t *entry = item.value;
 
           svn_pool_clear(subpool);
           SVN_ERR(print_tree(root,
@@ -2192,11 +2212,12 @@ subcommand_help(apr_getopt_t *os, void *
   struct svnlook_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svnlook SUBCOMMAND REPOS_PATH [ARGS & OPTIONS ...]\n"
+      "Subversion repository inspection tool.\n"
+      "Type 'svnlook help <subcommand>' for help on a specific subcommand.\n"
+      "Type 'svnlook --version' to see the program version and FS modules.\n"
       "Note: any subcommand which takes the '--revision' and '--transaction'\n"
       "      options will, if invoked without one of those options, act on\n"
       "      the repository's youngest revision.\n"
-      "Type 'svnlook help <subcommand>' for help on a specific subcommand.\n"
-      "Type 'svnlook --version' to see the program version and FS modules.\n"
       "\n"
       "Available subcommands:\n");
 

Modified: subversion/branches/cache-server/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnmucc/svnmucc.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/cache-server/subversion/svnmucc/svnmucc.c Tue Oct 15 08:52:06 2013
@@ -40,6 +40,7 @@
 
 #include <apr_lib.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_client.h"
 #include "svn_cmdline.h"
@@ -58,8 +59,6 @@
 #include "private/svn_ra_private.h"
 #include "private/svn_string_private.h"
 
-#include "svn_private_config.h"
-
 static void handle_error(svn_error_t *err, apr_pool_t *pool)
 {
   if (err)
@@ -85,7 +84,7 @@ init(const char *application)
   if (svn_cmdline_init(application, stderr))
     exit(EXIT_FAILURE);
 
-  err = svn_ver_check_list(&my_version, checklist);
+  err = svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
   if (err)
     handle_error(err, NULL);
 
@@ -923,8 +922,9 @@ usage(apr_pool_t *pool, int exit_val)
 {
   FILE *stream = exit_val == EXIT_SUCCESS ? stdout : stderr;
   svn_error_clear(svn_cmdline_fputs(
-    _("Subversion multiple URL command client\n"
-      "usage: svnmucc ACTION...\n"
+    _("usage: svnmucc ACTION...\n"
+      "Subversion multiple URL command client.\n"
+      "Type 'svnmucc --version' to see the program version.\n"
       "\n"
       "  Perform one or more Subversion repository URL-based ACTIONs, committing\n"
       "  the result as a (single) new revision.\n"
@@ -952,7 +952,7 @@ usage(apr_pool_t *pool, int exit_val)
       "                               NAME[=VALUE]\n"
       "  --non-interactive      : do no interactive prompting (default is to\n"
       "                           prompt only if standard input is a terminal)\n"
-      "  --force-interactive    : do interactive propmting even if standard\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"
@@ -1145,13 +1145,18 @@ main(int argc, const char **argv)
           break;
         case 'r':
           {
+            const char *saved_arg = arg;
             char *digits_end = NULL;
+            while (*arg == 'r')
+              arg++;
             base_revision = strtol(arg, &digits_end, 10);
             if ((! SVN_IS_VALID_REVNUM(base_revision))
                 || (! digits_end)
                 || *digits_end)
-              handle_error(svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                            NULL, "Invalid revision number"),
+              handle_error(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+                                             NULL,
+                                             _("Invalid revision number '%s'"),
+                                             saved_arg),
                            pool);
           }
           break;
@@ -1429,7 +1434,14 @@ main(int argc, const char **argv)
           if (! anchor)
             anchor = url;
           else
-            anchor = svn_uri_get_longest_ancestor(anchor, url, pool);
+            {
+              anchor = svn_uri_get_longest_ancestor(anchor, url, pool);
+              if (!anchor || !anchor[0])
+                handle_error(svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+                                               "URLs in the action list do not "
+                                               "share a common ancestor"),
+                             pool);
+            }
 
           if ((++i == action_args->nelts) && (j + 1 < num_url_args))
             insufficient(pool);

Modified: subversion/branches/cache-server/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnrdump/dump_editor.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/cache-server/subversion/svnrdump/dump_editor.c Tue Oct 15 08:52:06 2013
@@ -22,6 +22,7 @@
  * ====================================================================
  */
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_repos.h"

Modified: subversion/branches/cache-server/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnrdump/svnrdump.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/cache-server/subversion/svnrdump/svnrdump.c Tue Oct 15 08:52:06 2013
@@ -25,6 +25,7 @@
 #include <apr_signal.h>
 #include <apr_uri.h>
 
+#include "svn_private_config.h"
 #include "svn_pools.h"
 #include "svn_cmdline.h"
 #include "svn_client.h"
@@ -33,7 +34,6 @@
 #include "svn_repos.h"
 #include "svn_path.h"
 #include "svn_utf.h"
-#include "svn_private_config.h"
 #include "svn_string.h"
 #include "svn_props.h"
 
@@ -42,7 +42,6 @@
 #include "private/svn_cmdline_private.h"
 #include "private/svn_ra_private.h"
 
-
 
 /*** Cancellation ***/
 
@@ -667,22 +666,20 @@ version(const char *progname,
 }
 
 
-/* A statement macro, similar to @c SVN_ERR, but returns an integer.
- * Evaluate @a expr. If it yields an error, handle that error and
- * return @c EXIT_FAILURE.
- */
-#define SVNRDUMP_ERR(expr)                                               \
-  do                                                                     \
-    {                                                                    \
-      svn_error_t *svn_err__temp = (expr);                               \
-      if (svn_err__temp)                                                 \
-        {                                                                \
-          svn_handle_error2(svn_err__temp, stderr, FALSE, "svnrdump: "); \
-          svn_error_clear(svn_err__temp);                                \
-          return EXIT_FAILURE;                                           \
-        }                                                                \
-    }                                                                    \
-  while (0)
+/* Report and clear the error ERR, and return EXIT_FAILURE. */
+#define EXIT_ERROR(err)                                                 \
+  svn_cmdline_handle_exit_error(err, NULL, "svnrdump: ")
+
+/* A redefinition of the public SVN_INT_ERR macro, that suppresses the
+ * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR, and with the
+ * program name 'svnrdump' instead of 'svn'. */
+#undef SVN_INT_ERR
+#define SVN_INT_ERR(expr)                                        \
+  do {                                                           \
+    svn_error_t *svn_err__temp = (expr);                         \
+    if (svn_err__temp)                                           \
+      return EXIT_ERROR(svn_err__temp);                          \
+  } while (0)
 
 /* Handle the "dump" subcommand.  Implements `svn_opt_subcommand_t'.  */
 static svn_error_t *
@@ -729,6 +726,7 @@ help_cmd(apr_getopt_t *os,
 {
   const char *header =
     _("general usage: svnrdump SUBCOMMAND URL [-r LOWER[:UPPER]]\n"
+      "Subversion remote repository dump and load tool.\n"
       "Type 'svnrdump help <subcommand>' for help on a specific subcommand.\n"
       "Type 'svnrdump --version' to see the program version and RA modules.\n"
       "\n"
@@ -831,14 +829,13 @@ validate_and_resolve_revisions(opt_baton
   return SVN_NO_ERROR;
 }
 
-int
-main(int argc, const char **argv)
+static int
+sub_main(int argc, const char *argv[], apr_pool_t *pool)
 {
   svn_error_t *err = SVN_NO_ERROR;
   const svn_opt_subcommand_desc2_t *subcommand = NULL;
   opt_baton_t *opt_baton;
   svn_revnum_t latest_revision = SVN_INVALID_REVNUM;
-  apr_pool_t *pool = NULL;
   const char *config_dir = NULL;
   const char *username = NULL;
   const char *password = NULL;
@@ -852,20 +849,12 @@ main(int argc, const char **argv)
   apr_array_header_t *received_opts;
   int i;
 
-  if (svn_cmdline_init ("svnrdump", stderr) != EXIT_SUCCESS)
-    return EXIT_FAILURE;
-
-  /* Create our top-level pool.  Use a separate mutexless allocator,
-   * given this application is single threaded.
-   */
-  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
-
   opt_baton = apr_pcalloc(pool, sizeof(*opt_baton));
   opt_baton->start_revision.kind = svn_opt_revision_unspecified;
   opt_baton->end_revision.kind = svn_opt_revision_unspecified;
   opt_baton->url = NULL;
 
-  SVNRDUMP_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
+  SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
 
   os->interleave = TRUE; /* Options and arguments can be interleaved */
 
@@ -905,8 +894,8 @@ main(int argc, const char **argv)
         break;
       if (status != APR_SUCCESS)
         {
-          SVNRDUMP_ERR(usage(argv[0], pool));
-          exit(EXIT_FAILURE);
+          SVN_INT_ERR(usage(argv[0], pool));
+          return EXIT_FAILURE;
         }
 
       /* Stash the option code in an array before parsing it. */
@@ -923,7 +912,7 @@ main(int argc, const char **argv)
                                        _("Multiple revision arguments "
                                          "encountered; try '-r N:M' instead "
                                          "of '-r N -r M'"));
-                return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
+                return EXIT_ERROR(err);
               }
             /* Parse the -r argument. */
             if (svn_opt_parse_revision(&(opt_baton->start_revision),
@@ -936,7 +925,7 @@ main(int argc, const char **argv)
                   err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                           _("Syntax error in revision "
                                             "argument '%s'"), utf8_opt_arg);
-                return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
+                return EXIT_ERROR(err);
               }
           }
           break;
@@ -953,10 +942,10 @@ main(int argc, const char **argv)
           opt_baton->help = TRUE;
           break;
         case opt_auth_username:
-          SVNRDUMP_ERR(svn_utf_cstring_to_utf8(&username, opt_arg, pool));
+          SVN_INT_ERR(svn_utf_cstring_to_utf8(&username, opt_arg, pool));
           break;
         case opt_auth_password:
-          SVNRDUMP_ERR(svn_utf_cstring_to_utf8(&password, opt_arg, pool));
+          SVN_INT_ERR(svn_utf_cstring_to_utf8(&password, opt_arg, pool));
           break;
         case opt_auth_nocache:
           no_auth_cache = TRUE;
@@ -979,9 +968,9 @@ main(int argc, const char **argv)
                     apr_array_make(pool, 1,
                                    sizeof(svn_cmdline__config_argument_t*));
 
-            SVNRDUMP_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
-            SVNRDUMP_ERR(svn_cmdline__parse_config_option(config_options,
-                                                          opt_arg, pool));
+            SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+            SVN_INT_ERR(svn_cmdline__parse_config_option(config_options,
+                                                         opt_arg, pool));
         }
     }
 
@@ -992,7 +981,7 @@ main(int argc, const char **argv)
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--non-interactive and --force-interactive "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
+      return EXIT_ERROR(err);
     }
 
   if (opt_baton->help)
@@ -1017,9 +1006,8 @@ main(int argc, const char **argv)
 
           else
             {
-              SVNRDUMP_ERR(help_cmd(NULL, NULL, pool));
-              svn_pool_destroy(pool);
-              exit(EXIT_FAILURE);
+              SVN_INT_ERR(help_cmd(NULL, NULL, pool));
+              return EXIT_FAILURE;
             }
         }
       else
@@ -1033,14 +1021,13 @@ main(int argc, const char **argv)
               const char *first_arg_utf8;
               err = svn_utf_cstring_to_utf8(&first_arg_utf8, first_arg, pool);
               if (err)
-                return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
+                return EXIT_ERROR(err);
               svn_error_clear(
                 svn_cmdline_fprintf(stderr, pool,
                                     _("Unknown subcommand: '%s'\n"),
                                     first_arg_utf8));
-              SVNRDUMP_ERR(help_cmd(NULL, NULL, pool));
-              svn_pool_destroy(pool);
-              exit(EXIT_FAILURE);
+              SVN_INT_ERR(help_cmd(NULL, NULL, pool));
+              return EXIT_FAILURE;
             }
         }
     }
@@ -1072,23 +1059,20 @@ main(int argc, const char **argv)
                                 _("Subcommand '%s' doesn't accept option '%s'\n"
                                   "Type 'svnrdump help %s' for usage.\n"),
                                 subcommand->name, optstr, subcommand->name));
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
     }
 
   if (strcmp(subcommand->name, "--version") == 0)
     {
-      SVNRDUMP_ERR(version(argv[0], opt_baton->quiet, pool));
-      svn_pool_destroy(pool);
-      exit(EXIT_SUCCESS);
+      SVN_INT_ERR(version(argv[0], opt_baton->quiet, pool));
+      return EXIT_SUCCESS;
     }
 
   if (strcmp(subcommand->name, "help") == 0)
     {
-      SVNRDUMP_ERR(help_cmd(os, opt_baton, pool));
-      svn_pool_destroy(pool);
-      exit(EXIT_SUCCESS);
+      SVN_INT_ERR(help_cmd(os, opt_baton, pool));
+      return EXIT_SUCCESS;
     }
 
   /* --trust-server-cert can only be used with --non-interactive */
@@ -1097,30 +1081,27 @@ main(int argc, const char **argv)
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--trust-server-cert requires "
                                "--non-interactive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
+      return EXIT_ERROR(err);
     }
 
   /* Expect one more non-option argument:  the repository URL. */
   if (os->ind != os->argc - 1)
     {
-      SVNRDUMP_ERR(usage(argv[0], pool));
-      svn_pool_destroy(pool);
-      exit(EXIT_FAILURE);
+      SVN_INT_ERR(usage(argv[0], pool));
+      return EXIT_FAILURE;
     }
   else
     {
       const char *repos_url;
 
-      SVNRDUMP_ERR(svn_utf_cstring_to_utf8(&repos_url,
-                                           os->argv[os->ind], pool));
+      SVN_INT_ERR(svn_utf_cstring_to_utf8(&repos_url,
+                                          os->argv[os->ind], pool));
       if (! svn_path_is_url(repos_url))
         {
           err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
                                   "Target '%s' is not a URL",
                                   repos_url);
-          SVNRDUMP_ERR(err);
-          svn_pool_destroy(pool);
-          exit(EXIT_FAILURE);
+          return EXIT_ERROR(err);
         }
       opt_baton->url = svn_uri_canonicalize(repos_url, pool);
     }
@@ -1141,16 +1122,16 @@ main(int argc, const char **argv)
   non_interactive = !svn_cmdline__be_interactive(non_interactive,
                                                  force_interactive);
 
-  SVNRDUMP_ERR(init_client_context(&(opt_baton->ctx),
-                                   non_interactive,
-                                   username,
-                                   password,
-                                   config_dir,
-                                   opt_baton->url,
-                                   no_auth_cache,
-                                   trust_server_cert,
-                                   config_options,
-                                   pool));
+  SVN_INT_ERR(init_client_context(&(opt_baton->ctx),
+                                  non_interactive,
+                                  username,
+                                  password,
+                                  config_dir,
+                                  opt_baton->url,
+                                  no_auth_cache,
+                                  trust_server_cert,
+                                  config_options,
+                                  pool));
 
   err = svn_client_open_ra_session2(&(opt_baton->session),
                                     opt_baton->url, NULL,
@@ -1175,11 +1156,31 @@ main(int argc, const char **argv)
                                  _("Authentication failed and interactive"
                                    " prompting is disabled; see the"
                                    " --force-interactive option"));
+      return EXIT_ERROR(err);
     }
+  else if (err)
+    return EXIT_ERROR(err);
+  else
+    return EXIT_SUCCESS;
+}
 
-  SVNRDUMP_ERR(err);
+int
+main(int argc, const char *argv[])
+{
+  apr_pool_t *pool;
+  int exit_code;
 
-  svn_pool_destroy(pool);
+  /* Initialize the app. */
+  if (svn_cmdline_init("svnrdump", stderr) != EXIT_SUCCESS)
+    return EXIT_FAILURE;
 
-  return EXIT_SUCCESS;
+  /* Create our top-level pool.  Use a separate mutexless allocator,
+   * given this application is single threaded.
+   */
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
+
+  exit_code = sub_main(argc, argv, pool);
+
+  svn_pool_destroy(pool);
+  return exit_code;
 }

Modified: subversion/branches/cache-server/subversion/svnrdump/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnrdump/util.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnrdump/util.c (original)
+++ subversion/branches/cache-server/subversion/svnrdump/util.c Tue Oct 15 08:52:06 2013
@@ -21,6 +21,7 @@
  * ====================================================================
  */
 
+#include "svn_private_config.h"
 #include "svn_error.h"
 #include "svn_pools.h"
 #include "svn_string.h"

Modified: subversion/branches/cache-server/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/svnserve/cyrus_auth.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/cache-server/subversion/svnserve/cyrus_auth.c Tue Oct 15 08:52:06 2013
@@ -177,7 +177,7 @@ static svn_error_t *try_auth(svn_ra_svn_
   SVN_ERR(svn_ra_svn__read_tuple(conn, pool, "w(?s)", &mech, &in));
 
   if (strcmp(mech, "EXTERNAL") == 0 && !in)
-    in = svn_string_create(b->tunnel_user, pool);
+    in = svn_string_create(b->client_info->tunnel_user, pool);
   else if (in)
     in = svn_base64_decode_string(in, pool);
 
@@ -246,7 +246,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
   apr_pool_t *subpool;
   apr_status_t apr_err;
   const char *localaddrport = NULL, *remoteaddrport = NULL;
-  const char *mechlist, *val;
+  const char *mechlist;
   char hostname[APRMAXHOSTLEN + 1];
   sasl_security_properties_t secprops;
   svn_boolean_t success, no_anonymous;
@@ -265,7 +265,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
   /* Create a SASL context. SASL_SUCCESS_DATA tells SASL that the protocol
      supports sending data along with the final "success" message. */
   result = sasl_server_new(SVN_RA_SVN_SASL_NAME,
-                           hostname, b->realm,
+                           hostname, b->repository->realm,
                            localaddrport, remoteaddrport,
                            NULL, SASL_SUCCESS_DATA,
                            &sasl_ctx);
@@ -285,21 +285,12 @@ svn_error_t *cyrus_auth_request(svn_ra_s
   svn_ra_svn__default_secprops(&secprops);
 
   /* Don't allow ANONYMOUS if a username is required. */
-  no_anonymous = needs_username || get_access(b, UNAUTHENTICATED) < required;
+  no_anonymous = needs_username || b->repository->anon_access < required;
   if (no_anonymous)
     secprops.security_flags |= SASL_SEC_NOANONYMOUS;
 
-  svn_config_get(b->cfg, &val,
-                 SVN_CONFIG_SECTION_SASL,
-                 SVN_CONFIG_OPTION_MIN_SSF,
-                 "0");
-  SVN_ERR(svn_cstring_atoui(&secprops.min_ssf, val));
-
-  svn_config_get(b->cfg, &val,
-                 SVN_CONFIG_SECTION_SASL,
-                 SVN_CONFIG_OPTION_MAX_SSF,
-                 "256");
-  SVN_ERR(svn_cstring_atoui(&secprops.max_ssf, val));
+  secprops.min_ssf = b->repository->min_ssf;
+  secprops.max_ssf = b->repository->max_ssf;
 
   /* Set security properties. */
   result = sasl_setprop(sasl_ctx, SASL_SEC_PROPS, &secprops);
@@ -307,8 +298,9 @@ svn_error_t *cyrus_auth_request(svn_ra_s
     return fail_cmd(conn, pool, sasl_ctx);
 
   /* SASL needs to know if we are externally authenticated. */
-  if (b->tunnel_user)
-    result = sasl_setprop(sasl_ctx, SASL_AUTH_EXTERNAL, b->tunnel_user);
+  if (b->client_info->tunnel_user)
+    result = sasl_setprop(sasl_ctx, SASL_AUTH_EXTERNAL,
+                          b->client_info->tunnel_user);
   if (result != SASL_OK)
     return fail_cmd(conn, pool, sasl_ctx);
 
@@ -330,7 +322,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
 
   /* Send the list of mechanisms and the realm to the client. */
   SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "(w)c",
-                                         mechlist, b->realm));
+                                         mechlist, b->repository->realm));
 
   /* The main authentication loop. */
   subpool = svn_pool_create(pool);
@@ -358,7 +350,8 @@ svn_error_t *cyrus_auth_request(svn_ra_s
       if ((p = strchr(user, '@')) != NULL)
         {
           /* Drop the realm part. */
-          b->user = apr_pstrndup(b->pool, user, p - (const char *)user);
+          b->client_info->user = apr_pstrndup(b->pool, user,
+                                              p - (const char *)user);
         }
       else
         {