You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/08/11 00:30:20 UTC

svn commit: r1371833 [2/3] - in /subversion/branches/inheritable-props: ./ build/ build/generator/ build/generator/templates/ contrib/client-side/emacs/ contrib/client-side/svn-push/ contrib/client-side/svnmerge/ contrib/hook-scripts/enforcer/ notes/me...

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c Fri Aug 10 22:30:18 2012
@@ -49,6 +49,7 @@
 #include "private/svn_opt_private.h"
 
 #include "opt.h"
+#include "sysinfo.h"
 #include "svn_private_config.h"
 
 
@@ -1105,14 +1106,16 @@ svn_error_t *
 svn_opt__print_version_info(const char *pgm_name,
                             const char *footer,
                             svn_boolean_t quiet,
+                            svn_boolean_t verbose,
                             apr_pool_t *pool)
 {
   if (quiet)
     return svn_cmdline_printf(pool, "%s\n", SVN_VER_NUMBER);
 
   SVN_ERR(svn_cmdline_printf(pool, _("%s, version %s\n"
-                                     "   compiled %s, %s\n\n"), pgm_name,
-                             SVN_VERSION, __DATE__, __TIME__));
+                                     "   compiled %s, %s on %s\n\n"),
+                             pgm_name, SVN_VERSION, __DATE__, __TIME__,
+                             SVN_BUILD_HOST));
   SVN_ERR(svn_cmdline_fputs(
              _("Copyright (C) 2012 The Apache Software Foundation.\n"
                "This software consists of contributions made by many "
@@ -1127,15 +1130,38 @@ svn_opt__print_version_info(const char *
       SVN_ERR(svn_cmdline_printf(pool, "%s\n", footer));
     }
 
+  if (verbose)
+    {
+      const char *const host = svn_sysinfo__canonical_host(pool);
+      const char *const relname = svn_sysinfo__release_name(pool);
+      const char *const dlibs = svn_sysinfo__loaded_libs(pool);
+
+      SVN_ERR(svn_cmdline_fputs(_("System information:\n\n"), stdout, pool));
+      if (relname)
+        SVN_ERR(svn_cmdline_printf(pool, _("* running on %s\n"
+                                           "  - %s\n"),
+                                   host, relname));
+      else
+        SVN_ERR(svn_cmdline_printf(pool, _("* running on %s\n"), host));
+
+      if (dlibs)
+        {
+          SVN_ERR(svn_cmdline_fputs(_("* loaded shared libraries:\n"),
+                                    stdout, pool));
+          SVN_ERR(svn_cmdline_fputs(dlibs, stdout, pool));
+        }
+    }
+
   return SVN_NO_ERROR;
 }
 
 
 svn_error_t *
-svn_opt_print_help3(apr_getopt_t *os,
+svn_opt_print_help4(apr_getopt_t *os,
                     const char *pgm_name,
                     svn_boolean_t print_version,
                     svn_boolean_t quiet,
+                    svn_boolean_t verbose,
                     const char *version_footer,
                     const char *header,
                     const svn_opt_subcommand_desc2_t *cmd_table,
@@ -1161,8 +1187,8 @@ svn_opt_print_help3(apr_getopt_t *os,
         }
     }
   else if (print_version)   /* just --version */
-    SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer, quiet,
-                                        pool));
+    SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
+                                        quiet, verbose, pool));
   else if (os && !targets->nelts)            /* `-h', `--help', or `help' */
     svn_opt_print_generic_help2(header,
                                 cmd_table,

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h Fri Aug 10 22:30:18 2012
@@ -33,7 +33,7 @@ extern "C" {
 /* Print version info for PGM_NAME.  If QUIET is  true, print in
  * brief.  Else if QUIET is not true, print the version more
  * verbosely, and if FOOTER is non-null, print it following the
- * version information.
+ * version information. If VERBOSE is true, print running system info.
  *
  * Use POOL for temporary allocations.
  */
@@ -41,6 +41,7 @@ svn_error_t *
 svn_opt__print_version_info(const char *pgm_name,
                             const char *footer,
                             svn_boolean_t quiet,
+                            svn_boolean_t verbose,
                             apr_pool_t *pool);
 
 #ifdef __cplusplus

Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/node.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/node.c Fri Aug 10 22:30:18 2012
@@ -1379,6 +1379,15 @@ svn_wc__internal_get_origin(svn_boolean_
             return SVN_NO_ERROR; /* Local addition */
           }
 
+        /* We don't know how the following error condition can be fulfilled
+         * but we have seen that happening in the wild.  Better to create
+         * an error than a SEGFAULT. */
+        if (status == svn_wc__db_status_incomplete && !original_repos_relpath)
+          return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                               _("Incomplete copy information on path '%s'."),
+                                   svn_dirent_local_style(local_abspath,
+                                                          scratch_pool));
+
         *repos_relpath = svn_relpath_join(
                                 original_repos_relpath,
                                 svn_dirent_skip_ancestor(op_root_abspath,

Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.c Fri Aug 10 22:30:18 2012
@@ -8801,8 +8801,15 @@ read_url_txn(void *baton,
           else
             {
               /* The parent of the WORKING delete, must be an addition */
-              const char *work_relpath = svn_relpath_dirname(work_del_relpath,
-                                                             scratch_pool);
+              const char *work_relpath = NULL;
+
+              /* work_del_relpath should not be NULL. However, we have
+               * observed instances where that assumption was not met.
+               * Bail out in that case instead of crashing with a segfault.
+               */
+              SVN_ERR_ASSERT(work_del_relpath != NULL);
+              work_relpath = svn_relpath_dirname(work_del_relpath,
+                                                 scratch_pool);
 
               SVN_ERR(scan_addition(NULL, NULL, &repos_relpath, &repos_id,
                                     NULL, NULL, NULL, NULL, NULL, NULL,

Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h Fri Aug 10 22:30:18 2012
@@ -2329,7 +2329,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
    the commit. It will become the BASE node's 'revnum' and 'changed_rev'
    values in the BASE_NODE table.
 
-   CHANGED_REVISION is the the new 'last changed' revision. If the node is
+   CHANGED_REVISION is the new 'last changed' revision. If the node is
    modified its value is equivalent to NEW_REVISION, but in case of a
    decendant of a copy/move it can be an older revision.
 

Modified: subversion/branches/inheritable-props/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/cl.h?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/cl.h (original)
+++ subversion/branches/inheritable-props/subversion/svn/cl.h Fri Aug 10 22:30:18 2012
@@ -203,7 +203,6 @@ typedef struct svn_cl__opt_state_t
   const char *merge_cmd;         /* the external merge command to use */
   const char *editor_cmd;        /* the external editor command to use */
   svn_boolean_t record_only;     /* whether to record mergeinfo */
-  svn_boolean_t symmetric_merge; /* symmetric merge */
   const char *old_target;        /* diff target */
   const char *new_target;        /* diff target */
   svn_boolean_t relocate;        /* rewrite urls (svn switch) */
@@ -588,6 +587,7 @@ svn_cl__merge_file(const char *base_path
                    const char *my_path,
                    const char *merged_path,
                    const char *wc_path,
+                   const char *path_prefix,
                    const char *editor_cmd,
                    apr_hash_t *config,
                    svn_boolean_t *remains_in_conflict,

Modified: subversion/branches/inheritable-props/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/conflict-callbacks.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/conflict-callbacks.c Fri Aug 10 22:30:18 2012
@@ -687,6 +687,7 @@ svn_cl__conflict_handler(svn_wc_conflict
                                              desc->my_abspath,
                                              desc->merged_file,
                                              desc->local_abspath,
+                                             b->path_prefix,
                                              b->editor_cmd,
                                              b->config,
                                              &remains_in_conflict,

Modified: subversion/branches/inheritable-props/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/file-merge.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/file-merge.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/file-merge.c Fri Aug 10 22:30:18 2012
@@ -43,6 +43,10 @@
 #include <sys/ioctl.h>
 #endif
 
+#if APR_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #include <fcntl.h>
 #include <stdlib.h>
 
@@ -309,8 +313,11 @@ get_term_width(void)
   if (fd != -1)
     {
       struct winsize ws;
+      int error;
 
-      if (ioctl(fd, TIOCGWINSZ, &ws) != -1)
+      error = ioctl(fd, TIOCGWINSZ, &ws);
+      close(fd);
+      if (error != -1)
         {
           if (ws.ws_col < 80)
             return 80;
@@ -651,7 +658,7 @@ merge_chunks(apr_array_header_t **merged
       "        (e2) edit your version and use the result,\n"
       "        (eb) edit both versions and use the result,\n"
       "        (p) postpone this conflicting section leaving conflict markers,\n"
-      "        (a) abort entire merge and return to main menu: "));
+      "        (a) abort file merge and return to main menu: "));
 
   /* Now let's see what the user wants to do with this conflict. */
   while (TRUE)
@@ -830,6 +837,7 @@ svn_cl__merge_file(const char *base_path
                    const char *my_path,
                    const char *merged_path,
                    const char *wc_path,
+                   const char *path_prefix,
                    const char *editor_cmd,
                    apr_hash_t *config,
                    svn_boolean_t *remains_in_conflict,
@@ -844,6 +852,13 @@ svn_cl__merge_file(const char *base_path
   const char *merged_file_name;
   struct file_merge_baton fmb;
 
+
+  SVN_ERR(svn_cmdline_printf(
+            scratch_pool, _("Merging '%s'.\n"),
+            svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
+                                                            wc_path),
+                                   scratch_pool)));
+
   SVN_ERR(svn_io_file_open(&original_file, base_path,
                            APR_READ|APR_BUFFERED|APR_BINARY,
                            APR_OS_DEFAULT, scratch_pool));
@@ -881,23 +896,53 @@ svn_cl__merge_file(const char *base_path
   SVN_ERR(svn_io_file_close(latest_file, scratch_pool));
   SVN_ERR(svn_io_file_close(merged_file, scratch_pool));
 
+  /* Start out assuming that conflicts remain. */
   if (remains_in_conflict)
-    *remains_in_conflict = (fmb.remains_in_conflict || fmb.abort_merge);
+    *remains_in_conflict = TRUE;
 
   if (fmb.abort_merge)
     {
       SVN_ERR(svn_io_remove_file2(merged_file_name, TRUE, scratch_pool));
+      SVN_ERR(svn_cmdline_printf(
+                scratch_pool, _("Merge of '%s' aborted.\n"),
+                svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
+                                                                wc_path),
+                                       scratch_pool)));
+                
       return SVN_NO_ERROR;
     }
 
   SVN_ERR_W(svn_io_file_move(merged_file_name, merged_path, scratch_pool),
             apr_psprintf(scratch_pool,
-                         _("Could not write merged result to '%s', "
-                         "saved instead at '%s'.\n"),
-                         svn_dirent_local_style(merged_path,
-                                                scratch_pool),
+                         _("Could not write merged result to '%s', saved "
+                           "instead at '%s'.\n'%s' remains in conflict.\n"),
+                         svn_dirent_local_style(
+                           svn_dirent_skip_ancestor(path_prefix, merged_path),
+                           scratch_pool),
                          svn_dirent_local_style(merged_file_name,
-                                                scratch_pool)));
+                                                scratch_pool),
+                         svn_dirent_local_style(
+                           svn_dirent_skip_ancestor(path_prefix, wc_path),
+                           scratch_pool)));
+
+  /* The merge was not aborted and we could install the merged result. The
+   * file remains in conflict unless all conflicting sections were resolved. */
+  if (remains_in_conflict)
+    *remains_in_conflict = fmb.remains_in_conflict;
 
+  if (fmb.remains_in_conflict)
+    SVN_ERR(svn_cmdline_printf(
+              scratch_pool,
+              _("Merge of '%s' completed (remains in conflict).\n"),
+              svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
+                                                              wc_path),
+                                     scratch_pool)));
+  else
+    SVN_ERR(svn_cmdline_printf(
+              scratch_pool, _("Merge of '%s' completed.\n"),
+              svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
+                                                              wc_path),
+                                     scratch_pool)));
+                
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/inheritable-props/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/help-cmd.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/help-cmd.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/help-cmd.c Fri Aug 10 22:30:18 2012
@@ -79,10 +79,11 @@ svn_cl__help(apr_getopt_t *os,
   version_footer = svn_stringbuf_create(ra_desc_start, pool);
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
-  return svn_opt_print_help3(os,
+  return svn_opt_print_help4(os,
                              "svn",   /* ### erm, derive somehow? */
                              opt_state ? opt_state->version : FALSE,
                              opt_state ? opt_state->quiet : FALSE,
+                             opt_state ? opt_state->verbose : FALSE,
                              version_footer->data,
                              help_header,   /* already gettext()'d */
                              svn_cl__cmd_table,

Modified: subversion/branches/inheritable-props/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/main.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/main.c Fri Aug 10 22:30:18 2012
@@ -129,7 +129,6 @@ typedef enum svn_cl__longopt_t {
   opt_diff,
   opt_allow_mixed_revisions,
   opt_include_externals,
-  opt_symmetric,
   opt_show_inherited_props,
   opt_search,
   opt_isearch,
@@ -315,7 +314,7 @@ const apr_getopt_option_t svn_cl__option
                        "                             "
                        "('merged', 'eligible')")},
   {"reintegrate",   opt_reintegrate, 0,
-                    N_("merge a branch back into its parent branch")},
+                    N_("deprecated")},
   {"strip",         opt_strip, 1,
                     N_("number of leading path components to strip from\n"
                        "                             "
@@ -376,8 +375,6 @@ const apr_getopt_option_t svn_cl__option
                        "recursion. This does not include externals with a\n"
                        "                             "
                        "fixed revision. (See the svn:externals property)")},
-  {"symmetric", opt_symmetric, 0,
-                       N_("Symmetric merge")},
   {"show-inherited-props", opt_show_inherited_props, 0,
                        N_("retrieve target's inherited properties")},
   {"search", opt_search, 1,
@@ -740,22 +737,16 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "          (the 'sync' merge)\n"
 "       2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
 "          (the 'cherry-pick' merge)\n"
-"       3. merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]\n"
-"          (the 'reintegrate' merge)\n"
-"       4. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
+"       3. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
 "          (the '2-URL' merge)\n"
 "\n"
-"  1. This form is called a 'sync' (or 'catch-up') merge:\n"
+"  1. This form, with one source path and no revision range:\n"
 "\n"
 "       svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
 "\n"
-"     A sync merge is used to fetch all the latest changes made on a parent\n"
-"     branch. In other words, the target branch has originally been created\n"
-"     by copying the source branch, and any changes committed on the source\n"
-"     branch since branching are applied to the target branch. This uses\n"
-"     merge tracking to skip all those revisions that have already been\n"
-"     merged, so a sync merge can be repeated periodically to stay up-to-\n"
-"     date with the source branch.\n"
+"     finds all the changes on the source branch that have not already been\n"
+"     merged to the target branch, and merges them. Merge tracking is used\n"
+"     to know which changes have already been merged.\n"
 "\n"
 "     SOURCE specifies the branch from where the changes will be pulled, and\n"
 "     TARGET_WCPATH specifies a working copy of the target branch to which\n"
@@ -771,22 +762,44 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "     used, and the default value of 'REV' is the base revision (usually the\n"
 "     revision last updated to).\n"
 "\n"
-"     TARGET_WCPATH is a working copy path; if omitted, '.' is assumed.\n"
+"     TARGET_WCPATH is a working copy path; if omitted, '.' is assumed. In\n"
+"     normal usage the working copy should be up to date, at a single\n"
+"     revision, with no local modifications and no switched subtrees.\n"
+"\n"
+"       - The 'Feature Branch' Merging Pattern -\n"
+"\n"
+"     In this commonly used pattern of merging, a developer is working on\n"
+"     a feature development branch, committing a series of changes that\n"
+"     implement the feature. The developer periodically merges all the\n"
+"     latest changes from the 'parent' branch (from which the feature branch\n"
+"     is branched off). When the feature development is complete, the\n"
+"     developer integrates the feature back into the parent branch by\n"
+"     merging the other way, into a trunk working copy.\n"
+"\n"
+"         trunk  --+----------o------o-o-------------o--\n"
+"                   \\           \\          \\     /\n"
+"                    \\         merge       merge merge\n"
+"                     \\           \\          \\ /\n"
+"         feature      +--o-o-------o----o-o----o-------\n"
+"\n"
+"     In this pattern, a merge from the parent branch to the feature branch\n"
+"     is known as a 'sync' merge (or 'catch-up' merge), and a merge from the\n"
+"     feature branch to the parent branch may be called a 'reintegrate'\n"
+"     merge. The 'sync' merges are normally low-risk because the parent\n"
+"     branch is considered to be more 'stable' than the feature branch, in\n"
+"     the sense of being less likely to contain incomplete or broken work.\n"
+"     By syncing often, these merges can be kept small, avoiding the need\n"
+"     for a difficult 'big bang' merge at reintegration time.\n"
 "\n"
 "       - Sync Merge Example -\n"
-"\n"
-"     A feature is being developed on a branch called 'feature', which has\n"
-"     originally been a copy of trunk. The feature branch has been regularly\n"
-"     synced with trunk to keep up with the changes made there. The previous\n"
-"     sync merges are not shown on this diagram, and the last of them was\n"
-"     done when HEAD was r100. Currently, HEAD is r200.\n"
-"\n"
-"                feature  +------------------------o-----\n"
-"                        /                         ^\n"
-"                       /            ............  |\n"
-"                      /            .            . /\n"
-"         trunk ------+------------L--------------R------\n"
-"                                r100           r200\n"
+"                                 ............\n"
+"                                .            .\n"
+"         trunk  --+------------L--------------R------\n"
+"                   \\                          \\\n"
+"                    \\                         |\n"
+"                     \\                        v\n"
+"         feature      +------------------------o-----\n"
+"                             r100            r200\n"
 "\n"
 "     Subversion will locate all the changes on 'trunk' that have not yet\n"
 "     been merged into the 'feature' branch. In this case that is a single\n"
@@ -807,6 +820,40 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "     conflicts before you commit the merge.\n"
 "\n"
 "\n"
+"       - Reintegrate Merge Example -\n"
+"\n"
+"     The feature branch was last synced with trunk up to revision X. So the\n"
+"     difference between trunk@X and feature@HEAD contains the complete set\n"
+"     of changes that implement the feature, and no other changes. These\n"
+"     changes are applied to trunk.\n"
+"\n"
+"                    rW                   rX\n"
+"         trunk ------+--------------------L------------------o\n"
+"                      \\                   .                 ^\n"
+"                       \\                   .............   /\n"
+"                        \\                               . /\n"
+"         feature         +--------------------------------R\n"
+"\n"
+"     In the diagram above, L marks the left side (trunk@X) and R marks the\n"
+"     right side (feature@HEAD) of the merge. The difference between the\n"
+"     left and right side is merged into trunk, the target.\n"
+"\n"
+"     To perform the merge, have a clean working copy of trunk and run the\n"
+"     following command in its top-level directory:\n"
+"\n"
+"         svn merge ^/feature\n"
+"\n"
+"     To prevent unnecessary merge conflicts, a reintegrate merge requires\n"
+"     that TARGET_WCPATH is not a mixed-revision working copy, has no local\n"
+"     modifications, and has no switched subtrees.\n"
+"\n"
+"     A reintegrate merge also requires that the source branch is coherently\n"
+"     synced with the target -- in the above example, this means that all\n"
+"     revisions between the branch point W and the last merged revision X\n"
+"     are merged to the feature branch, so that there are no unmerged\n"
+"     revisions in-between.\n"
+"\n"
+"\n"
 "  2. This form is called a 'cherry-pick' merge:\n"
 "\n"
 "       svn merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
@@ -876,66 +923,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "         svn merge -c50,54,60 -r65:68 ^/trunk\n"
 "\n"
 "\n"
-"  3. This form is called a 'reintegrate merge':\n"
-"\n"
-"       svn merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]\n"
-"\n"
-"     In a reintegrate merge, an (e.g. feature) branch is merged back to its\n"
-"     originating branch. In other words, the source branch has originally\n"
-"     been created by copying the target branch, development has concluded\n"
-"     on the source branch and it should now be merged back into the target\n"
-"     branch.\n"
-"     \n"
-"     SOURCE is the URL of a branch to be merged back. If REV is specified,\n"
-"     it is used as the peg revision for SOURCE; if REV is not specified,\n"
-"     the HEAD revision is assumed.\n"
-"\n"
-"     TARGET_WCPATH is a working copy of the branch the changes will be\n"
-"     applied to.\n"
-"\n"
-"       - Reintegrate Merge Example -\n"
-"\n"
-"     A feature has been developed on a branch called 'feature'. The feature\n"
-"     branch started as a copy of trunk@W. Work on the feature has completed\n"
-"     and it should be merged back into the trunk.\n"
-"\n"
-"     The feature branch was last synced with trunk up to revision X. So the\n"
-"     difference between trunk@X and feature@HEAD contains the complete set\n"
-"     of changes that implement the feature, and no other changes. These\n"
-"     changes are applied to trunk.\n"
-"\n"
-"                feature  +--------------------------------R\n"
-"                        /                                . \\\n"
-"                       /                    .............   \\\n"
-"                      /                    .                 v\n"
-"         trunk ------+--------------------L------------------o\n"
-"                    rW                   rX\n"
-"\n"
-"     In the diagram above, L marks the left side (trunk@X) and R marks the\n"
-"     right side (feature@HEAD) of the merge. The difference between the\n"
-"     left and right side is merged into trunk, the target.\n"
-"\n"
-"     To perform the merge, have a clean working copy of trunk and run the\n"
-"     following command in its top-level directory:\n"
-"\n"
-"         svn merge --reintegrate ^/feature\n"
-"\n"
-"     To prevent unnecessary merge conflicts, a reintegrate merge requires\n"
-"     that TARGET_WCPATH is not a mixed-revision working copy, has no local\n"
-"     modifications, and has no switched subtrees.\n"
-"\n"
-"     A reintegrate merge also requires that the source branch is coherently\n"
-"     synced with the target -- in the above example, this means that all\n"
-"     revisions between the branch point W and the last merged revision X\n"
-"     are merged to the feature branch, so that there are no unmerged\n"
-"     revisions in-between.\n"
-"\n"
-"     After the reintegrate merge, the feature branch cannot be synced to\n"
-"     the trunk again without merge conflicts. If further work must be done\n"
-"     on the feature branch, it should be deleted and then re-created.\n"
-"\n"
-"\n"
-"  4. This form is called a '2-URL merge':\n"
+"  3. This form is called a '2-URL merge':\n"
 "\n"
 "       svn merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
 "\n"
@@ -1058,7 +1046,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "  repositories.\n"),
     {'r', 'c', 'N', opt_depth, 'q', opt_force, opt_dry_run, opt_merge_cmd,
      opt_record_only, 'x', opt_ignore_ancestry, opt_accept, opt_reintegrate,
-     opt_allow_mixed_revisions, opt_symmetric} },
+     opt_allow_mixed_revisions} },
 
   { "mergeinfo", svn_cl__mergeinfo, {0}, N_
     ("Display merge-related information.\n"
@@ -1567,8 +1555,8 @@ check_lib_versions(void)
       { "svn_diff",   svn_diff_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 
@@ -1594,14 +1582,28 @@ svn_cl__check_cancel(void *baton)
     return SVN_NO_ERROR;
 }
 
+
 
 /*** Main. ***/
 
-int
-main(int argc, const char *argv[])
+/* Report and clear the error ERR, and return EXIT_FAILURE. */
+#define EXIT_ERROR(err)                                                 \
+  svn_cmdline_handle_exit_error(err, NULL, "svn: ")
+
+/* A redefinition of the public SVN_INT_ERR macro, that suppresses the
+ * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR. */
+#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)
+
+static int
+sub_main(int argc, const char *argv[], apr_pool_t *pool)
 {
   svn_error_t *err;
-  apr_pool_t *pool;
   int opt_id;
   apr_getopt_t *os;
   svn_cl__opt_state_t opt_state = { 0, { 0 } };
@@ -1618,35 +1620,21 @@ main(int argc, const char *argv[])
   svn_boolean_t use_notifier = TRUE;
   apr_hash_t *changelists;
 
-  /* Initialize the app. */
-  if (svn_cmdline_init("svn", 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));
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
-  err = check_lib_versions();
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(check_lib_versions());
 
 #if defined(WIN32) || defined(__CYGWIN__)
   /* Set the working copy administrative directory name. */
   if (getenv("SVN_ASP_DOT_NET_HACK"))
     {
-      err = svn_wc_set_adm_dir("_svn", pool);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      SVN_INT_ERR(svn_wc_set_adm_dir("_svn", pool));
     }
 #endif
 
   /* Initialize the RA library. */
-  err = svn_ra_initialize(pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_ra_initialize(pool));
 
   /* Init our changelists hash. */
   changelists = apr_hash_make(pool);
@@ -1665,14 +1653,11 @@ main(int argc, const char *argv[])
   if (argc <= 1)
     {
       svn_cl__help(NULL, NULL, pool);
-      svn_pool_destroy(pool);
       return EXIT_FAILURE;
     }
 
   /* Else, parse options. */
-  err = svn_cmdline__getopt_init(&os, argc, argv, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
 
   os->interleave = 1;
   while (1)
@@ -1688,7 +1673,6 @@ main(int argc, const char *argv[])
       else if (apr_err)
         {
           svn_cl__help(NULL, NULL, pool);
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
 
@@ -1703,13 +1687,13 @@ main(int argc, const char *argv[])
             {
               err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                      _("Non-numeric limit argument given"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
           if (opt_state.limit <= 0)
             {
               err = svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
                                     _("Argument to --limit must be positive"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
         }
         break;
@@ -1730,7 +1714,7 @@ main(int argc, const char *argv[])
               err = svn_error_create
                 (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                  _("Can't specify -c with --old"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
 
           for (i = 0; i < change_revs->nelts; i++)
@@ -1763,7 +1747,7 @@ main(int argc, const char *argv[])
                                               _("Negative number in range (%s)"
                                                 " not supported with -c"),
                                               change_str);
-                      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                      return EXIT_ERROR(err);
                     }
                   s = end + 1;
                   while (*s == 'r')
@@ -1775,14 +1759,14 @@ main(int argc, const char *argv[])
                   err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                           _("Non-numeric change argument (%s) "
                                             "given to -c"), change_str);
-                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                  return EXIT_ERROR(err);
                 }
 
               if (changeno == 0)
                 {
                   err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                          _("There is no change 0"));
-                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                  return EXIT_ERROR(err);
                 }
 
               if (is_negative)
@@ -1821,13 +1805,12 @@ main(int argc, const char *argv[])
         if (svn_opt_parse_revision_to_range(opt_state.revision_ranges,
                                             opt_arg, pool) != 0)
           {
-            err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-            if (! err)
-              err = svn_error_createf
+            SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+            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, "svn: ");
+            return EXIT_ERROR(err);
           }
         break;
       case 'v':
@@ -1847,12 +1830,9 @@ main(int argc, const char *argv[])
         opt_state.incremental = TRUE;
         break;
       case 'F':
-        err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-        if (! err)
-          err = svn_stringbuf_from_file2(&(opt_state.filedata),
-                                         utf8_opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+        SVN_INT_ERR(svn_stringbuf_from_file2(&(opt_state.filedata),
+                                             utf8_opt_arg, pool));
         dash_F_arg = opt_arg;
         break;
       case opt_targets:
@@ -1863,14 +1843,9 @@ main(int argc, const char *argv[])
              the targets into an array, because otherwise we wouldn't
              know what delimiter to use for svn_cstring_split().  */
 
-          err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-
-          if (! err)
-            err = svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool);
-          if (! err)
-            err = svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool);
-          if (err)
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+          SVN_INT_ERR(svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool));
+          SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
           opt_state.targets = svn_cstring_split(buffer_utf8->data, "\n\r",
                                                 TRUE, pool);
         }
@@ -1896,55 +1871,51 @@ main(int argc, const char *argv[])
       case opt_depth:
         err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
         if (err)
-          return svn_cmdline_handle_exit_error
-            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+          return EXIT_ERROR
+            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                _("Error converting depth "
-                                 "from locale to UTF-8")), pool, "svn: ");
+                                 "from locale to UTF-8")));
         opt_state.depth = svn_depth_from_word(utf8_opt_arg);
         if (opt_state.depth == svn_depth_unknown
             || opt_state.depth == svn_depth_exclude)
           {
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("'%s' is not a valid depth; try "
                                    "'empty', 'files', 'immediates', "
                                    "or 'infinity'"),
-                                 utf8_opt_arg), pool, "svn: ");
+                                 utf8_opt_arg));
           }
         break;
       case opt_set_depth:
         err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
         if (err)
-          return svn_cmdline_handle_exit_error
-            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+          return EXIT_ERROR
+            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                _("Error converting depth "
-                                 "from locale to UTF-8")), pool, "svn: ");
+                                 "from locale to UTF-8")));
         opt_state.set_depth = svn_depth_from_word(utf8_opt_arg);
         /* svn_depth_exclude is okay for --set-depth. */
         if (opt_state.set_depth == svn_depth_unknown)
           {
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("'%s' is not a valid depth; try "
                                    "'exclude', 'empty', 'files', "
                                    "'immediates', or 'infinity'"),
-                                 utf8_opt_arg), pool, "svn: ");
+                                 utf8_opt_arg));
           }
         break;
       case opt_version:
         opt_state.version = TRUE;
         break;
       case opt_auth_username:
-        err = svn_utf_cstring_to_utf8(&opt_state.auth_username,
-                                      opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_username,
+                                            opt_arg, pool));
         break;
       case opt_auth_password:
-        err = svn_utf_cstring_to_utf8(&opt_state.auth_password,
-                                      opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_password,
+                                            opt_arg, pool));
         break;
       case opt_encoding:
         opt_state.encoding = apr_pstrdup(pool, opt_arg);
@@ -1992,9 +1963,8 @@ main(int argc, const char *argv[])
         opt_state.relocate = TRUE;
         break;
       case 'x':
-        err = svn_utf_cstring_to_utf8(&opt_state.extensions, opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.extensions,
+                                            opt_arg, pool));
         break;
       case opt_diff_cmd:
         opt_state.diff.diff_cmd = apr_pstrdup(pool, opt_arg);
@@ -2005,9 +1975,6 @@ main(int argc, const char *argv[])
       case opt_record_only:
         opt_state.record_only = TRUE;
         break;
-      case opt_symmetric:
-        opt_state.symmetric_merge = TRUE;
-        break;
       case opt_editor_cmd:
         opt_state.editor_cmd = apr_pstrdup(pool, opt_arg);
         break;
@@ -2017,7 +1984,7 @@ main(int argc, const char *argv[])
             err = svn_error_create
               (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                _("Can't specify -c with --old"));
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+            return EXIT_ERROR(err);
           }
         opt_state.old_target = apr_pstrdup(pool, opt_arg);
         break;
@@ -2027,9 +1994,7 @@ main(int argc, const char *argv[])
       case opt_config_dir:
         {
           const char *path_utf8;
-          err = svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool);
-          if (err)
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          SVN_INT_ERR(svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool));
           opt_state.config_dir = svn_dirent_internal_style(path_utf8, pool);
         }
         break;
@@ -2039,12 +2004,9 @@ main(int argc, const char *argv[])
                    apr_array_make(pool, 1,
                                   sizeof(svn_cmdline__config_argument_t*));
 
-        err = svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool);
-        if (!err)
-          err = svn_cmdline__parse_config_option(opt_state.config_options,
-                                                 opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+        SVN_INT_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
+                                                     opt_arg, pool));
         break;
       case opt_autoprops:
         opt_state.autoprops = TRUE;
@@ -2058,13 +2020,12 @@ main(int argc, const char *argv[])
           opt_state.native_eol = apr_pstrdup(pool, opt_arg);
         else
           {
-            err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-            if (! err)
-              err = svn_error_createf
+            SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+            err = svn_error_createf
                 (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                  _("Syntax error in native-eol argument '%s'"),
                  utf8_opt_arg);
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+            return EXIT_ERROR(err);
           }
         break;
       case opt_no_unlock:
@@ -2096,9 +2057,8 @@ main(int argc, const char *argv[])
         opt_state.no_revprops = TRUE;
         break;
       case opt_with_revprop:
-        err = svn_opt_parse_revprop(&opt_state.revprop_table, opt_arg, pool);
-        if (err != SVN_NO_ERROR)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_opt_parse_revprop(&opt_state.revprop_table,
+                                          opt_arg, pool));
         break;
       case opt_parents:
         opt_state.parents = TRUE;
@@ -2109,20 +2069,18 @@ main(int argc, const char *argv[])
       case opt_accept:
         opt_state.accept_which = svn_cl__accept_from_word(opt_arg);
         if (opt_state.accept_which == svn_cl__accept_invalid)
-          return svn_cmdline_handle_exit_error
+          return EXIT_ERROR
             (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                _("'%s' is not a valid --accept value"),
-                               opt_arg),
-             pool, "svn: ");
+                               opt_arg));
         break;
       case opt_show_revs:
         opt_state.show_revs = svn_cl__show_revs_from_word(opt_arg);
         if (opt_state.show_revs == svn_cl__show_revs_invalid)
-          return svn_cmdline_handle_exit_error
+          return EXIT_ERROR
             (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                _("'%s' is not a valid --show-revs value"),
-                               opt_arg),
-             pool, "svn: ");
+                               opt_arg));
         break;
       case opt_reintegrate:
         opt_state.reintegrate = TRUE;
@@ -2134,13 +2092,13 @@ main(int argc, const char *argv[])
             {
               err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                       _("Invalid strip count '%s'"), opt_arg);
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
           if (opt_state.strip < 0)
             {
               err = svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
                                      _("Argument to --strip must be positive"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
         }
         break;
@@ -2192,9 +2150,7 @@ main(int argc, const char *argv[])
     }
 
   /* Turn our hash of changelists into an array of unique ones. */
-  err = svn_hash_keys(&(opt_state.changelists), changelists, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_hash_keys(&(opt_state.changelists), changelists, pool));
 
   /* ### This really belongs in libsvn_client.  The trouble is,
      there's no one place there to run it from, no
@@ -2206,9 +2162,7 @@ main(int argc, const char *argv[])
      hand, the alternative is effectively to demand that they call
      svn_config_ensure() instead, so maybe we should have a generic
      init function anyway.  Thoughts?  */
-  err = svn_config_ensure(opt_state.config_dir, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_config_ensure(opt_state.config_dir, pool));
 
   /* If the user asked for help, then the rest of the arguments are
      the names of subcommands to get help on (if any), or else they're
@@ -2230,6 +2184,7 @@ main(int argc, const char *argv[])
                 { "--version", svn_cl__help, {0}, "",
                   {opt_version,    /* must accept its own option */
                    'q',            /* brief output */
+                   'v',            /* verbose output */
                    opt_config_dir  /* all commands accept this */
                   } };
 
@@ -2241,7 +2196,6 @@ main(int argc, const char *argv[])
                 (svn_cmdline_fprintf(stderr, pool,
                                      _("Subcommand argument required\n")));
               svn_cl__help(NULL, NULL, pool);
-              svn_pool_destroy(pool);
               return EXIT_FAILURE;
             }
         }
@@ -2253,15 +2207,13 @@ main(int argc, const char *argv[])
           if (subcommand == NULL)
             {
               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, "svn: ");
+              SVN_INT_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8,
+                                                  first_arg, pool));
               svn_error_clear
                 (svn_cmdline_fprintf(stderr, pool,
                                      _("Unknown command: '%s'\n"),
                                      first_arg_utf8));
               svn_cl__help(NULL, NULL, pool);
-              svn_pool_destroy(pool);
               return EXIT_FAILURE;
             }
         }
@@ -2295,7 +2247,6 @@ main(int argc, const char *argv[])
                (stderr, pool, _("Subcommand '%s' doesn't accept option '%s'\n"
                                 "Type 'svn help %s' for usage.\n"),
                 subcommand->name, optstr, subcommand->name));
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
     }
@@ -2310,7 +2261,7 @@ main(int argc, const char *argv[])
                                  _("Multiple revision arguments "
                                    "encountered; can't specify -c twice, "
                                    "or both -c and -r"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
     }
 
@@ -2321,7 +2272,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--depth and --set-depth are mutually "
                                "exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both --with-all-revprops and
@@ -2331,7 +2282,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--with-all-revprops and --with-no-revprops "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both --with-revprop and
@@ -2341,7 +2292,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--with-revprop and --with-no-revprops "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both -m and -F, when they are
@@ -2354,7 +2305,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--message (-m) and --file (-F) "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* --trust-server-cert can only be used with --non-interactive */
@@ -2363,7 +2314,7 @@ 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, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both --diff-cmd and
@@ -2373,7 +2324,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--diff-cmd and --internal-diff "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Ensure that 'revision_ranges' has at least one item, and make
@@ -2393,8 +2344,7 @@ main(int argc, const char *argv[])
 
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
-  if ((err = svn_client_create_context(&ctx, pool)))
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_client_create_context(&ctx, pool));
   command_baton.ctx = ctx;
 
   /* If we're running a command that could result in a commit, verify
@@ -2441,7 +2391,7 @@ main(int argc, const char *argv[])
                          _("Lock comment file is a versioned file; "
                            "use '--force-log' to override"));
                     }
-                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                  return EXIT_ERROR(err);
                 }
             }
           svn_error_clear(err);
@@ -2469,7 +2419,7 @@ main(int argc, const char *argv[])
                      _("The lock comment is a pathname "
                        "(was -F intended?); use '--force-log' to override"));
                 }
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
         }
     }
@@ -2482,7 +2432,7 @@ main(int argc, const char *argv[])
           err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                                  _("--relocate and --depth are mutually "
                                    "exclusive"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
       if (! descend)
         {
@@ -2490,7 +2440,7 @@ main(int argc, const char *argv[])
                     SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                     _("--relocate and --non-recursive (-N) are mutually "
                       "exclusive"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
     }
 
@@ -2505,7 +2455,7 @@ main(int argc, const char *argv[])
       if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
         {
           err = svn_error_create(SVN_ERR_CLIENT_REVISION_RANGE, NULL, NULL);
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
     }
 
@@ -2545,7 +2495,7 @@ main(int argc, const char *argv[])
           svn_error_clear(err);
         }
       else
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        return EXIT_ERROR(err);
     }
 
   cfg_config = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
@@ -2578,38 +2528,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                              _("--auto-props and --no-auto-props are "
                                "mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-    }
-
-  /* The --reintegrate option is mutually exclusive with both
-     --ignore-ancestry and --record-only. */
-  if (opt_state.reintegrate)
-    {
-      if (opt_state.ignore_ancestry)
-        {
-          if (opt_state.record_only)
-            {
-              err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                     _("--reintegrate cannot be used with "
-                                       "--ignore-ancestry or "
-                                       "--record-only"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-            }
-          else
-            {
-              err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                     _("--reintegrate cannot be used with "
-                                       "--ignore-ancestry"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-            }
-          }
-      else if (opt_state.record_only)
-        {
-          err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                 _("--reintegrate cannot be used with "
-                                   "--record-only"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-        }
+      return EXIT_ERROR(err);
     }
 
   /* Update auto-props-enable option, and populate the MIME types map,
@@ -2623,9 +2542,8 @@ main(int argc, const char *argv[])
                      SVN_CONFIG_OPTION_MIMETYPES_FILE, FALSE);
       if (mimetypes_file && *mimetypes_file)
         {
-          if ((err = svn_io_parse_mimetypes_file(&(ctx->mimetypes_map),
-                                                 mimetypes_file, pool)))
-            svn_handle_error2(err, stderr, TRUE, "svn: ");
+          SVN_INT_ERR(svn_io_parse_mimetypes_file(&(ctx->mimetypes_map),
+                                                  mimetypes_file, pool));
         }
 
       if (opt_state.autoprops)
@@ -2663,9 +2581,8 @@ main(int argc, const char *argv[])
     use_notifier = FALSE;
   if (use_notifier)
     {
-      err = svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2, pool);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      SVN_INT_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
+                                       pool));
     }
 
   /* Set up our cancellation support. */
@@ -2695,28 +2612,26 @@ main(int argc, const char *argv[])
 #endif
 
   /* Set up Authentication stuff. */
-  if ((err = svn_cmdline_create_auth_baton(&ab,
-                                           opt_state.non_interactive,
-                                           opt_state.auth_username,
-                                           opt_state.auth_password,
-                                           opt_state.config_dir,
-                                           opt_state.no_auth_cache,
-                                           opt_state.trust_server_cert,
-                                           cfg_config,
-                                           ctx->cancel_func,
-                                           ctx->cancel_baton,
-                                           pool)))
-    svn_handle_error2(err, stderr, TRUE, "svn: ");
+  SVN_INT_ERR(svn_cmdline_create_auth_baton(&ab,
+                                            opt_state.non_interactive,
+                                            opt_state.auth_username,
+                                            opt_state.auth_password,
+                                            opt_state.config_dir,
+                                            opt_state.no_auth_cache,
+                                            opt_state.trust_server_cert,
+                                            cfg_config,
+                                            ctx->cancel_func,
+                                            ctx->cancel_baton,
+                                            pool));
 
   ctx->auth_baton = ab;
 
   /* Set up conflict resolution callback. */
-  if ((err = svn_config_get_bool(cfg_config, &interactive_conflicts,
-                                 SVN_CONFIG_SECTION_MISCELLANY,
-                                 SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS,
-                                 TRUE)))  /* ### interactivity on by default.
-                                                 we can change this. */
-    svn_handle_error2(err, stderr, TRUE, "svn: ");
+  SVN_INT_ERR(svn_config_get_bool(cfg_config, &interactive_conflicts,
+                                  SVN_CONFIG_SECTION_MISCELLANY,
+                                  SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS,
+                                  TRUE));  /* ### interactivity on by default.
+                                                  we can change this. */
 
   /* The new svn behavior is to postpone everything until after the operation
      completed */
@@ -2745,18 +2660,16 @@ main(int argc, const char *argv[])
       if (opt_state.non_interactive)
         {
           if (opt_state.accept_which == svn_cl__accept_edit)
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("--accept=%s incompatible with"
-                                   " --non-interactive"), SVN_CL__ACCEPT_EDIT),
-               pool, "svn: ");
+                                   " --non-interactive"), SVN_CL__ACCEPT_EDIT));
           if (opt_state.accept_which == svn_cl__accept_launch)
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("--accept=%s incompatible with"
                                    " --non-interactive"),
-                                 SVN_CL__ACCEPT_LAUNCH),
-               pool, "svn: ");
+                                 SVN_CL__ACCEPT_LAUNCH));
         }
 
       opt_state.conflict_func = svn_cl__conflict_handler;
@@ -2798,29 +2711,35 @@ main(int argc, const char *argv[])
                          "(type 'svn help cleanup' for details)"));
         }
 
-      /* Issue #3014:
-       * Don't print anything on broken pipes. The pipe was likely
-       * closed by the process at the other end. We expect that
-       * process to perform error reporting as necessary.
-       *
-       * ### This assumes that there is only one error in a chain for
-       * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */
-      if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR)
-        svn_handle_error2(err, stderr, FALSE, "svn: ");
-
-      svn_error_clear(err);
-      svn_pool_destroy(pool);
-      return EXIT_FAILURE;
+      return EXIT_ERROR(err);
     }
   else
     {
       /* Ensure that stdout is flushed, so the user will see any write errors.
          This makes sure that output is not silently lost. */
-      err = svn_cmdline_fflush(stdout);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      SVN_INT_ERR(svn_cmdline_fflush(stdout));
 
-      svn_pool_destroy(pool);
       return EXIT_SUCCESS;
     }
 }
+
+int
+main(int argc, const char *argv[])
+{
+  apr_pool_t *pool;
+  int exit_code;
+
+  /* Initialize the app. */
+  if (svn_cmdline_init("svn", 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));
+
+  exit_code = sub_main(argc, argv, pool);
+
+  svn_pool_destroy(pool);
+  return exit_code;
+}

Modified: subversion/branches/inheritable-props/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/merge-cmd.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/merge-cmd.c Fri Aug 10 22:30:18 2012
@@ -104,14 +104,12 @@ ensure_wc_path_has_repo_revision(const c
   return SVN_NO_ERROR;
 }
 
-#ifdef SVN_WITH_SYMMETRIC_MERGE
 /* Symmetric, merge-tracking merge, used for sync or reintegrate purposes. */
 static svn_error_t *
 symmetric_merge(const char *source_path_or_url,
                 const svn_opt_revision_t *source_revision,
                 const char *target_wcpath,
                 svn_depth_t depth,
-                svn_boolean_t ignore_ancestry,
                 svn_boolean_t force,
                 svn_boolean_t record_only,
                 svn_boolean_t dry_run,
@@ -123,6 +121,7 @@ symmetric_merge(const char *source_path_
                 apr_pool_t *scratch_pool)
 {
   svn_client__symmetric_merge_t *merge;
+  svn_boolean_t reintegrate_like;
 
   /* Find the 3-way merges needed (and check suitability of the WC). */
   SVN_ERR(svn_client__find_symmetric_merge(&merge,
@@ -131,15 +130,43 @@ symmetric_merge(const char *source_path_
                                            allow_local_mods, allow_switched_subtrees,
                                            ctx, scratch_pool, scratch_pool));
 
+  reintegrate_like = (merge->mid != NULL);
+
+  if (reintegrate_like)
+    {
+      if (record_only)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --record-only option "
+                                  "cannot be used with this kind of merge"));
+
+      if (depth != svn_depth_unknown)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --depth option "
+                                  "cannot be used with this kind of merge"));
+
+      if (force)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --force option "
+                                  "cannot be used with this kind of merge"));
+
+      if (allow_mixed_rev)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --allow-mixed-revisions option "
+                                  "cannot be used with this kind of merge"));
+    }
+
   /* Perform the 3-way merges */
   SVN_ERR(svn_client__do_symmetric_merge(merge, target_wcpath, depth,
-                                         ignore_ancestry, force, record_only,
+                                         force, record_only,
                                          dry_run, merge_options,
                                          ctx, scratch_pool));
 
   return SVN_NO_ERROR;
 }
-#endif
 
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
@@ -371,6 +398,16 @@ svn_cl__merge(apr_getopt_t *os,
   /* More input validation. */
   if (opt_state->reintegrate)
     {
+      if (opt_state->ignore_ancestry)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--reintegrate cannot be used with "
+                                  "--ignore-ancestry"));
+
+      if (opt_state->record_only)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--reintegrate cannot be used with "
+                                  "--record-only"));
+
       if (opt_state->depth != svn_depth_unknown)
         return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                                 _("--depth cannot be used with "
@@ -394,20 +431,13 @@ svn_cl__merge(apr_getopt_t *os,
   /* Postpone conflict resolution during the merge operation.
    * If any conflicts occur we'll run the conflict resolver later. */
 
-#ifdef SVN_WITH_SYMMETRIC_MERGE
-  if (opt_state->symmetric_merge)
+  /* Do a symmetric merge if just one source and no revisions. */
+  if ((! two_sources_specified)
+      && (! opt_state->reintegrate)
+      && (! opt_state->ignore_ancestry)
+      && first_range_start.kind == svn_opt_revision_unspecified
+      && first_range_end.kind == svn_opt_revision_unspecified)
     {
-      svn_boolean_t allow_local_mods = ! opt_state->reintegrate;
-      svn_boolean_t allow_switched_subtrees = ! opt_state->reintegrate;
-
-      if (two_sources_specified)
-        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                _("SOURCE2 can't be used with --symmetric"));
-      if (first_range_start.kind != svn_opt_revision_unspecified
-          || first_range_end.kind != svn_opt_revision_unspecified)
-        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                _("a revision range can't be used with --symmetric"));
-
       SVN_ERR_W(svn_cl__check_related_source_and_target(
                   sourcepath1, &peg_revision1, targetpath, &unspecified,
                   ctx, pool),
@@ -415,18 +445,15 @@ svn_cl__merge(apr_getopt_t *os,
 
       merge_err = symmetric_merge(sourcepath1, &peg_revision1, targetpath,
                                   opt_state->depth,
-                                  opt_state->ignore_ancestry,
                                   opt_state->force,
                                   opt_state->record_only,
                                   opt_state->dry_run,
                                   opt_state->allow_mixed_rev,
-                                  allow_local_mods,
-                                  allow_switched_subtrees,
+                                  TRUE /*allow_local_mods*/,
+                                  TRUE /*allow_switched_subtrees*/,
                                   options, ctx, pool);
     }
-  else
-#endif
-  if (opt_state->reintegrate)
+  else if (opt_state->reintegrate)
     {
       SVN_ERR_W(svn_cl__check_related_source_and_target(
                   sourcepath1, &peg_revision1, targetpath, &unspecified,

Modified: subversion/branches/inheritable-props/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn_private_config.hw?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn_private_config.hw (original)
+++ subversion/branches/inheritable-props/subversion/svn_private_config.hw Fri Aug 10 22:30:18 2012
@@ -29,6 +29,10 @@
 #ifndef SVN_PRIVATE_CONFIG_HW
 #define SVN_PRIVATE_CONFIG_HW
 
+
+/* Define to a Windows-specific equivalent of config.guess output */
+#define SVN_BUILD_HOST "x86-microsoft-windows"
+
 /* The minimal version of Berkeley DB we want */
 #define SVN_FS_WANT_DB_MAJOR    4
 #define SVN_FS_WANT_DB_MINOR    0

Modified: subversion/branches/inheritable-props/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnadmin/main.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnadmin/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svnadmin/main.c Fri Aug 10 22:30:18 2012
@@ -136,8 +136,8 @@ check_lib_versions(void)
       { "svn_delta", svn_delta_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 
@@ -593,6 +593,21 @@ parse_args(apr_array_header_t **args,
   return SVN_NO_ERROR;
 }
 
+
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
+subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+  struct svnadmin_opt_state *opt_state = baton;
+  svn_repos_t *repos;
+
+  SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+  SVN_ERR_MALFUNCTION();
+
+  /* merely silence a compiler warning (this will never be executed) */
+  return SVN_NO_ERROR;
+}
+
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
 subcommand_create(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -975,9 +990,10 @@ subcommand_help(apr_getopt_t *os, void *
   version_footer = svn_stringbuf_create(fs_desc_start, pool);
   SVN_ERR(svn_fs_print_modules(version_footer, pool));
 
-  SVN_ERR(svn_opt_print_help3(os, "svnadmin",
+  SVN_ERR(svn_opt_print_help4(os, "svnadmin",
                               opt_state ? opt_state->version : FALSE,
                               opt_state ? opt_state->quiet : FALSE,
+                              /*###opt_state ? opt_state->verbose :*/ FALSE,
                               version_footer->data,
                               header, cmd_table, options_table, NULL, NULL,
                               pool));
@@ -1775,12 +1791,26 @@ subcommand_upgrade(apr_getopt_t *os, voi
 
 /** Main. **/
 
-int
-main(int argc, const char *argv[])
+/* Report and clear the error ERR, and return EXIT_FAILURE. */
+#define EXIT_ERROR(err)                                                 \
+  svn_cmdline_handle_exit_error(err, NULL, "svnadmin: ")
+
+/* A redefinition of the public SVN_INT_ERR macro, that suppresses the
+ * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR, amd with the
+ * program name 'svnadmin' 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)
+
+static int
+sub_main(int argc, const char *argv[], apr_pool_t *pool)
 {
   svn_error_t *err;
   apr_status_t apr_err;
-  apr_pool_t *pool;
 
   const svn_opt_subcommand_desc2_t *subcommand = NULL;
   struct svnadmin_opt_state opt_state = { 0 };
@@ -1789,31 +1819,17 @@ main(int argc, const char *argv[])
   apr_array_header_t *received_opts;
   int i;
 
-  /* Initialize the app. */
-  if (svn_cmdline_init("svnadmin", 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));
-
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
-  err = check_lib_versions();
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+  SVN_INT_ERR(check_lib_versions());
 
   /* Initialize the FS library. */
-  err = svn_fs_initialize(pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+  SVN_INT_ERR(svn_fs_initialize(pool));
 
   if (argc <= 1)
     {
       SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
-      svn_pool_destroy(pool);
       return EXIT_FAILURE;
     }
 
@@ -1823,9 +1839,7 @@ main(int argc, const char *argv[])
   opt_state.memory_cache_size = svn_cache_config_get()->cache_size;
 
   /* Parse options. */
-  err = svn_cmdline__getopt_init(&os, argc, argv, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+  SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
 
   os->interleave = 1;
 
@@ -1841,7 +1855,6 @@ main(int argc, const char *argv[])
       else if (apr_err)
         {
           SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
 
@@ -1856,7 +1869,7 @@ main(int argc, const char *argv[])
               err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                  _("Multiple revision arguments encountered; "
                    "try '-r N:M' instead of '-r N -r M'"));
-              return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+              return EXIT_ERROR(err);
             }
           if (svn_opt_parse_revision(&(opt_state.start_revision),
                                      &(opt_state.end_revision),
@@ -1869,7 +1882,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, "svnadmin: ");
+              return EXIT_ERROR(err);
             }
         }
         break;
@@ -1912,15 +1925,11 @@ main(int argc, const char *argv[])
         opt_state.pre_1_8_compatible = TRUE;
         break;
       case svnadmin__fs_type:
-        err = svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool));
         break;
       case svnadmin__parent_dir:
-        err = svn_utf_cstring_to_utf8(&opt_state.parent_dir, opt_arg,
-                                      pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.parent_dir, opt_arg,
+                                            pool));
         opt_state.parent_dir
           = svn_dirent_internal_style(opt_state.parent_dir, pool);
         break;
@@ -1952,9 +1961,7 @@ main(int argc, const char *argv[])
         opt_state.clean_logs = TRUE;
         break;
       case svnadmin__config_dir:
-        err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
         opt_state.config_dir =
             apr_pstrdup(pool, svn_dirent_canonicalize(utf8_opt_arg, pool));
         break;
@@ -1964,7 +1971,6 @@ main(int argc, const char *argv[])
       default:
         {
           SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
       }  /* close `switch' */
@@ -1999,7 +2005,6 @@ main(int argc, const char *argv[])
               svn_error_clear(svn_cmdline_fprintf(stderr, pool,
                                         _("subcommand argument required\n")));
               SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
-              svn_pool_destroy(pool);
               return EXIT_FAILURE;
             }
         }
@@ -2010,14 +2015,12 @@ main(int argc, const char *argv[])
           if (subcommand == NULL)
             {
               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, "svnadmin: ");
+              SVN_INT_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8,
+                                                  first_arg, pool));
               svn_error_clear(svn_cmdline_fprintf(stderr, pool,
                                                   _("Unknown command: '%s'\n"),
                                                   first_arg_utf8));
               SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
-              svn_pool_destroy(pool);
               return EXIT_FAILURE;
             }
         }
@@ -2033,13 +2036,13 @@ main(int argc, const char *argv[])
         {
           err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("Repository argument required"));
-          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+          return EXIT_ERROR(err);
         }
 
       if ((err = svn_utf_cstring_to_utf8(&repos_path,
                                          os->argv[os->ind++], pool)))
         {
-          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+          return EXIT_ERROR(err);
         }
 
       if (svn_path_is_url(repos_path))
@@ -2047,7 +2050,7 @@ main(int argc, const char *argv[])
           err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                   _("'%s' is a URL when it should be a "
                                     "local path"), repos_path);
-          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+          return EXIT_ERROR(err);
         }
 
       opt_state.repository_path = svn_dirent_internal_style(repos_path, pool);
@@ -2079,7 +2082,6 @@ main(int argc, const char *argv[])
                             , _("Subcommand '%s' doesn't accept option '%s'\n"
                                 "Type 'svnadmin help %s' for usage.\n"),
                 subcommand->name, optstr, subcommand->name));
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
     }
@@ -2122,43 +2124,38 @@ main(int argc, const char *argv[])
           err = svn_error_quick_wrap(err,
                                      _("Try 'svnadmin help' for more info"));
         }
-      return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+      return EXIT_ERROR(err);
     }
   else
     {
-      svn_pool_destroy(pool);
       /* Ensure that everything is written to stdout, so the user will
          see any print errors. */
       err = svn_cmdline_fflush(stdout);
       if (err)
         {
-          /* Issue #3014:
-           * Don't print anything on broken pipes. The pipe was likely
-           * closed by the process at the other end. We expect that
-           * process to perform error reporting as necessary.
-           *
-           * ### This assumes that there is only one error in a chain for
-           * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */
-          if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR)
-            svn_handle_error2(err, stderr, FALSE, "svnadmin: ");
-          svn_error_clear(err);
-          return EXIT_FAILURE;
+          return EXIT_ERROR(err);
         }
       return EXIT_SUCCESS;
     }
 }
 
-
-/* This implements `svn_opt_subcommand_t'. */
-static svn_error_t *
-subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+int
+main(int argc, const char *argv[])
 {
-  struct svnadmin_opt_state *opt_state = baton;
-  svn_repos_t *repos;
+  apr_pool_t *pool;
+  int exit_code;
 
-  SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
-  SVN_ERR_MALFUNCTION();
+  /* Initialize the app. */
+  if (svn_cmdline_init("svnadmin", stderr) != EXIT_SUCCESS)
+    return EXIT_FAILURE;
 
-  /* merely silence a compiler warning (this will never be executed) */
-  return SVN_NO_ERROR;
+  /* 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/inheritable-props/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svndumpfilter/main.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svndumpfilter/main.c Fri Aug 10 22:30:18 2012
@@ -1135,11 +1135,12 @@ subcommand_help(apr_getopt_t *os, void *
       "\n"
       "Available subcommands:\n");
 
-  SVN_ERR(svn_opt_print_help3(os, "svndumpfilter",
+  SVN_ERR(svn_opt_print_help4(os, "svndumpfilter",
                               opt_state ? opt_state->version : FALSE,
-                              opt_state ? opt_state->quiet : FALSE, NULL,
-                              header, cmd_table, options_table, NULL,
-                              NULL, pool));
+                              opt_state ? opt_state->quiet : FALSE,
+                              /*###opt_state ? opt_state->verbose :*/ FALSE,
+                              NULL, header, cmd_table, options_table,
+                              NULL, NULL, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1156,8 +1157,8 @@ check_lib_versions(void)
       { "svn_delta", svn_delta_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 

Modified: subversion/branches/inheritable-props/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnlook/main.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnlook/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svnlook/main.c Fri Aug 10 22:30:18 2012
@@ -380,8 +380,8 @@ check_lib_versions(void)
       { "svn_diff",  svn_diff_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 
@@ -2049,9 +2049,10 @@ subcommand_help(apr_getopt_t *os, void *
   version_footer = svn_stringbuf_create(fs_desc_start, pool);
   SVN_ERR(svn_fs_print_modules(version_footer, pool));
 
-  SVN_ERR(svn_opt_print_help3(os, "svnlook",
+  SVN_ERR(svn_opt_print_help4(os, "svnlook",
                               opt_state ? opt_state->version : FALSE,
                               opt_state ? opt_state->quiet : FALSE,
+                              opt_state ? opt_state->verbose : FALSE,
                               version_footer->data,
                               header, cmd_table, options_table, NULL,
                               NULL, pool));
@@ -2447,7 +2448,7 @@ main(int argc, const char *argv[])
               static const svn_opt_subcommand_desc2_t pseudo_cmd =
                 { "--version", subcommand_help, {0}, "",
                   {svnlook__version,  /* must accept its own option */
-                   'q',
+                   'q', 'v',
                   } };
 
               subcommand = &pseudo_cmd;

Modified: subversion/branches/inheritable-props/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnmucc/svnmucc.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/inheritable-props/subversion/svnmucc/svnmucc.c Fri Aug 10 22:30:18 2012
@@ -76,7 +76,6 @@ init(const char *application)
     {"svn_ra", svn_ra_version},
     {NULL, NULL}
   };
-
   SVN_VERSION_DEFINE(my_version);
 
   if (svn_cmdline_init(application, stderr))
@@ -941,7 +940,8 @@ display_version(apr_getopt_t *os, apr_po
   version_footer = svn_stringbuf_create(ra_desc_start, pool);
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
-  SVN_ERR(svn_opt_print_help3(os, "svnmucc", TRUE, FALSE, version_footer->data,
+  SVN_ERR(svn_opt_print_help4(os, "svnmucc", TRUE, FALSE, FALSE,
+                              version_footer->data,
                               NULL, NULL, NULL, NULL, NULL, pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/inheritable-props/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnrdump/svnrdump.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/inheritable-props/subversion/svnrdump/svnrdump.c Fri Aug 10 22:30:18 2012
@@ -505,8 +505,8 @@ version(const char *progname,
                          pool);
 
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
-  return svn_opt_print_help3(NULL, ensure_appname(progname, pool),
-                             TRUE, quiet, version_footer->data,
+  return svn_opt_print_help4(NULL, ensure_appname(progname, pool),
+                             TRUE, quiet, FALSE, version_footer->data,
                              NULL, NULL, NULL, NULL, NULL, pool);
 }
 
@@ -579,9 +579,9 @@ help_cmd(apr_getopt_t *os,
       "\n"
       "Available subcommands:\n");
 
-  return svn_opt_print_help3(os, "svnrdump", FALSE, FALSE, NULL, header,
-                             svnrdump__cmd_table, svnrdump__options, NULL,
-                             NULL, pool);
+  return svn_opt_print_help4(os, "svnrdump", FALSE, FALSE, FALSE, NULL,
+                             header, svnrdump__cmd_table, svnrdump__options,
+                             NULL, NULL, pool);
 }
 
 /* Examine the OPT_BATON's 'start_revision' and 'end_revision'

Modified: subversion/branches/inheritable-props/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnserve/main.c?rev=1371833&r1=1371832&r2=1371833&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnserve/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svnserve/main.c Fri Aug 10 22:30:18 2012
@@ -327,7 +327,8 @@ static svn_error_t * version(svn_boolean
                            _("\nCyrus SASL authentication is available.\n"));
 #endif
 
-  return svn_opt_print_help3(NULL, "svnserve", TRUE, quiet, version_footer->data,
+  return svn_opt_print_help4(NULL, "svnserve", TRUE, quiet, FALSE,
+                             version_footer->data,
                              NULL, NULL, NULL, NULL, NULL, pool);
 }
 
@@ -411,8 +412,8 @@ check_lib_versions(void)
       { "svn_ra_svn", svn_ra_svn_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }