You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/10/21 04:00:47 UTC

svn commit: r1400556 [25/29] - in /subversion/branches/ev2-export: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/hudson/ contrib/client-side/emacs/ contrib/client-side/svn-push/ contrib/client-side/svnmerge/ contrib/hook-...

Modified: subversion/branches/ev2-export/subversion/svn/move-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/move-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/move-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/move-cmd.c Sun Oct 21 02:00:31 2012
@@ -84,8 +84,10 @@ svn_cl__move(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
 
-  err = svn_client_move6(targets, dst_path,
-                         TRUE, opt_state->parents, opt_state->revprop_table,
+  err = svn_client_move7(targets, dst_path,
+                         TRUE, opt_state->parents,
+                         opt_state->allow_mixed_rev,
+                         opt_state->revprop_table,
                          (opt_state->quiet ? NULL : svn_cl__print_commit_info),
                          NULL, ctx, pool);
 

Modified: subversion/branches/ev2-export/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/notify.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/notify.c (original)
+++ subversion/branches/ev2-export/subversion/svn/notify.c Sun Oct 21 02:00:31 2012
@@ -58,7 +58,6 @@ struct notify_baton
   unsigned int prop_conflicts;
   unsigned int tree_conflicts;
   unsigned int skipped_paths;
-  apr_hash_t *conflicted_paths;
 
   /* The cwd, for use in decomposing absolute paths. */
   const char *path_prefix;
@@ -102,16 +101,6 @@ svn_cl__print_conflict_stats(void *notif
   return SVN_NO_ERROR;
 }
 
-/* Add a conflicted path to the list of conflicted paths stored
- * in the notify baton. */
-static void
-add_conflicted_path(struct notify_baton *nb, const char *path)
-{
-  apr_hash_set(nb->conflicted_paths,
-               apr_pstrdup(apr_hash_pool_get(nb->conflicted_paths), path),
-               APR_HASH_KEY_STRING, "");
-}
-
 /* This implements `svn_wc_notify_func2_t'.
  * NOTE: This function can't fail, so we just ignore any print errors. */
 static void
@@ -214,6 +203,12 @@ notify(void *baton, const svn_wc_notify_
         }
       break;
 
+    case svn_wc_notify_left_local_modifications:
+      if ((err = svn_cmdline_printf(pool, "Left local modifications as '%s'\n",
+                                        path_local)))
+        goto print_error;
+      break;
+
     case svn_wc_notify_update_replace:
       nb->received_some_change = TRUE;
       if ((err = svn_cmdline_printf(pool, "R    %s\n", path_local)))
@@ -225,7 +220,6 @@ notify(void *baton, const svn_wc_notify_
       if (n->content_state == svn_wc_notify_state_conflicted)
         {
           nb->text_conflicts++;
-          add_conflicted_path(nb, n->path);
           if ((err = svn_cmdline_printf(pool, "C    %s\n", path_local)))
             goto print_error;
         }
@@ -241,7 +235,6 @@ notify(void *baton, const svn_wc_notify_
       if (n->content_state == svn_wc_notify_state_conflicted)
         {
           nb->text_conflicts++;
-          add_conflicted_path(nb, n->path);
           statchar_buf[0] = 'C';
         }
       else
@@ -250,7 +243,6 @@ notify(void *baton, const svn_wc_notify_
       if (n->prop_state == svn_wc_notify_state_conflicted)
         {
           nb->prop_conflicts++;
-          add_conflicted_path(nb, n->path);
           statchar_buf[1] = 'C';
         }
       else if (n->prop_state == svn_wc_notify_state_merged)
@@ -317,7 +309,6 @@ notify(void *baton, const svn_wc_notify_
         if (n->content_state == svn_wc_notify_state_conflicted)
           {
             nb->text_conflicts++;
-            add_conflicted_path(nb, n->path);
             statchar_buf[0] = 'C';
           }
         else if (n->kind == svn_node_file)
@@ -331,7 +322,6 @@ notify(void *baton, const svn_wc_notify_
         if (n->prop_state == svn_wc_notify_state_conflicted)
           {
             nb->prop_conflicts++;
-            add_conflicted_path(nb, n->path);
             statchar_buf[1] = 'C';
           }
         else if (n->prop_state == svn_wc_notify_state_changed)
@@ -525,7 +515,6 @@ notify(void *baton, const svn_wc_notify_
         if (n->content_state == svn_wc_notify_state_conflicted)
           {
             nb->text_conflicts++;
-            add_conflicted_path(nb, n->path);
             statchar_buf[0] = 'C';
           }
         else if (n->kind == svn_node_file)
@@ -539,7 +528,6 @@ notify(void *baton, const svn_wc_notify_
         if (n->prop_state == svn_wc_notify_state_conflicted)
           {
             nb->prop_conflicts++;
-            add_conflicted_path(nb, n->path);
             statchar_buf[1] = 'C';
           }
         else if (n->prop_state == svn_wc_notify_state_merged)
@@ -917,7 +905,6 @@ notify(void *baton, const svn_wc_notify_
 
     case svn_wc_notify_tree_conflict:
       nb->tree_conflicts++;
-      add_conflicted_path(nb, n->path);
       if ((err = svn_cmdline_printf(pool, "   C %s\n", path_local)))
         goto print_error;
       break;
@@ -1058,7 +1045,6 @@ svn_cl__get_notifier(svn_wc_notify_func2
   nb->prop_conflicts = 0;
   nb->tree_conflicts = 0;
   nb->skipped_paths = 0;
-  nb->conflicted_paths = apr_hash_make(pool);
   SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
 
   *notify_func_p = notify;
@@ -1106,36 +1092,3 @@ svn_cl__check_externals_failed_notify_wr
   if (nwb->wrapped_func)
     nwb->wrapped_func(nwb->wrapped_baton, n, pool);
 }
-
-svn_boolean_t
-svn_cl__notifier_check_conflicts(void *baton)
-{
-  struct notify_baton *nb = baton;
-
-  return (nb->text_conflicts || nb->prop_conflicts || nb->tree_conflicts);
-}
-
-apr_array_header_t *
-svn_cl__notifier_get_conflicted_paths(void *baton, apr_pool_t *result_pool)
-{
-  struct notify_baton *nb = baton;
-  apr_array_header_t *sorted_array;
-  apr_array_header_t *result_array;
-  int i;
-
-  sorted_array = svn_sort__hash(nb->conflicted_paths,
-                                svn_sort_compare_items_as_paths,
-                                apr_hash_pool_get(nb->conflicted_paths));
-  result_array = apr_array_make(result_pool, sorted_array->nelts,
-                                sizeof(const char *));
-  for (i = 0; i < sorted_array->nelts; i++)
-    {
-      svn_sort__item_t item;
-      
-      item = APR_ARRAY_IDX(sorted_array, i, svn_sort__item_t);
-      APR_ARRAY_PUSH(result_array, const char *) = apr_pstrdup(result_pool,
-                                                               item.key);
-    }
-
-  return result_array;
-}

Modified: subversion/branches/ev2-export/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/propedit-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/propedit-cmd.c Sun Oct 21 02:00:31 2012
@@ -228,7 +228,7 @@ svn_cl__propedit(apr_getopt_t *os,
           peg_revision.kind = svn_opt_revision_unspecified;
 
           /* Fetch the current property. */
-          SVN_ERR(svn_client_propget4(&props, pname_utf8, abspath_or_url,
+          SVN_ERR(svn_client_propget5(&props, NULL, pname_utf8, abspath_or_url,
                                       &peg_revision,
                                       &(opt_state->start_revision),
                                       &base_rev, svn_depth_empty,

Modified: subversion/branches/ev2-export/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/propget-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/propget-cmd.c Sun Oct 21 02:00:31 2012
@@ -70,11 +70,46 @@ stream_write(svn_stream_t *out,
 static svn_error_t *
 print_properties_xml(const char *pname,
                      apr_hash_t *props,
+                     apr_array_header_t *inherited_props,
                      apr_pool_t *pool)
 {
   apr_array_header_t *sorted_props;
   int i;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = NULL;
+  svn_stringbuf_t *sb;
+
+  if (inherited_props && inherited_props->nelts)
+    {
+      iterpool = svn_pool_create(pool);
+
+      for (i = 0; i < inherited_props->nelts; i++)
+        {
+          const char *name_local;
+          svn_prop_inherited_item_t *iprop =
+           APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
+          svn_string_t *propval = svn__apr_hash_index_val(
+            apr_hash_first(pool, iprop->prop_hash));
+
+          sb = NULL;
+          svn_pool_clear(iterpool);
+
+          if (svn_path_is_url(iprop->path_or_url))
+            name_local = iprop->path_or_url;
+          else
+            name_local = svn_dirent_local_style(iprop->path_or_url, iterpool);
+
+          svn_xml_make_open_tag(&sb, iterpool, svn_xml_normal, "target",
+                            "path", name_local, NULL);
+
+          svn_cmdline__print_xml_prop(&sb, pname, propval, TRUE, iterpool);
+          svn_xml_make_close_tag(&sb, iterpool, "target");
+
+          SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
+        }
+    }
+
+  if (iterpool == NULL)
+    iterpool = svn_pool_create(iterpool);
 
   sorted_props = svn_sort__hash(props, svn_sort_compare_items_as_paths, pool);
   for (i = 0; i < sorted_props->nelts; i++)
@@ -82,38 +117,126 @@ print_properties_xml(const char *pname,
       svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
       const char *filename = item.key;
       svn_string_t *propval = item.value;
-      svn_stringbuf_t *sb = NULL;
 
+      sb = NULL;
       svn_pool_clear(iterpool);
 
       svn_xml_make_open_tag(&sb, iterpool, svn_xml_normal, "target",
                         "path", filename, NULL);
-      svn_cmdline__print_xml_prop(&sb, pname, propval, iterpool);
+      svn_cmdline__print_xml_prop(&sb, pname, propval, FALSE, iterpool);
       svn_xml_make_close_tag(&sb, iterpool, "target");
 
       SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
     }
 
-  svn_pool_destroy(iterpool);
+  if (iterpool)
+    svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
+/* Print the property PNAME_UTF with the value PROPVAL set on ABSPATH_OR_URL
+   to the stream OUT.
+
+   If INHERITED_PROPERTY is true then the property described is inherited,
+   otherwise it is explicit.
+
+   WC_PATH_PREFIX is the absolute path of the current working directory (and
+   is ignored if ABSPATH_OR_URL is a URL).
+
+   All other arguments are as per print_properties. */
+static svn_error_t *
+print_single_prop(svn_string_t *propval,
+                  const char *abspath_or_URL,
+                  const char *wc_path_prefix,
+                  svn_stream_t *out,
+                  const char *pname_utf8,
+                  svn_boolean_t print_filenames,
+                  svn_boolean_t omit_newline,
+                  svn_boolean_t like_proplist,
+                  svn_boolean_t inherited_property,
+                  apr_pool_t *scratch_pool)
+{
+  if (print_filenames)
+    {
+      const char *header;
+
+      /* Print the file name. */
+
+      if (! svn_path_is_url(abspath_or_URL))
+        abspath_or_URL = svn_cl__local_style_skip_ancestor(wc_path_prefix,
+                                                           abspath_or_URL,
+                                                           scratch_pool);
+
+      /* In verbose mode, print exactly same as "proplist" does;
+       * otherwise, print a brief header. */
+      if (inherited_property)
+        header = apr_psprintf(scratch_pool, like_proplist
+                              ? _("Properties inherited from '%s':\n")
+                              : "%s - ", abspath_or_URL);
+      else
+        header = apr_psprintf(scratch_pool, like_proplist
+                              ? _("Properties on '%s':\n")
+                              : "%s - ", abspath_or_URL);
+      SVN_ERR(svn_cmdline_cstring_from_utf8(&header, header, scratch_pool));
+      SVN_ERR(svn_subst_translate_cstring2(header, &header,
+                                           APR_EOL_STR,  /* 'native' eol */
+                                           FALSE, /* no repair */
+                                           NULL,  /* no keywords */
+                                           FALSE, /* no expansion */
+                                           scratch_pool));
+      SVN_ERR(stream_write(out, header, strlen(header)));
+    }
 
+  if (like_proplist)
+    {
+      /* Print the property name and value just as "proplist -v" does */
+      apr_hash_t *hash = apr_hash_make(scratch_pool);
+
+      apr_hash_set(hash, pname_utf8, APR_HASH_KEY_STRING, propval);
+      SVN_ERR(svn_cl__print_prop_hash(out, hash, FALSE, scratch_pool));
+    }
+  else
+    {
+      /* If this is a special Subversion property, it is stored as
+         UTF8, so convert to the native format. */
+      if (svn_prop_needs_translation(pname_utf8))
+        SVN_ERR(svn_subst_detranslate_string(&propval, propval,
+                                             TRUE, scratch_pool));
+
+      SVN_ERR(stream_write(out, propval->data, propval->len));
+
+      if (! omit_newline)
+        SVN_ERR(stream_write(out, APR_EOL_STR,
+                             strlen(APR_EOL_STR)));
+    }
   return SVN_NO_ERROR;
 }
 
+/* Print the properties in PROPS and/or *INHERITED_PROPS to the stream OUT.
+   PROPS is a hash mapping (const char *) path to (svn_string_t) property
+   value.  INHERITED_PROPS is a depth-first ordered array of
+   svn_prop_inherited_item_t * structures.
+
+   PROPS may be an empty hash, but is never null.  INHERITED_PROPS may be
+   null.
+
+   If IS_URL is true, all paths in PROPS are URLs, else all paths are local
+   paths.
+
+   PNAME_UTF8 is the property name of all the properties.
 
-/* Print the properties in PROPS to the stream OUT. PROPS is a hash mapping
- * (const char *) path to (svn_string_t) property value.
- * If IS_URL is true, all paths are URLs, else all paths are local paths.
- * PNAME_UTF8 is the property name of all the properties.
- * If PRINT_FILENAMES is true, print the item's path before each property.
- * If OMIT_NEWLINE is true, don't add a newline at the end of each property.
- * If LIKE_PROPLIST is true, print everything in a more verbose format
- * like "svn proplist -v" does.
- * */
+   If PRINT_FILENAMES is true, print the item's path before each property.
+
+   If OMIT_NEWLINE is true, don't add a newline at the end of each property.
+
+   If LIKE_PROPLIST is true, print everything in a more verbose format
+   like "svn proplist -v" does. */
 static svn_error_t *
 print_properties(svn_stream_t *out,
-                 svn_boolean_t is_url,
                  const char *pname_utf8,
                  apr_hash_t *props,
+                 apr_array_header_t *inherited_props,
                  svn_boolean_t print_filenames,
                  svn_boolean_t omit_newline,
                  svn_boolean_t like_proplist,
@@ -126,6 +249,24 @@ print_properties(svn_stream_t *out,
 
   SVN_ERR(svn_dirent_get_absolute(&path_prefix, "", pool));
 
+  if (inherited_props)
+    {
+      svn_pool_clear(iterpool);
+
+      for (i = 0; i < inherited_props->nelts; i++)
+        {
+          svn_prop_inherited_item_t *iprop =
+            APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
+          svn_string_t *propval = svn__apr_hash_index_val(apr_hash_first(pool,
+                                                          iprop->prop_hash));
+          SVN_ERR(print_single_prop(propval,
+                                    iprop->path_or_url,
+                                    path_prefix, out, pname_utf8,
+                                    print_filenames, omit_newline,
+                                    like_proplist, TRUE, iterpool));
+        }
+    }
+
   sorted_props = svn_sort__hash(props, svn_sort_compare_items_as_paths, pool);
   for (i = 0; i < sorted_props->nelts; i++)
     {
@@ -135,53 +276,10 @@ print_properties(svn_stream_t *out,
 
       svn_pool_clear(iterpool);
 
-      if (print_filenames)
-        {
-          const char *header;
-
-          /* Print the file name. */
-
-          if (! is_url)
-            filename = svn_cl__local_style_skip_ancestor(path_prefix, filename,
-                                                         iterpool);
-
-          /* In verbose mode, print exactly same as "proplist" does;
-           * otherwise, print a brief header. */
-          header = apr_psprintf(iterpool, like_proplist
-                                ? _("Properties on '%s':\n")
-                                : "%s - ", filename);
-          SVN_ERR(svn_cmdline_cstring_from_utf8(&header, header, iterpool));
-          SVN_ERR(svn_subst_translate_cstring2(header, &header,
-                                               APR_EOL_STR,  /* 'native' eol */
-                                               FALSE, /* no repair */
-                                               NULL,  /* no keywords */
-                                               FALSE, /* no expansion */
-                                               iterpool));
-          SVN_ERR(stream_write(out, header, strlen(header)));
-        }
-
-      if (like_proplist)
-        {
-          /* Print the property name and value just as "proplist -v" does */
-          apr_hash_t *hash = apr_hash_make(iterpool);
-
-          apr_hash_set(hash, pname_utf8, APR_HASH_KEY_STRING, propval);
-          SVN_ERR(svn_cl__print_prop_hash(out, hash, FALSE, iterpool));
-        }
-      else
-        {
-          /* If this is a special Subversion property, it is stored as
-             UTF8, so convert to the native format. */
-          if (svn_prop_needs_translation(pname_utf8))
-            SVN_ERR(svn_subst_detranslate_string(&propval, propval,
-                                                 TRUE, iterpool));
-
-          SVN_ERR(stream_write(out, propval->data, propval->len));
-
-          if (! omit_newline)
-            SVN_ERR(stream_write(out, APR_EOL_STR,
-                                 strlen(APR_EOL_STR)));
-        }
+      SVN_ERR(print_single_prop(propval, filename, path_prefix,
+                                out, pname_utf8, print_filenames,
+                                omit_newline, like_proplist, FALSE,
+                                iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -234,6 +332,11 @@ svn_cl__propget(apr_getopt_t *os,
       const char *URL;
       svn_string_t *propval;
 
+      if (opt_state->show_inherited_props)
+        return svn_error_create(
+          SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+          _("--show-inherited-props can't be used with --revprop"));
+
       SVN_ERR(svn_cl__revprop_prepare(&opt_state->start_revision, targets,
                                       &URL, ctx, pool));
 
@@ -255,7 +358,8 @@ svn_cl__propget(apr_getopt_t *os,
                                     "revprops",
                                     "rev", revstr, NULL);
 
-              svn_cmdline__print_xml_prop(&sb, pname_utf8, propval, pool);
+              svn_cmdline__print_xml_prop(&sb, pname_utf8, propval, FALSE,
+                                          pool);
 
               svn_xml_make_close_tag(&sb, pool, "revprops");
 
@@ -310,6 +414,7 @@ svn_cl__propget(apr_getopt_t *os,
           svn_boolean_t like_proplist;
           const char *truepath;
           svn_opt_revision_t peg_revision;
+          apr_array_header_t *inherited_props;
 
           svn_pool_clear(subpool);
           SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
@@ -321,12 +426,15 @@ svn_cl__propget(apr_getopt_t *os,
           if (!svn_path_is_url(truepath))
             SVN_ERR(svn_dirent_get_absolute(&truepath, truepath, subpool));
 
-          SVN_ERR(svn_client_propget4(&props, pname_utf8, truepath,
-                                      &peg_revision,
-                                      &(opt_state->start_revision),
-                                      NULL, opt_state->depth,
-                                      opt_state->changelists, ctx, subpool,
-                                      subpool));
+          SVN_ERR(svn_client_propget5(
+            &props,
+            opt_state->show_inherited_props ? &inherited_props : NULL,
+            pname_utf8, truepath,
+            &peg_revision,
+            &(opt_state->start_revision),
+            NULL, opt_state->depth,
+            opt_state->changelists, ctx, subpool,
+            subpool));
 
           /* Any time there is more than one thing to print, or where
              the path associated with a printed thing is not obvious,
@@ -341,11 +449,17 @@ svn_cl__propget(apr_getopt_t *os,
           like_proplist = opt_state->verbose && !opt_state->strict;
 
           if (opt_state->xml)
-            SVN_ERR(print_properties_xml(pname_utf8, props, subpool));
+            SVN_ERR(print_properties_xml(
+              pname_utf8, props,
+              opt_state->show_inherited_props ? inherited_props : NULL,
+              subpool));
           else
-            SVN_ERR(print_properties(out, svn_path_is_url(target), pname_utf8,
-                                     props, print_filenames, omit_newline,
-                                     like_proplist, subpool));
+            SVN_ERR(print_properties(
+              out, pname_utf8,
+              props,
+              opt_state->show_inherited_props ? inherited_props : NULL,
+              print_filenames,
+              omit_newline, like_proplist, subpool));
         }
 
       if (opt_state->xml)

Modified: subversion/branches/ev2-export/subversion/svn/proplist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/proplist-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/proplist-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/proplist-cmd.c Sun Oct 21 02:00:31 2012
@@ -35,6 +35,7 @@
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
 #include "svn_xml.h"
+#include "svn_props.h"
 #include "cl.h"
 
 #include "svn_private_config.h"
@@ -48,43 +49,81 @@ typedef struct proplist_baton_t
 
 /*** Code. ***/
 
-/* This implements the svn_proplist_receiver_t interface, printing XML to
+/* This implements the svn_proplist_receiver2_t interface, printing XML to
    stdout. */
 static svn_error_t *
 proplist_receiver_xml(void *baton,
                       const char *path,
                       apr_hash_t *prop_hash,
+                      apr_array_header_t *inherited_props,
                       apr_pool_t *pool)
 {
   svn_cl__opt_state_t *opt_state = ((proplist_baton_t *)baton)->opt_state;
   svn_boolean_t is_url = ((proplist_baton_t *)baton)->is_url;
-  svn_stringbuf_t *sb = NULL;
+  svn_stringbuf_t *sb;
   const char *name_local;
 
+  if (inherited_props && inherited_props->nelts)
+    {
+      int i;
+      apr_pool_t *iterpool = svn_pool_create(pool);
+
+      for (i = 0; i < inherited_props->nelts; i++)
+        {
+          svn_prop_inherited_item_t *iprop =
+            APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
+
+          sb = NULL;
+
+          if (svn_path_is_url(iprop->path_or_url))
+            name_local = iprop->path_or_url;
+          else
+            name_local = svn_dirent_local_style(iprop->path_or_url, iterpool);
+
+          svn_xml_make_open_tag(&sb, iterpool, svn_xml_normal, "target",
+                            "path", name_local, NULL);
+          SVN_ERR(svn_cl__print_xml_prop_hash(&sb, iprop->prop_hash,
+                                              (! opt_state->verbose),
+                                              TRUE, iterpool));
+          svn_xml_make_close_tag(&sb, iterpool, "target");
+          SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
+        }
+      svn_pool_destroy(iterpool);
+    }
+
   if (! is_url)
     name_local = svn_dirent_local_style(path, pool);
   else
     name_local = path;
 
-  /* "<target ...>" */
-  svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "target",
-                        "path", name_local, NULL);
+  sb = NULL;
 
-  SVN_ERR(svn_cl__print_xml_prop_hash(&sb, prop_hash, (! opt_state->verbose),
-                                      pool));
 
-  /* "</target>" */
-  svn_xml_make_close_tag(&sb, pool, "target");
+  if (prop_hash)
+    {
+      /* "<target ...>" */
+        svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "target",
+                              "path", name_local, NULL);
+
+        SVN_ERR(svn_cl__print_xml_prop_hash(&sb, prop_hash,
+                                            (! opt_state->verbose),
+                                            FALSE, pool));
+
+        /* "</target>" */
+        svn_xml_make_close_tag(&sb, pool, "target");
+        SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
+    }
 
-  return svn_cl__error_checked_fputs(sb->data, stdout);
+  return SVN_NO_ERROR;
 }
 
 
-/* This implements the svn_proplist_receiver_t interface. */
+/* This implements the svn_proplist_receiver2_t interface. */
 static svn_error_t *
 proplist_receiver(void *baton,
                   const char *path,
                   apr_hash_t *prop_hash,
+                  apr_array_header_t *inherited_props,
                   apr_pool_t *pool)
 {
   svn_cl__opt_state_t *opt_state = ((proplist_baton_t *)baton)->opt_state;
@@ -96,10 +135,46 @@ proplist_receiver(void *baton,
   else
     name_local = path;
 
-  if (!opt_state->quiet)
-    SVN_ERR(svn_cmdline_printf(pool, _("Properties on '%s':\n"), name_local));
-  return svn_cl__print_prop_hash(NULL, prop_hash, (! opt_state->verbose),
-                                 pool);
+  if (inherited_props)
+    {
+      int i;
+      apr_pool_t *iterpool = svn_pool_create(pool);
+
+      for (i = 0; i < inherited_props->nelts; i++)
+        {
+          svn_prop_inherited_item_t *iprop =
+            APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
+
+          svn_pool_clear(iterpool);
+
+          if (!opt_state->quiet)
+            {
+              if (svn_path_is_url(iprop->path_or_url))
+                SVN_ERR(svn_cmdline_printf(
+                  iterpool, _("Properties inherited from '%s':\n"),
+                  iprop->path_or_url));
+              else
+                SVN_ERR(svn_cmdline_printf(
+                  iterpool, _("Properties inherited from '%s':\n"),
+                  svn_dirent_local_style(iprop->path_or_url, iterpool)));
+            }
+
+          SVN_ERR(svn_cl__print_prop_hash(NULL, iprop->prop_hash,
+                                          (! opt_state->verbose), iterpool));
+        }
+      svn_pool_destroy(iterpool);
+    }
+
+  if (prop_hash && apr_hash_count(prop_hash))
+    {
+      if (!opt_state->quiet)
+        SVN_ERR(svn_cmdline_printf(pool, _("Properties on '%s':\n"),
+                                   name_local));
+      SVN_ERR(svn_cl__print_prop_hash(NULL, prop_hash, (! opt_state->verbose),
+                                      pool));
+    }
+
+  return SVN_NO_ERROR;
 }
 
 
@@ -129,6 +204,11 @@ svn_cl__proplist(apr_getopt_t *os,
       const char *URL;
       apr_hash_t *proplist;
 
+      if (opt_state->show_inherited_props)
+        return svn_error_create(
+          SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+          _("--show-inherited-props can't be used with --revprop"));
+
       SVN_ERR(svn_cl__revprop_prepare(&opt_state->start_revision, targets,
                                       &URL, ctx, scratch_pool));
 
@@ -147,8 +227,9 @@ svn_cl__proplist(apr_getopt_t *os,
           svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal,
                                 "revprops",
                                 "rev", revstr, NULL);
-          SVN_ERR(svn_cl__print_xml_prop_hash
-                  (&sb, proplist, (! opt_state->verbose), scratch_pool));
+          SVN_ERR(svn_cl__print_xml_prop_hash(&sb, proplist,
+                                              (! opt_state->verbose), FALSE,
+                                              scratch_pool));
           svn_xml_make_close_tag(&sb, scratch_pool, "revprops");
 
           SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
@@ -169,7 +250,7 @@ svn_cl__proplist(apr_getopt_t *os,
     {
       int i;
       apr_pool_t *iterpool;
-      svn_proplist_receiver_t pl_receiver;
+      svn_proplist_receiver2_t pl_receiver;
 
       if (opt_state->xml)
         {
@@ -203,12 +284,13 @@ svn_cl__proplist(apr_getopt_t *os,
                                      iterpool));
 
           SVN_ERR(svn_cl__try(
-                   svn_client_proplist3(truepath, &peg_revision,
+                   svn_client_proplist4(truepath, &peg_revision,
                                         &(opt_state->start_revision),
                                         opt_state->depth,
                                         opt_state->changelists,
+                                        opt_state->show_inherited_props,
                                         pl_receiver, &pl_baton,
-                                        ctx, iterpool),
+                                        ctx, iterpool, iterpool),
                    errors, opt_state->quiet,
                    SVN_ERR_UNVERSIONED_RESOURCE,
                    SVN_ERR_ENTRY_NOT_FOUND,

Modified: subversion/branches/ev2-export/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/props.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/props.c (original)
+++ subversion/branches/ev2-export/subversion/svn/props.c Sun Oct 21 02:00:31 2012
@@ -153,6 +153,7 @@ svn_error_t *
 svn_cl__print_xml_prop_hash(svn_stringbuf_t **outstr,
                             apr_hash_t *prop_hash,
                             svn_boolean_t names_only,
+                            svn_boolean_t inherited_props,
                             apr_pool_t *pool)
 {
   apr_array_header_t *sorted_props;
@@ -171,8 +172,10 @@ svn_cl__print_xml_prop_hash(svn_stringbu
 
       if (names_only)
         {
-          svn_xml_make_open_tag(outstr, pool, svn_xml_self_closing, "property",
-                                "name", pname, NULL);
+          svn_xml_make_open_tag(
+            outstr, pool, svn_xml_self_closing,
+            inherited_props ? "inherited_property" : "property",
+            "name", pname, NULL);
         }
       else
         {
@@ -184,7 +187,8 @@ svn_cl__print_xml_prop_hash(svn_stringbu
 
           SVN_ERR(svn_cmdline_cstring_from_utf8(&pname_out, pname, pool));
 
-          svn_cmdline__print_xml_prop(outstr, pname_out, propval, pool);
+          svn_cmdline__print_xml_prop(outstr, pname_out, propval,
+                                      inherited_props, pool);
         }
     }
 

Modified: subversion/branches/ev2-export/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/resolve-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/resolve-cmd.c Sun Oct 21 02:00:31 2012
@@ -57,6 +57,7 @@ svn_cl__resolve(apr_getopt_t *os,
   svn_boolean_t had_error = FALSE;
   svn_wc_conflict_resolver_func2_t conflict_func2;
   void *conflict_baton2;
+  svn_cl__interactive_conflict_baton_t *b;
 
   switch (opt_state->accept_which)
     {
@@ -79,7 +80,7 @@ svn_cl__resolve(apr_getopt_t *os,
       conflict_choice = svn_wc_conflict_choose_mine_full;
       break;
     case svn_cl__accept_unspecified:
-      if (opt_state->conflict_func == NULL)
+      if (opt_state->non_interactive)
         return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                 _("missing --accept option"));
       conflict_choice = svn_wc_conflict_choose_unspecified;
@@ -112,9 +113,16 @@ svn_cl__resolve(apr_getopt_t *os,
   conflict_func2 = ctx->conflict_func2;
   conflict_baton2 = ctx->conflict_baton2;
 
-  /* Store interactive resolver */
-  ctx->conflict_func2 = opt_state->conflict_func;
-  ctx->conflict_baton2 = opt_state->conflict_baton;
+  /* This subcommand always uses the interactive resolver function. */
+  ctx->conflict_func2 = svn_cl__conflict_func_interactive;
+  SVN_ERR(svn_cl__get_conflict_func_interactive_baton(&b,
+                                                      opt_state->accept_which,
+                                                      ctx->config,
+                                                      opt_state->editor_cmd,
+                                                      ctx->cancel_func,
+                                                      ctx->cancel_baton,
+                                                      scratch_pool));
+  ctx->conflict_baton2 = b;
 
   iterpool = svn_pool_create(scratch_pool);
   for (i = 0; i < targets->nelts; i++)

Modified: subversion/branches/ev2-export/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/status-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/status-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/status-cmd.c Sun Oct 21 02:00:31 2012
@@ -377,7 +377,7 @@ svn_cl__status(apr_getopt_t *os,
              ### non-changelist entries. */
           if (opt_state->xml)
             {
-              svn_stringbuf_set(buf, "");
+              svn_stringbuf_setempty(buf);
               svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal,
                                     "changelist", "name", changelist_name,
                                     NULL);
@@ -398,7 +398,7 @@ svn_cl__status(apr_getopt_t *os,
 
           if (opt_state->xml)
             {
-              svn_stringbuf_set(buf, "");
+              svn_stringbuf_setempty(buf);
               svn_xml_make_close_tag(&buf, scratch_pool, "changelist");
               SVN_ERR(svn_cl__error_checked_fputs(buf->data, stdout));
             }

Modified: subversion/branches/ev2-export/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/switch-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/switch-cmd.c Sun Oct 21 02:00:31 2012
@@ -192,16 +192,11 @@ svn_cl__switch(apr_getopt_t *os,
         return svn_error_compose_create(externals_err, err);
     }
 
-  if (opt_state->conflict_func
-      && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
-    {
-      err = svn_cl__resolve_conflicts(
-              svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
-                                                    scratch_pool),
-              depth, opt_state, ctx, scratch_pool);
-      if (err)
-        return svn_error_compose_create(externals_err, err);
-    }
+  err = svn_cl__resolve_postponed_conflicts(ctx->conflict_baton2,
+                                            opt_state->depth,
+                                            opt_state->accept_which,
+                                            opt_state->editor_cmd,
+                                            ctx, scratch_pool);
 
   return svn_error_compose_create(externals_err, err);
 }

Modified: subversion/branches/ev2-export/subversion/svn/tree-conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/tree-conflicts.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/tree-conflicts.c (original)
+++ subversion/branches/ev2-export/subversion/svn/tree-conflicts.c Sun Oct 21 02:00:31 2012
@@ -63,7 +63,6 @@ static const svn_token_map_t map_conflic
   { N_("replace"),      svn_wc_conflict_reason_replaced },
   { N_("unversioned"),  svn_wc_conflict_reason_unversioned },
   { N_("moved away"),   svn_wc_conflict_reason_moved_away },
-  { N_("moved away and edited"), svn_wc_conflict_reason_moved_away_and_edited },
   { N_("moved here"),   svn_wc_conflict_reason_moved_here },
   { NULL,               0 }
 };
@@ -79,7 +78,6 @@ static const svn_token_map_t map_conflic
   { "replace",          svn_wc_conflict_reason_replaced },
   { "unversioned",      svn_wc_conflict_reason_unversioned },
   { "moved-away",       svn_wc_conflict_reason_moved_away },
-  { "moved-away-and-edited", svn_wc_conflict_reason_moved_away_and_edited },
   { "moved-here",       svn_wc_conflict_reason_moved_here },
   { NULL,               0 }
 };

Modified: subversion/branches/ev2-export/subversion/svn/update-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/update-cmd.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/update-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/update-cmd.c Sun Oct 21 02:00:31 2012
@@ -110,8 +110,6 @@ svn_cl__update(apr_getopt_t *os,
   svn_boolean_t depth_is_sticky;
   struct svn_cl__check_externals_failed_notify_baton nwb;
   apr_array_header_t *result_revs;
-  svn_wc_conflict_resolver_func2_t conflict_func2 = ctx->conflict_func2;
-  void *conflict_baton2 = ctx->conflict_baton2;
   svn_error_t *err = SVN_NO_ERROR;
   svn_error_t *externals_err = SVN_NO_ERROR;
 
@@ -189,18 +187,11 @@ svn_cl__update(apr_getopt_t *os,
         return svn_error_compose_create(externals_err, err);
     }
 
-  if (opt_state->conflict_func
-      && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
-    {
-      ctx->conflict_func2 = conflict_func2;
-      ctx->conflict_baton2 = conflict_baton2;
-      err = svn_cl__resolve_conflicts(
-              svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
-                                                    scratch_pool),
-              depth, opt_state, ctx, scratch_pool);
-      if (err)
-        return svn_error_compose_create(externals_err, err);
-    }
+  err = svn_cl__resolve_postponed_conflicts(ctx->conflict_baton2,
+                                            opt_state->depth,
+                                            opt_state->accept_which,
+                                            opt_state->editor_cmd,
+                                            ctx, scratch_pool);
 
   return svn_error_compose_create(externals_err, err);
 }

Modified: subversion/branches/ev2-export/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn_private_config.hw?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn_private_config.hw (original)
+++ subversion/branches/ev2-export/subversion/svn_private_config.hw Sun Oct 21 02:00:31 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
@@ -79,6 +83,7 @@
 #include <libintl.h>
 #define _(x) dgettext(PACKAGE_NAME, x)
 #define Q_(x1, x2, n) dngettext(PACKAGE_NAME, x1, x2, n)
+#define HAVE_BIND_TEXTDOMAIN_CODESET
 #else
 #define _(x) (x)
 #define Q_(x1, x2, n) (((n) == 1) ? x1 : x2)

Modified: subversion/branches/ev2-export/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnadmin/main.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnadmin/main.c (original)
+++ subversion/branches/ev2-export/subversion/svnadmin/main.c Sun Oct 21 02:00:31 2012
@@ -43,6 +43,7 @@
 #include "svn_xml.h"
 
 #include "private/svn_opt_private.h"
+#include "private/svn_named_atomic.h"
 
 #include "svn_private_config.h"
 
@@ -115,7 +116,8 @@ open_repos(svn_repos_t **repos,
   apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
                APR_HASH_KEY_STRING, "1");
   apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
-               APR_HASH_KEY_STRING, "1");
+               APR_HASH_KEY_STRING,
+               svn_named_atomic__is_efficient() ? "1" : "0");
 
   /* now, open the requested repository */
   SVN_ERR(svn_repos_open2(repos, path, fs_config, pool));
@@ -136,8 +138,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);
 }
 
@@ -150,6 +152,7 @@ static svn_opt_subcommand_t
   subcommand_create,
   subcommand_deltify,
   subcommand_dump,
+  subcommand_freeze,
   subcommand_help,
   subcommand_hotcopy,
   subcommand_load,
@@ -336,6 +339,11 @@ static const svn_opt_subcommand_desc2_t 
     "changed in those revisions.)\n"),
   {'r', svnadmin__incremental, svnadmin__deltas, 'q', 'M'} },
 
+  {"freeze", subcommand_freeze, {0}, N_
+   ("usage: svnadmin freeze REPOS_PATH PROGRAM [ARG...]\n\n"
+    "Run PROGRAM passing ARGS while holding a write-lock on REPOS_PATH.\n"),
+   {0} },
+
   {"help", subcommand_help, {"?", "h"}, N_
    ("usage: svnadmin help [SUBCOMMAND...]\n\n"
     "Describe the usage of this program or its subcommands.\n"),
@@ -593,6 +601,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)
@@ -954,6 +977,66 @@ subcommand_dump(apr_getopt_t *os, void *
   return SVN_NO_ERROR;
 }
 
+struct freeze_baton_t {
+  const char *command;
+  const char **args;
+  int status;
+};
+
+static svn_error_t *
+freeze_body(void *baton,
+            apr_pool_t *pool)
+{
+  struct freeze_baton_t *b = baton;
+  apr_status_t apr_err;
+  apr_file_t *infile, *outfile, *errfile;
+
+  apr_err = apr_file_open_stdin(&infile, pool);
+  if (apr_err)
+    return svn_error_wrap_apr(apr_err, "Can't open stdin");
+  apr_err = apr_file_open_stdout(&outfile, pool);
+  if (apr_err)
+    return svn_error_wrap_apr(apr_err, "Can't open stdout");
+  apr_err = apr_file_open_stderr(&errfile, pool);
+  if (apr_err)
+    return svn_error_wrap_apr(apr_err, "Can't open stderr");
+
+  SVN_ERR(svn_io_run_cmd(NULL, b->command, b->args, &b->status,
+                         NULL, TRUE,
+                         infile, outfile, errfile, pool));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+subcommand_freeze(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+  struct svnadmin_opt_state *opt_state = baton;
+  apr_array_header_t *args;
+  int i;
+  struct freeze_baton_t b;
+
+  SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
+
+  if (!args->nelts)
+    return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
+                            _("No program provided"));
+
+  b.command = APR_ARRAY_IDX(args, 0, const char *);
+  b.args = apr_palloc(pool, sizeof(char *) * args->nelts + 1);
+  for (i = 0; i < args->nelts; ++i)
+    b.args[i] = APR_ARRAY_IDX(args, i, const char *);
+  b.args[args->nelts] = NULL;
+
+  SVN_ERR(svn_repos_freeze(opt_state->repository_path, freeze_body, &b, pool));
+
+  /* Make any non-zero status visible to the user. */
+  if (b.status)
+    exit(b.status);
+
+  return SVN_NO_ERROR;
+}
+
 
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
@@ -975,9 +1058,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 +1859,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 +1887,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 +1907,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 +1923,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 +1937,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 +1950,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 +1993,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 +2029,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 +2039,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 +2073,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 +2083,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 +2104,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 +2118,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 +2150,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 +2192,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/ev2-export/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svndumpfilter/main.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/ev2-export/subversion/svndumpfilter/main.c Sun Oct 21 02:00:31 2012
@@ -766,7 +766,7 @@ adjust_mergeinfo(svn_string_t **final_va
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
       const char *merge_source = svn__apr_hash_index_key(hi);
-      apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
+      svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
       struct parse_baton_t *pb = rb->pb;
 
       /* Determine whether the merge_source is a part of the prefix. */
@@ -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);
 }
 
@@ -1525,6 +1526,8 @@ main(int argc, const char *argv[])
         {
           svn_stringbuf_t *buffer, *buffer_utf8;
           const char *utf8_targets_file;
+          apr_array_header_t *targets = apr_array_make(pool, 0,
+                                                       sizeof(const char *));
 
           /* We need to convert to UTF-8 now, even before we divide
              the targets into an array, because otherwise we wouldn't
@@ -1537,10 +1540,18 @@ main(int argc, const char *argv[])
                                                pool));
           SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
 
-          opt_state.prefixes = apr_array_append(pool,
-                                    svn_cstring_split(buffer_utf8->data, "\n\r",
-                                                      TRUE, pool),
-                                    opt_state.prefixes);
+          targets = apr_array_append(pool,
+                         svn_cstring_split(buffer_utf8->data, "\n\r",
+                                           TRUE, pool),
+                         targets);
+
+          for (i = 0; i < targets->nelts; i++)
+            {
+              const char *prefix = APR_ARRAY_IDX(targets, i, const char *);
+              if (prefix[0] != '/')
+                prefix = apr_pstrcat(pool, "/", prefix, (char *)NULL);
+              APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix;
+            }
         }
 
       if (apr_is_empty_array(opt_state.prefixes))

Modified: subversion/branches/ev2-export/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnlook/main.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnlook/main.c (original)
+++ subversion/branches/ev2-export/subversion/svnlook/main.c Sun Oct 21 02:00:31 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);
 }
 
@@ -1282,6 +1282,30 @@ print_tree(svn_fs_root_t *root,
 }
 
 
+/* Set *BASE_REV to the revision on which the target root specified in
+   C is based, or to SVN_INVALID_REVNUM when C represents "revision
+   0" (because that revision isn't based on another revision). */
+static svn_error_t *
+get_base_rev(svn_revnum_t *base_rev, svnlook_ctxt_t *c, apr_pool_t *pool)
+{
+  if (c->is_revision)
+    {
+      *base_rev = c->rev_id - 1;
+    }
+  else
+    {
+      *base_rev = svn_fs_txn_base_revision(c->txn);
+
+      if (! SVN_IS_VALID_REVNUM(*base_rev))
+        return svn_error_createf
+          (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+           _("Transaction '%s' is not based on a revision; how odd"),
+           c->txn_name);
+    }
+  return SVN_NO_ERROR;
+}
+
+
 
 /*** Subcommand handlers. ***/
 
@@ -1388,16 +1412,9 @@ do_dirs_changed(svnlook_ctxt_t *c, apr_p
   svn_repos_node_t *tree;
 
   SVN_ERR(get_root(&root, c, pool));
-  if (c->is_revision)
-    base_rev_id = c->rev_id - 1;
-  else
-    base_rev_id = svn_fs_txn_base_revision(c->txn);
-
-  if (! SVN_IS_VALID_REVNUM(base_rev_id))
-    return svn_error_createf
-      (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-       _("Transaction '%s' is not based on a revision; how odd"),
-       c->txn_name);
+  SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+  if (base_rev_id == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
 
   SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
   if (tree)
@@ -1493,16 +1510,9 @@ do_changed(svnlook_ctxt_t *c, apr_pool_t
   svn_repos_node_t *tree;
 
   SVN_ERR(get_root(&root, c, pool));
-  if (c->is_revision)
-    base_rev_id = c->rev_id - 1;
-  else
-    base_rev_id = svn_fs_txn_base_revision(c->txn);
-
-  if (! SVN_IS_VALID_REVNUM(base_rev_id))
-    return svn_error_createf
-      (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-       _("Transaction '%s' is not based on a revision; how odd"),
-       c->txn_name);
+  SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+  if (base_rev_id == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
 
   SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
   if (tree)
@@ -1521,16 +1531,9 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
   svn_repos_node_t *tree;
 
   SVN_ERR(get_root(&root, c, pool));
-  if (c->is_revision)
-    base_rev_id = c->rev_id - 1;
-  else
-    base_rev_id = svn_fs_txn_base_revision(c->txn);
-
-  if (! SVN_IS_VALID_REVNUM(base_rev_id))
-    return svn_error_createf
-      (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-       _("Transaction '%s' is not based on a revision; how odd"),
-       c->txn_name);
+  SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+  if (base_rev_id == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
 
   SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
   if (tree)
@@ -1789,7 +1792,7 @@ do_plist(svnlook_ctxt_t *c,
       if (verbose)
         {
           if (xml)
-            svn_cmdline__print_xml_prop(&sb, pname, propval, pool);
+            svn_cmdline__print_xml_prop(&sb, pname, propval, FALSE, pool);
           else
             {
               const char *pname_stdout;
@@ -2046,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));
@@ -2444,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/ev2-export/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnmucc/svnmucc.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/ev2-export/subversion/svnmucc/svnmucc.c Sun Oct 21 02:00:31 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/ev2-export/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnrdump/load_editor.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/ev2-export/subversion/svnrdump/load_editor.c Sun Oct 21 02:00:31 2012
@@ -250,7 +250,7 @@ renumber_mergeinfo_revs(svn_string_t **f
 
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      apr_array_header_t *rangelist;
+      svn_rangelist_t *rangelist;
       struct parse_baton *pb = rb->pb;
       int i;
       const void *path;
@@ -704,6 +704,7 @@ new_node_record(void **node_baton,
       apr_size_t residual_close_count;
       apr_array_header_t *residual_open_path;
       int i;
+      apr_size_t n;
 
       /* Before attempting to handle the action, call open_directory
          for all the path components and set the directory baton
@@ -720,7 +721,7 @@ new_node_record(void **node_baton,
 
       /* First close all as many directories as there are after
          skip_ancestor, and then open fresh directories */
-      for (i = 0; i < residual_close_count; i ++)
+      for (n = 0; n < residual_close_count; n ++)
         {
           /* Don't worry about destroying the actual rb->db object,
              since the pool we're using has the lifetime of one

Modified: subversion/branches/ev2-export/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnrdump/svnrdump.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/ev2-export/subversion/svnrdump/svnrdump.c Sun Oct 21 02:00:31 2012
@@ -270,7 +270,7 @@ init_client_context(svn_client_ctx_t **c
   SVN_ERR(svn_ra_initialize(pool));
 
   SVN_ERR(svn_config_ensure(config_dir, pool));
-  SVN_ERR(svn_client_create_context(&ctx, pool));
+  SVN_ERR(svn_client_create_context2(&ctx, NULL, pool));
 
   SVN_ERR(svn_config_get_config(&(ctx->config), config_dir, pool));
 
@@ -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/ev2-export/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnserve/main.c?rev=1400556&r1=1400555&r2=1400556&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnserve/main.c (original)
+++ subversion/branches/ev2-export/subversion/svnserve/main.c Sun Oct 21 02:00:31 2012
@@ -149,6 +149,7 @@ void winservice_notify_stop(void)
 #define SVNSERVE_OPT_CACHE_FULLTEXTS 266
 #define SVNSERVE_OPT_CACHE_REVPROPS  267
 #define SVNSERVE_OPT_SINGLE_CONN     268
+#define SVNSERVE_OPT_CLIENT_SPEED    269
 
 static const apr_getopt_option_t svnserve__options[] =
   {
@@ -235,6 +236,16 @@ static const apr_getopt_option_t svnserv
         "Default is no.\n"
         "                             "
         "[used for FSFS repositories only]")},
+    {"client-speed", SVNSERVE_OPT_CLIENT_SPEED, 1,
+     N_("Optimize throughput based on the assumption that\n"
+        "                             "
+        "clients can receive data with a bitrate of at\n"
+        "                             "
+        "least ARG Gbit/s.  For clients receiving data at\n"
+        "                             "
+        "less than 1 Gbit/s, zero should be used.\n"
+        "                             "
+        "Default is 0 (optimizations disabled).")},
 #ifdef CONNECTION_HAVE_THREAD_OPTION
     /* ### Making the assumption here that WIN32 never has fork and so
      * ### this option never exists when --service exists. */
@@ -327,7 +338,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 +423,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);
 }
 
@@ -496,6 +508,8 @@ int main(int argc, const char *argv[])
   params.cache_fulltexts = TRUE;
   params.cache_txdeltas = FALSE;
   params.cache_revprops = FALSE;
+  params.zero_copy_limit = 0;
+  params.error_check_interval = 4096;
 
   while (1)
     {
@@ -644,6 +658,18 @@ int main(int argc, const char *argv[])
              = svn_tristate__from_word(arg) == svn_tristate_true;
           break;
 
+        case SVNSERVE_OPT_CLIENT_SPEED:
+          {
+            apr_size_t bandwidth = (apr_size_t)apr_strtoi64(arg, NULL, 0);
+
+            /* block other clients for at most 1 ms (at full bandwidth) */
+            params.zero_copy_limit = bandwidth * 120000;
+
+            /* check for aborted connections at the same rate */
+            params.error_check_interval = bandwidth * 120000;
+          }
+          break;
+
 #ifdef WIN32
         case SVNSERVE_OPT_SERVICE:
           if (run_mode != run_mode_service)
@@ -754,8 +780,10 @@ int main(int argc, const char *argv[])
        * the pool cleanup handlers that call sasl_dispose() (connection_pool)
        * and sasl_done() (pool) are run in the right order. See issue #3664. */
       connection_pool = svn_pool_create(pool);
-      conn = svn_ra_svn_create_conn2(NULL, in_file, out_file,
+      conn = svn_ra_svn_create_conn3(NULL, in_file, out_file,
                                      params.compression_level,
+                                     params.zero_copy_limit,
+                                     params.error_check_interval,
                                      connection_pool);
       svn_error_clear(serve(conn, &params, connection_pool));
       exit(0);
@@ -924,7 +952,7 @@ int main(int argc, const char *argv[])
     settings.single_threaded = TRUE;
     if (handling_mode == connection_mode_thread)
       {
-#ifdef APR_HAS_THREADS
+#if APR_HAS_THREADS
         settings.single_threaded = FALSE;
 #else
         /* No requests will be processed at all
@@ -987,8 +1015,10 @@ int main(int argc, const char *argv[])
           /* It's not a fatal error if we cannot enable keep-alives. */
         }
 
-      conn = svn_ra_svn_create_conn2(usock, NULL, NULL,
+      conn = svn_ra_svn_create_conn3(usock, NULL, NULL,
                                      params.compression_level,
+                                     params.zero_copy_limit,
+                                     params.error_check_interval,
                                      connection_pool);
 
       if (run_mode == run_mode_listen_once)