subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1532583 [7/10] - in /subversion/branches/fsfs-improvements: ./ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/client-side/emacs/ notes/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/or...
Date Tue, 15 Oct 2013 22:57:09 GMT
Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c Tue Oct 15 22:57:03 2013
@@ -2247,6 +2247,12 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
        * might introduce actual-only nodes without direct parents,
        * and we're not yet sure if other existing code is prepared
        * to handle such nodes. To be revisited post-1.8.
+       *
+       * ### In case of a conflict we are most likely creating WORKING nodes
+       *     describing a copy of what was in BASE. The move information
+       *     should be updated to describe a move from the WORKING layer.
+       *     When stored that way the resolver of the tree conflict still has
+       *     the knowledge of what was moved.
        */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_MOVED_OUTSIDE));
@@ -6387,6 +6393,7 @@ op_revert_txn(void *baton,
     {
       SVN_ERR(svn_wc__db_resolve_break_moved_away_internal(wcroot,
                                                            local_relpath,
+                                                           op_depth,
                                                            scratch_pool));
     }
   else
@@ -6553,10 +6560,12 @@ op_revert_recursive_txn(void *baton,
   while (have_row)
     {
       const char *move_src_relpath = svn_sqlite__column_text(stmt, 0, NULL);
+      int move_op_depth = svn_sqlite__column_int(stmt, 2);
       svn_error_t *err;
 
       err = svn_wc__db_resolve_break_moved_away_internal(wcroot,
                                                          move_src_relpath,
+                                                         move_op_depth,
                                                          scratch_pool);
       if (err)
         return svn_error_compose_create(err, svn_sqlite__reset(stmt));
@@ -12128,38 +12137,6 @@ svn_wc__db_follow_moved_to(apr_array_hea
   return SVN_NO_ERROR;
 }
 
-/* Extract the moved-to information for LOCAL_RELPATH at OP-DEPTH by
-   examining the lowest working node above OP_DEPTH.  The output paths
-   are NULL if there is no move, otherwise:
-
-   *MOVE_DST_RELPATH: the moved-to destination of LOCAL_RELPATH.
-
-   *MOVE_DST_OP_ROOT_RELPATH: the moved-to destination of the root of
-   the move of LOCAL_RELPATH. This may be equal to *MOVE_DST_RELPATH
-   if LOCAL_RELPATH is the root of the move.
-
-   *MOVE_SRC_ROOT_RELPATH: the root of the move source.  For moves
-   inside a delete this will be different from *MOVE_SRC_OP_ROOT_RELPATH.
-
-   *MOVE_SRC_OP_ROOT_RELPATH: the root of the source layer that
-   contains the move.  For moves inside deletes this is the root of
-   the delete, for other moves this is the root of the move.
-
-   Given a path A/B/C with A/B moved to X then for A/B/C
-
-     MOVE_DST_RELPATH is X/C
-     MOVE_DST_OP_ROOT_RELPATH is X
-     MOVE_SRC_ROOT_RELPATH is A/B
-     MOVE_SRC_OP_ROOT_RELPATH is A/B
-
-   If A is then deleted the MOVE_DST_RELPATH, MOVE_DST_OP_ROOT_RELPATH
-   and MOVE_SRC_ROOT_RELPATH remain the same but MOVE_SRC_OP_ROOT_RELPATH
-   changes to A.
-
-   ### Think about combining with scan_deletion?  Also with
-   ### scan_addition to get moved-to for replaces?  Do we need to
-   ### return the op-root of the move source, i.e. A/B in the example
-   ### above?  */
 svn_error_t *
 svn_wc__db_op_depth_moved_to(const char **move_dst_relpath,
                              const char **move_dst_op_root_relpath,
@@ -12176,6 +12153,8 @@ svn_wc__db_op_depth_moved_to(const char 
   int delete_op_depth;
   const char *relpath = local_relpath;
 
+  SVN_ERR_ASSERT(local_relpath[0]); /* Not valid on the WC root */
+
   *move_dst_relpath = *move_dst_op_root_relpath = NULL;
   *move_src_root_relpath = *move_src_op_root_relpath = NULL;
 
@@ -12191,14 +12170,17 @@ svn_wc__db_op_depth_moved_to(const char 
           *move_dst_op_root_relpath = svn_sqlite__column_text(stmt, 3,
                                                               result_pool);
           if (*move_dst_op_root_relpath)
-            *move_src_root_relpath = apr_pstrdup(result_pool, relpath);
+            {
+              *move_src_root_relpath = apr_pstrdup(result_pool, relpath);
+              SVN_ERR(svn_sqlite__reset(stmt));
+
+              break;
+            }
         }
       SVN_ERR(svn_sqlite__reset(stmt));
-      if (!*move_dst_op_root_relpath)
-        relpath = svn_relpath_dirname(relpath, scratch_pool);
+      relpath = svn_relpath_dirname(relpath, scratch_pool);
     }
-  while (!*move_dst_op_root_relpath
-        && have_row && delete_op_depth <= relpath_depth(relpath));
+  while (have_row && delete_op_depth <= relpath_depth(relpath));
 
   if (*move_dst_op_root_relpath)
     {

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.h Tue Oct 15 22:57:03 2013
@@ -3382,7 +3382,14 @@ svn_wc__db_resolve_delete_raise_moved_aw
                                            apr_pool_t *scratch_pool);
 
 /* Like svn_wc__db_resolve_delete_raise_moved_away this should be
-   combined. */
+   combined.
+   
+   ### LOCAL_ABSPATH specifies the move origin, but the move origin
+   ### is not necessary unique enough. This function needs an op_root_abspath
+   ### argument to differentiate between different origins.
+
+   ### See move_tests.py: move_many_update_delete for an example case.
+   */
 svn_error_t *
 svn_wc__db_resolve_break_moved_away(svn_wc__db_t *db,
                                     const char *local_abspath,

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_private.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_private.h Tue Oct 15 22:57:03 2013
@@ -423,6 +423,38 @@ svn_wc__db_retract_parent_delete(svn_wc_
                                  int op_depth,
                                  apr_pool_t *scratch_pool);
 
+/* Extract the moved-to information for LOCAL_RELPATH at OP-DEPTH by
+   examining the lowest working node above OP_DEPTH.  The output paths
+   are NULL if there is no move, otherwise:
+
+   *MOVE_DST_RELPATH: the moved-to destination of LOCAL_RELPATH.
+
+   *MOVE_DST_OP_ROOT_RELPATH: the moved-to destination of the root of
+   the move of LOCAL_RELPATH. This may be equal to *MOVE_DST_RELPATH
+   if LOCAL_RELPATH is the root of the move.
+
+   *MOVE_SRC_ROOT_RELPATH: the root of the move source.  For moves
+   inside a delete this will be different from *MOVE_SRC_OP_ROOT_RELPATH.
+
+   *MOVE_SRC_OP_ROOT_RELPATH: the root of the source layer that
+   contains the move.  For moves inside deletes this is the root of
+   the delete, for other moves this is the root of the move.
+
+   Given a path A/B/C with A/B moved to X then for A/B/C
+
+     MOVE_DST_RELPATH is X/C
+     MOVE_DST_OP_ROOT_RELPATH is X
+     MOVE_SRC_ROOT_RELPATH is A/B
+     MOVE_SRC_OP_ROOT_RELPATH is A/B
+
+   If A is then deleted the MOVE_DST_RELPATH, MOVE_DST_OP_ROOT_RELPATH
+   and MOVE_SRC_ROOT_RELPATH remain the same but MOVE_SRC_OP_ROOT_RELPATH
+   changes to A.
+
+   ### Think about combining with scan_deletion?  Also with
+   ### scan_addition to get moved-to for replaces?  Do we need to
+   ### return the op-root of the move source, i.e. A/B in the example
+   ### above?  */
 svn_error_t *
 svn_wc__db_op_depth_moved_to(const char **move_dst_relpath,
                              const char **move_dst_op_root_relpath,
@@ -445,9 +477,12 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
                            svn_wc__db_t *db,
                            apr_pool_t *scratch_pool);
 
+/* Unbreak the move from LOCAL_RELPATH on op-depth in WCROOT, by making
+   the destination a normal copy */
 svn_error_t *
 svn_wc__db_resolve_break_moved_away_internal(svn_wc__db_wcroot_t *wcroot,
                                              const char *local_relpath,
+                                             int op_depth,
                                              apr_pool_t *scratch_pool);
 
 svn_error_t *

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_update_move.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_update_move.c Tue Oct 15 22:57:03 2013
@@ -1297,15 +1297,6 @@ tc_editor_move(void *baton,
 }
 
 static svn_error_t *
-tc_editor_rotate(void *baton,
-                 const apr_array_header_t *relpaths,
-                 const apr_array_header_t *revisions,
-                 apr_pool_t *scratch_pool)
-{
-  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, NULL);
-}
-
-static svn_error_t *
 tc_editor_complete(void *baton,
                    apr_pool_t *scratch_pool)
 {
@@ -1331,7 +1322,6 @@ static const svn_editor_cb_many_t editor
   tc_editor_delete,
   tc_editor_copy,
   tc_editor_move,
-  tc_editor_rotate,
   tc_editor_complete,
   tc_editor_abort
 };
@@ -2285,30 +2275,34 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
                            svn_wc__db_t *db,
                            apr_pool_t *scratch_pool)
 {
-  const char *dummy1, *move_dst_op_root_relpath;
-  const char *move_src_root_relpath, *move_src_op_root_relpath;
   apr_hash_t *src_done;
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
                                       STMT_CREATE_UPDATE_MOVE_LIST));
 
-  SVN_ERR(svn_wc__db_op_depth_moved_to(&dummy1, &move_dst_op_root_relpath,
-                                       &move_src_root_relpath,
-                                       &move_src_op_root_relpath, 0,
-                                       wcroot, local_relpath,
-                                       scratch_pool, scratch_pool));
-
-  if (move_src_root_relpath)
+  if (local_relpath[0] != '\0')
     {
-      if (strcmp(move_src_root_relpath, local_relpath))
+      const char *dummy1, *move_dst_op_root_relpath;
+      const char *move_src_root_relpath, *move_src_op_root_relpath;
+
+      /* Is the root of the update moved away? (Impossible for the wcroot) */
+      SVN_ERR(svn_wc__db_op_depth_moved_to(&dummy1, &move_dst_op_root_relpath,
+                                           &move_src_root_relpath,
+                                           &move_src_op_root_relpath, 0,
+                                           wcroot, local_relpath,
+                                           scratch_pool, scratch_pool));
+
+      if (move_src_root_relpath)
         {
-          SVN_ERR(bump_mark_tree_conflict(wcroot, move_src_root_relpath,
-                                          move_src_op_root_relpath,
-                                          move_dst_op_root_relpath,
-                                          db, scratch_pool));
-          return SVN_NO_ERROR;
+          if (strcmp(move_src_root_relpath, local_relpath))
+            {
+              SVN_ERR(bump_mark_tree_conflict(wcroot, move_src_root_relpath,
+                                              move_src_op_root_relpath,
+                                              move_dst_op_root_relpath,
+                                              db, scratch_pool));
+              return SVN_NO_ERROR;
+            }
         }
-
     }
 
   src_done = apr_hash_make(scratch_pool);
@@ -2441,17 +2435,23 @@ break_move(svn_wc__db_wcroot_t *wcroot,
 svn_error_t *
 svn_wc__db_resolve_break_moved_away_internal(svn_wc__db_wcroot_t *wcroot,
                                              const char *local_relpath,
+                                             int op_depth,
                                              apr_pool_t *scratch_pool)
 {
   const char *dummy1, *move_dst_op_root_relpath;
   const char *dummy2, *move_src_op_root_relpath;
 
+  /* We want to include the passed op-depth, but the function does a > check */
   SVN_ERR(svn_wc__db_op_depth_moved_to(&dummy1, &move_dst_op_root_relpath,
                                        &dummy2,
                                        &move_src_op_root_relpath,
-                                       relpath_depth(local_relpath) - 1,
+                                       op_depth - 1,
                                        wcroot, local_relpath,
                                        scratch_pool, scratch_pool));
+
+  SVN_ERR_ASSERT(move_src_op_root_relpath != NULL
+                 && move_dst_op_root_relpath != NULL);
+
   SVN_ERR(break_move(wcroot, local_relpath,
                      relpath_depth(move_src_op_root_relpath),
                      move_dst_op_root_relpath,
@@ -2520,6 +2520,7 @@ svn_wc__db_resolve_break_moved_away(svn_
 
   SVN_WC__DB_WITH_TXN(
     svn_wc__db_resolve_break_moved_away_internal(wcroot, local_relpath,
+                                                 relpath_depth(local_relpath),
                                                  scratch_pool),
     wcroot);
 

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c Tue Oct 15 22:57:03 2013
@@ -115,6 +115,7 @@ static svn_error_t *
 do_resources(const dav_svn_repos *repos,
              svn_fs_root_t *root,
              svn_revnum_t revision,
+             svn_move_behavior_t move_behavior,
              ap_filter_t *output,
              apr_bucket_brigade *bb,
              apr_pool_t *pool)
@@ -129,7 +130,7 @@ do_resources(const dav_svn_repos *repos,
      and deleted things.  Also, note that deleted things don't merit
      responses of their own -- they are considered modifications to
      their parent.  */
-  SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+  SVN_ERR(svn_fs_paths_changed3(&changes, root, move_behavior, pool));
 
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
@@ -155,6 +156,8 @@ do_resources(const dav_svn_repos *repos,
 
         case svn_fs_path_change_add:
         case svn_fs_path_change_replace:
+        case svn_fs_path_change_move:
+        case svn_fs_path_change_movereplace:
           send_self = TRUE;
           send_parent = TRUE;
           break;
@@ -360,7 +363,10 @@ dav_svn__merge_response(ap_filter_t *out
          ### we can pass back the new version URL */
 
       /* and go make me proud, boy! */
-      serr = do_resources(repos, root, new_rev, output, bb, pool);
+      serr = do_resources(repos, root, new_rev,
+                          /* report changes with no further interpretation */
+                          svn_move_behavior_explicit_moves,
+                          output, bb, pool);
       if (serr != NULL)
         {
           return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c Tue Oct 15 22:57:03 2013
@@ -301,6 +301,9 @@ dav_svn__log_report(const dav_resource *
   svn_boolean_t discover_changed_paths = FALSE;      /* off by default */
   svn_boolean_t strict_node_history = FALSE;         /* off by default */
   svn_boolean_t include_merged_revisions = FALSE;    /* off by default */
+  svn_move_behavior_t move_behavior = svn_move_behavior_no_moves;
+                                             /* no moves by default */
+  
   apr_array_header_t *revprops = apr_array_make(resource->pool, 3,
                                                 sizeof(const char *));
   apr_array_header_t *paths
@@ -395,6 +398,24 @@ dav_svn__log_report(const dav_resource *
                                     resource->pool);
           APR_ARRAY_PUSH(paths, const char *) = target;
         }
+      else if (strcmp(child->name, "move-behavior") == 0)
+        {
+          int move_behavior_param;
+          serr = svn_cstring_atoi(&move_behavior_param,
+                                  dav_xml_get_cdata(child, resource->pool, 1));
+          if (serr)
+            return dav_svn__convert_err(serr, HTTP_BAD_REQUEST,
+                                        "Malformed CDATA in element "
+                                        "\"move-behavior\"", resource->pool);
+
+          if (   move_behavior_param < 0
+              || move_behavior_param > svn_move_behavior_auto_moves)
+            return dav_svn__convert_err(serr, HTTP_BAD_REQUEST,
+                                        "Invalid CDATA in element "
+                                        "\"move-behavior\"", resource->pool);
+
+          move_behavior = (svn_move_behavior_t) move_behavior_param;
+        }
       /* else unknown element; skip it */
     }
 
@@ -424,7 +445,7 @@ dav_svn__log_report(const dav_resource *
      flag in our log_receiver_baton structure). */
 
   /* Send zero or more log items. */
-  serr = svn_repos_get_logs4(repos->repos,
+  serr = svn_repos_get_logs5(repos->repos,
                              paths,
                              start,
                              end,
@@ -432,6 +453,7 @@ dav_svn__log_report(const dav_resource *
                              discover_changed_paths,
                              strict_node_history,
                              include_merged_revisions,
+                             move_behavior,
                              revprops,
                              dav_svn__authz_read_func(&arb),
                              &arb,

Modified: subversion/branches/fsfs-improvements/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/cl.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/cl.h (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/cl.h Tue Oct 15 22:57:03 2013
@@ -223,6 +223,7 @@ typedef struct svn_cl__opt_state_t
                                     (not converted to UTF-8) */
   svn_boolean_t parents;         /* create intermediate directories */
   svn_boolean_t use_merge_history; /* use/display extra merge information */
+  svn_boolean_t auto_moves;      /* interpret unique DEL/ADD pairs as moves */
   svn_cl__accept_t accept_which;   /* how to handle conflicts */
   svn_cl__show_revs_t show_revs;   /* mergeinfo flavor */
   svn_depth_t set_depth;           /* new sticky ambient depth value */

Modified: subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c Tue Oct 15 22:57:03 2013
@@ -399,31 +399,11 @@ launch_resolver(svn_boolean_t *performed
                 svn_cl__interactive_conflict_baton_t *b,
                 apr_pool_t *pool)
 {
-  svn_error_t *err;
-
-  err = svn_cl__merge_file_externally(desc->base_abspath, desc->their_abspath,
-                                      desc->my_abspath, desc->merged_file,
-                                      desc->local_abspath, b->config, NULL,
-                                      pool);
-  if (err && err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL)
-    {
-      SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
-                                  err->message ? err->message :
-                                  _("No merge tool found, "
-                                    "try '(m) merge' instead.\n")));
-      svn_error_clear(err);
-    }
-  else if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
-    {
-      SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
-                                  err->message ? err->message :
-                             _("Error running merge tool, "
-                               "try '(m) merge' instead.")));
-      svn_error_clear(err);
-    }
-  else if (err)
-    return svn_error_trace(err);
-  else if (performed_edit)
+  SVN_ERR(svn_cl__merge_file_externally(desc->base_abspath, desc->their_abspath,
+                                        desc->my_abspath, desc->merged_file,
+                                        desc->local_abspath, b->config, NULL,
+                                        pool));
+  if (performed_edit)
     *performed_edit = TRUE;
 
   return SVN_NO_ERROR;
@@ -474,8 +454,8 @@ static const resolver_option_t text_conf
                                      "(same)  [theirs-full]"),
                                   svn_wc_conflict_choose_theirs_full },
   { "",   "",                     "", svn_wc_conflict_choose_unspecified },
-  { "m",  N_("merge"),            N_("use internal merge tool to resolve "
-                                     "conflict"), -1 },
+  { "m",  N_("merge"),            N_("use merge tool to resolve conflict"),
+                                     -1 },
   { "l",  N_("launch tool"),      N_("launch external tool to resolve "
                                      "conflict  [launch]"), -1 },
   { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
@@ -835,20 +815,35 @@ handle_text_conflict(svn_wc_conflict_res
       else if (strcmp(opt->code, "m") == 0 || strcmp(opt->code, ":-g") == 0 ||
                strcmp(opt->code, "=>-") == 0 || strcmp(opt->code, ":>.") == 0)
         {
-          if (desc->kind != svn_wc_conflict_kind_text)
+          svn_boolean_t remains_in_conflict;
+          svn_error_t *err;
+
+          err = launch_resolver(&performed_edit, desc, b, iterpool);
+          if (err)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
-                                          _("Invalid option; can only "
-                                            "resolve text conflicts with "
-                                            "the internal merge tool."
-                                            "\n\n")));
-              continue;
+              if (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL ||
+                  err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
+                {
+                  /* Try the internal merge tool. */
+                  svn_error_clear(err);
+                }
+              else
+                return svn_error_trace(err);
             }
 
-          if (desc->base_abspath && desc->their_abspath &&
+          if (!performed_edit &&
+              desc->base_abspath && desc->their_abspath &&
               desc->my_abspath && desc->merged_file)
             {
-              svn_boolean_t remains_in_conflict;
+              if (desc->kind != svn_wc_conflict_kind_text)
+                {
+                  SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
+                                              _("Invalid option; can only "
+                                                "resolve text conflicts with "
+                                                "the internal merge tool."
+                                                "\n\n")));
+                  continue;
+                }
 
               SVN_ERR(svn_cl__merge_file(desc->base_abspath,
                                          desc->their_abspath,
@@ -860,11 +855,13 @@ handle_text_conflict(svn_wc_conflict_res
                                          b->config,
                                          &remains_in_conflict,
                                          iterpool));
-              knows_something = !remains_in_conflict;
             }
           else
             SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                         _("Invalid option.\n\n")));
+
+          if (performed_edit || !remains_in_conflict)
+            knows_something = TRUE;
         }
       else if (strcmp(opt->code, "l") == 0 || strcmp(opt->code, ":-l") == 0)
         {
@@ -875,7 +872,28 @@ handle_text_conflict(svn_wc_conflict_res
           if (desc->base_abspath && desc->their_abspath &&
               desc->my_abspath && desc->merged_file)
             {
-              SVN_ERR(launch_resolver(&performed_edit, desc, b, iterpool));
+              svn_error_t *err;
+
+              err = launch_resolver(&performed_edit, desc, b, iterpool);
+              if (err && err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL)
+                {
+                  SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, "%s\n",
+                                              err->message ? err->message :
+                                              _("No merge tool found, "
+                                                "try '(m) merge' instead.\n")));
+                  svn_error_clear(err);
+                }
+              else if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
+                {
+                  SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, "%s\n",
+                                              err->message ? err->message :
+                                         _("Error running merge tool, "
+                                           "try '(m) merge' instead.")));
+                  svn_error_clear(err);
+                }
+              else if (err)
+                return svn_error_trace(err);
+
               if (performed_edit)
                 knows_something = TRUE;
             }

Modified: subversion/branches/fsfs-improvements/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/help-cmd.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/help-cmd.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/help-cmd.c Tue Oct 15 22:57:03 2013
@@ -32,7 +32,6 @@
 #include "svn_string.h"
 #include "svn_config.h"
 #include "svn_error.h"
-#include "svn_version.h"
 #include "cl.h"
 
 
@@ -47,10 +46,9 @@ svn_cl__help(apr_getopt_t *os,
   svn_cl__opt_state_t *opt_state = NULL;
   svn_stringbuf_t *version_footer = NULL;
 
-  /* xgettext: the %s is for SVN_VER_NUMBER. */
-  char help_header_template[] =
+  char help_header[] =
   N_("usage: svn <subcommand> [options] [args]\n"
-     "Subversion command-line client, version %s.\n"
+     "Subversion command-line client.\n"
      "Type 'svn help <subcommand>' for help on a specific subcommand.\n"
      "Type 'svn --version' to see the program version and RA modules\n"
      "  or 'svn --version --quiet' to see just the version number.\n"
@@ -65,9 +63,6 @@ svn_cl__help(apr_getopt_t *os,
   N_("Subversion is a tool for version control.\n"
      "For additional information, see http://subversion.apache.org/\n");
 
-  char *help_header =
-    apr_psprintf(pool, _(help_header_template), SVN_VER_NUMBER);
-
   const char *ra_desc_start
     = _("The following repository access (RA) modules are available:\n\n");
 

Modified: subversion/branches/fsfs-improvements/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/log-cmd.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/log-cmd.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/log-cmd.c Tue Oct 15 22:57:03 2013
@@ -681,6 +681,9 @@ svn_cl__log(apr_getopt_t *os,
   const char *target;
   int i;
   apr_array_header_t *revprops;
+  svn_move_behavior_t move_behavior = opt_state->auto_moves
+                                    ? svn_move_behavior_auto_moves
+                                    : svn_move_behavior_explicit_moves;
 
   if (!opt_state->xml)
     {
@@ -831,13 +834,14 @@ svn_cl__log(apr_getopt_t *os,
           if (!opt_state->quiet)
             APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_LOG;
         }
-      SVN_ERR(svn_client_log5(targets,
+      SVN_ERR(svn_client_log6(targets,
                               &lb.target_peg_revision,
                               opt_state->revision_ranges,
                               opt_state->limit,
                               opt_state->verbose,
                               opt_state->stop_on_copy,
                               opt_state->use_merge_history,
+                              move_behavior,
                               revprops,
                               log_entry_receiver_xml,
                               &lb,
@@ -854,13 +858,14 @@ svn_cl__log(apr_getopt_t *os,
       APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_DATE;
       if (!opt_state->quiet)
         APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_LOG;
-      SVN_ERR(svn_client_log5(targets,
+      SVN_ERR(svn_client_log6(targets,
                               &lb.target_peg_revision,
                               opt_state->revision_ranges,
                               opt_state->limit,
                               opt_state->verbose,
                               opt_state->stop_on_copy,
                               opt_state->use_merge_history,
+                              move_behavior,
                               revprops,
                               log_entry_receiver,
                               &lb,

Modified: subversion/branches/fsfs-improvements/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/svn.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/svn.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/svn.c Tue Oct 15 22:57:03 2013
@@ -118,6 +118,7 @@ typedef enum svn_cl__longopt_t {
   opt_with_revprop,
   opt_with_all_revprops,
   opt_with_no_revprops,
+  opt_auto_moves,
   opt_parents,
   opt_accept,
   opt_show_revs,
@@ -292,6 +293,10 @@ const apr_getopt_option_t svn_cl__option
                     N_("set revision property ARG in new revision\n"
                        "                             "
                        "using the name[=value] format")},
+  {"auto-moves",    opt_auto_moves, 0,
+                    N_("attempt to interpret matching unique DEL+ADD\n"
+                       "                             "
+                       "pairs as moves")},
   {"parents",       opt_parents, 0, N_("make intermediate directories")},
   {"use-merge-history", 'g', 0,
                     N_("use/display additional information from merge\n"
@@ -767,9 +772,9 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    was created:\n"
      "      svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo\n"),
     {'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
-     opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
-     opt_depth, opt_diff, opt_diff_cmd, opt_internal_diff, 'x', opt_search,
-     opt_search_and, },
+     opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops,
+     opt_with_revprop, opt_auto_moves, opt_depth, opt_diff, opt_diff_cmd,
+     opt_internal_diff, 'x', opt_search, opt_search_and },
     {{opt_with_revprop, N_("retrieve revision property ARG")},
      {'c', N_("the change made in revision ARG")}} },
 
@@ -2234,6 +2239,9 @@ sub_main(int argc, const char *argv[], a
       case 'g':
         opt_state.use_merge_history = TRUE;
         break;
+      case opt_auto_moves:
+        opt_state.auto_moves = TRUE;
+        break;
       case opt_accept:
         SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
         opt_state.accept_which = svn_cl__accept_from_word(utf8_opt_arg);

Modified: subversion/branches/fsfs-improvements/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnadmin/svnadmin.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnadmin/svnadmin.c Tue Oct 15 22:57:03 2013
@@ -1180,6 +1180,7 @@ subcommand_help(apr_getopt_t *os, void *
   struct svnadmin_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]\n"
+      "Subversion repository administration tool.\n"
       "Type 'svnadmin help <subcommand>' for help on a specific subcommand.\n"
       "Type 'svnadmin --version' to see the program version and FS modules.\n"
       "\n"

Modified: subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c Tue Oct 15 22:57:03 2013
@@ -67,7 +67,8 @@ typedef enum svnauth__longopt_t {
 /** Subcommands. **/
 static svn_opt_subcommand_t
   subcommand_help,
-  subcommand_list;
+  subcommand_list,
+  subcommand_delete;
 
 /* Array of available subcommands.
  * The entire list must be terminated with an entry of nulls.
@@ -86,16 +87,36 @@ static const svn_opt_subcommand_desc2_t 
     "\n"
     "  If PATTERN is specified, only list credentials with attributes matching\n"
     "  the pattern. All attributes except passwords can be matched. If more than\n"
-    "  one pattern is specified, credentials are shown if their attributes match\n"
-    "  any of the patterns. Patterns are matched case-sensitively, and may\n"
-    "  contain glob wildcards:\n"
+    "  one pattern is specified credentials are shown if their attributes match\n"
+    "  all patterns. Patterns are matched case-sensitively and may contain\n"
+    "  glob wildcards:\n"
     "    ?      matches any single character\n"
     "    *      matches a sequence of arbitrary characters\n"
     "    [abc]  matches any of the characters listed inside the brackets\n"
+    "  Note that wildcards will usually need to be quoted or escaped on the\n"
+    "  command line because many command shells will interfere by trying to\n"
+    "  expand them.\n"
     "\n"
     "  If no pattern is specified, all cached credentials are shown.\n"),
    {opt_config_dir, opt_show_passwords} },
 
+  {"delete", subcommand_delete, {"del", "remove", "rm"}, N_
+   ("usage: svnauth delete PATTERN ...\n"
+    "\n"
+    "  Delete cached authentication credentials matching a pattern.\n"
+    "\n"
+    "  All credential attributes except passwords can be matched. If more than \n"
+    "  one pattern is specified credentials are deleted only if their attributes\n"
+    "  match all patterns. Patterns are matched case-sensitively and may contain\n"
+    "  glob wildcards:\n"
+    "    ?      matches any single character\n"
+    "    *      matches a sequence of arbitrary characters\n"
+    "    [abc]  matches any of the characters listed inside the brackets\n"
+    "  Note that wildcards will usually need to be quoted or escaped on the\n"
+    "  command line because many command shells will interfere by trying to\n"
+    "  expand them.\n"),
+   {opt_config_dir} },
+
   {NULL}
 };
 
@@ -140,11 +161,10 @@ parse_args(apr_array_header_t **args,
     SVN_ERR_ASSERT(args);
 
   if ((min_expected >= 0) && (num_args < min_expected))
-    return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0,
-                            "Not enough arguments");
+    return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
   if ((max_expected >= 0) && (num_args > max_expected))
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
-                            "Too many arguments");
+                            _("Too many arguments provided"));
   if (args)
     {
       *args = apr_array_make(pool, num_args, sizeof(const char *));
@@ -165,6 +185,7 @@ subcommand_help(apr_getopt_t *os, void *
   struct svnauth_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svnauth SUBCOMMAND [ARGS & OPTIONS ...]\n"
+      "Subversion authentication credentials management tool.\n"
       "Type 'svnauth help <subcommand>' for help on a specific subcommand.\n"
       "Type 'svnauth --version' to see the program version and available\n"
       "authentication credential caches.\n"
@@ -515,7 +536,9 @@ show_cert_failures(const char *failure_s
 
 struct walk_credentials_baton_t
 {
+  int matches;
   svn_boolean_t list;
+  svn_boolean_t delete;
   svn_boolean_t show_passwords;
   apr_array_header_t *patterns;
 };
@@ -747,9 +770,18 @@ walk_credentials(svn_boolean_t *delete_c
         return SVN_NO_ERROR;
     }
 
+  b->matches++;
+
   if (b->list)
     SVN_ERR(list_credential(cred_kind, realmstring, sorted_cred_items,
                             b->show_passwords, scratch_pool));
+  if (b->delete)
+    {
+      *delete_cred = TRUE;
+      SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                 _("Deleting %s credential for realm '%s'\n"),
+                                 cred_kind, realmstring));
+    }
 
   return SVN_NO_ERROR;
 }
@@ -763,8 +795,10 @@ subcommand_list(apr_getopt_t *os, void *
   const char *config_path;
   struct walk_credentials_baton_t b;
 
+  b.matches = 0;
   b.show_passwords = opt_state->show_passwords;
   b.list = TRUE;
+  b.delete = FALSE;
   SVN_ERR(parse_args(&b.patterns, os, 0, -1, pool));
 
   SVN_ERR(svn_config_get_user_config_path(&config_path,
@@ -773,6 +807,67 @@ subcommand_list(apr_getopt_t *os, void *
 
   SVN_ERR(svn_config_walk_auth_data(config_path, walk_credentials, &b,
                                     pool));
+
+  if (b.matches == 0)
+    {
+      if (b.patterns->nelts == 0)
+        SVN_ERR(svn_cmdline_printf(pool,
+                                   _("Credentials cache in '%s' is empty\n"),
+                                   svn_dirent_local_style(config_path, pool)));
+      else 
+        return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, 0,
+                                 _("Credentials cache in '%s' contains "
+                                   "no matching credentials"),
+                                 svn_dirent_local_style(config_path, pool));
+    }
+  else
+    {
+      if (b.patterns->nelts == 0)
+        SVN_ERR(svn_cmdline_printf(pool,
+                                   _("Credentials cache in '%s' contains %d "
+                                     "credentials\n"),
+                                   svn_dirent_local_style(config_path, pool),
+                                   b.matches));
+      else
+        SVN_ERR(svn_cmdline_printf(pool,
+                                   _("Credentials cache in '%s' contains %d "
+                                     "matching credentials\n"),
+                                   svn_dirent_local_style(config_path, pool),
+                                   b.matches));
+    }
+  return SVN_NO_ERROR;
+}
+
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
+subcommand_delete(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+  struct svnauth_opt_state *opt_state = baton;
+  const char *config_path;
+  struct walk_credentials_baton_t b;
+
+  b.matches = 0;
+  b.show_passwords = opt_state->show_passwords;
+  b.list = FALSE;
+  b.delete = TRUE;
+  SVN_ERR(parse_args(&b.patterns, os, 1, -1, pool));
+
+  SVN_ERR(svn_config_get_user_config_path(&config_path,
+                                          opt_state->config_dir, NULL,
+                                          pool));
+
+  SVN_ERR(svn_config_walk_auth_data(config_path, walk_credentials, &b, pool));
+
+  if (b.matches == 0)
+    return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, 0,
+                             _("Credentials cache in '%s' contains "
+                               "no matching credentials"),
+                             svn_dirent_local_style(config_path, pool));
+  else
+    SVN_ERR(svn_cmdline_printf(pool, _("Deleted %d matching credentials "
+                               "from '%s'\n"), b.matches,
+                               svn_dirent_local_style(config_path, pool)));
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c Tue Oct 15 22:57:03 2013
@@ -1146,6 +1146,7 @@ subcommand_help(apr_getopt_t *os, void *
   struct svndumpfilter_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svndumpfilter SUBCOMMAND [ARGS & OPTIONS ...]\n"
+      "Subversion repository dump filtering tool.\n"
       "Type 'svndumpfilter help <subcommand>' for help on a "
       "specific subcommand.\n"
       "Type 'svndumpfilter --version' to see the program version.\n"

Modified: subversion/branches/fsfs-improvements/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnlook/svnlook.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnlook/svnlook.c Tue Oct 15 22:57:03 2013
@@ -2212,11 +2212,12 @@ subcommand_help(apr_getopt_t *os, void *
   struct svnlook_opt_state *opt_state = baton;
   const char *header =
     _("general usage: svnlook SUBCOMMAND REPOS_PATH [ARGS & OPTIONS ...]\n"
+      "Subversion repository inspection tool.\n"
+      "Type 'svnlook help <subcommand>' for help on a specific subcommand.\n"
+      "Type 'svnlook --version' to see the program version and FS modules.\n"
       "Note: any subcommand which takes the '--revision' and '--transaction'\n"
       "      options will, if invoked without one of those options, act on\n"
       "      the repository's youngest revision.\n"
-      "Type 'svnlook help <subcommand>' for help on a specific subcommand.\n"
-      "Type 'svnlook --version' to see the program version and FS modules.\n"
       "\n"
       "Available subcommands:\n");
 

Modified: subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c Tue Oct 15 22:57:03 2013
@@ -922,8 +922,9 @@ usage(apr_pool_t *pool, int exit_val)
 {
   FILE *stream = exit_val == EXIT_SUCCESS ? stdout : stderr;
   svn_error_clear(svn_cmdline_fputs(
-    _("Subversion multiple URL command client\n"
-      "usage: svnmucc ACTION...\n"
+    _("usage: svnmucc ACTION...\n"
+      "Subversion multiple URL command client.\n"
+      "Type 'svnmucc --version' to see the program version.\n"
       "\n"
       "  Perform one or more Subversion repository URL-based ACTIONs, committing\n"
       "  the result as a (single) new revision.\n"

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

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



Mime
View raw message