You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/08/02 21:09:24 UTC

svn commit: r1368653 [3/4] - in /subversion/branches/master-passphrase: ./ contrib/client-side/svn-push/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/swig/ subversion/bindings/swig/...

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c Thu Aug  2 19:09:21 2012
@@ -6546,8 +6546,17 @@ svn_wc__db_revert_list_done(svn_wc__db_t
 /* Baton for remove_node_txn */
 struct remove_node_baton
 {
+  svn_wc__db_t *db;
+  svn_boolean_t left_changes;
+  svn_boolean_t destroy_wc;
+  svn_boolean_t destroy_changes;
   svn_revnum_t not_present_rev;
+  svn_wc__db_status_t not_present_status;
   svn_kind_t not_present_kind;
+  const svn_skel_t *conflict;
+  const svn_skel_t *work_items;
+  svn_cancel_func_t cancel_func;
+  void *cancel_baton;
 };
 
 /* Implements svn_wc__db_txn_callback_t for svn_wc__db_op_remove_node */
@@ -6563,7 +6572,11 @@ remove_node_txn(void *baton,
   apr_int64_t repos_id;
   const char *repos_relpath;
 
-  SVN_ERR_ASSERT(*local_relpath != '\0'); /* Never on a wcroot */
+  /* Note that unlike many similar functions it is a valid scenario for this
+     function to be called on a wcroot! */
+
+   /* db set when destroying wc */
+  SVN_ERR_ASSERT(!rnb->destroy_wc || rnb->db != NULL);
 
   /* Need info for not_present node? */
   if (SVN_IS_VALID_REVNUM(rnb->not_present_rev))
@@ -6573,14 +6586,189 @@ remove_node_txn(void *baton,
                           wcroot, local_relpath,
                           scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE));
+  if (rnb->destroy_wc
+      && (!rnb->destroy_changes || *local_relpath == '\0'))
+    {
+      svn_boolean_t have_row;
+      apr_pool_t *iterpool;
+      svn_error_t *err = NULL;
 
-  /* Remove all nodes at or below local_relpath where op_depth >= 0 */
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd",
-                            wcroot->wc_id, local_relpath, 0));
+      /* Install WQ items for deleting the unmodified files and all dirs */
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_SELECT_WORKING_PRESENT));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is",
+                                wcroot->wc_id, local_relpath));
+
+      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+      iterpool = svn_pool_create(scratch_pool);
+
+      while (have_row)
+        {
+          const char *child_relpath;
+          const char *child_abspath;
+          svn_kind_t child_kind;
+          svn_boolean_t have_checksum;
+          svn_filesize_t recorded_size;
+          apr_int64_t recorded_mod_time;
+          const svn_io_dirent2_t *dirent;
+          svn_boolean_t modified_p = TRUE;
+          svn_skel_t *work_item = NULL;
+
+          svn_pool_clear(iterpool);
+
+          child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
+          child_kind = svn_sqlite__column_token(stmt, 1, kind_map);
+
+          child_abspath = svn_dirent_join(wcroot->abspath, child_relpath,
+                                          iterpool);
+
+          if (child_kind == svn_kind_file)
+            {
+              have_checksum = !svn_sqlite__column_is_null(stmt, 2);
+              recorded_size = get_recorded_size(stmt, 3);
+              recorded_mod_time = svn_sqlite__column_int64(stmt, 4);
+            }
+
+          if (rnb->cancel_func)
+            err = rnb->cancel_func(rnb->cancel_baton);
+
+          if (err)
+            break;
+
+          err = svn_io_stat_dirent(&dirent, child_abspath, TRUE,
+                                   iterpool, iterpool);
+
+          if (err)
+            break;
+
+          if (rnb->destroy_changes
+              || dirent->kind != svn_node_file
+              || child_kind != svn_kind_file)
+            {
+              /* Not interested in keeping changes */
+              modified_p = FALSE; 
+            }
+          else if (child_kind == svn_kind_file
+                   && dirent->kind == svn_node_file
+                   && dirent->filesize == recorded_size
+                   && dirent->mtime == recorded_mod_time)
+            {
+              modified_p = FALSE; /* File matches recorded state */
+            }
+          else if (have_checksum)
+            err = svn_wc__internal_file_modified_p(&modified_p,
+                                                   rnb->db, child_abspath,
+                                                   FALSE, iterpool);
+
+          if (err)
+            break;
+
+          if (modified_p)
+            rnb->left_changes = TRUE;
+          else if (child_kind == svn_kind_dir)
+            {
+              err = svn_wc__wq_build_dir_remove(&work_item,
+                                                rnb->db, wcroot->abspath,
+                                                child_abspath, FALSE,
+                                                iterpool, iterpool);
+            }
+          else /* svn_kind_file || svn_kind_symlink */
+            {
+              err = svn_wc__wq_build_file_remove(&work_item,
+                                                 rnb->db, wcroot->abspath,
+                                                 child_abspath,
+                                                 iterpool, iterpool);
+            }
+
+          if (err)
+            break;
+
+          if (work_item)
+            {
+              err = add_work_items(wcroot->sdb, work_item, iterpool);
+              if (err)
+                break;
+            }
+
+          SVN_ERR(svn_sqlite__step(&have_row, stmt));
+        }
+      svn_pool_destroy(iterpool);
+
+      SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
+    }
+
+  if (rnb->destroy_wc && *local_relpath != '\0')
+    {
+      /* Create work item for destroying the root */
+      svn_wc__db_status_t status;
+      svn_kind_t kind;
+      SVN_ERR(read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL, NULL,
+                        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                        wcroot, local_relpath,
+                        scratch_pool, scratch_pool));
+
+      if (status == svn_wc__db_status_normal
+          || status == svn_wc__db_status_added
+          || status == svn_wc__db_status_incomplete)
+        {
+          svn_skel_t *work_item = NULL;
+          const char *local_abspath = svn_dirent_join(wcroot->abspath,
+                                                          local_relpath,
+                                                          scratch_pool);
+
+          if (kind == svn_kind_dir)
+            {
+              SVN_ERR(svn_wc__wq_build_dir_remove(&work_item,
+                                                  rnb->db, wcroot->abspath,
+                                                  local_abspath,
+                                                  rnb->destroy_changes
+                                                      /* recursive */,
+                                                  scratch_pool, scratch_pool));
+            }
+          else
+            {
+              svn_boolean_t modified_p = FALSE;
+
+              if (!rnb->destroy_changes)
+                {
+                  SVN_ERR(svn_wc__internal_file_modified_p(&modified_p,
+                                                           rnb->db,
+                                                           local_abspath,
+                                                           FALSE,
+                                                           scratch_pool));
+                }
+
+              if (!modified_p)
+                SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+                                                     rnb->db, wcroot->abspath,
+                                                     local_abspath,
+                                                     scratch_pool,
+                                                     scratch_pool));
+              else
+                rnb->left_changes = TRUE;
+            }
+
+          SVN_ERR(add_work_items(wcroot->sdb, work_item, scratch_pool));
+        }
+    }
+
+  /* Remove all nodes below local_relpath */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_DELETE_NODE_RECURSIVE));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath, 0));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
+  /* Delete the root NODE when this is not the working copy root */
+  if (local_relpath[0] != '\0')
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_DELETE_NODE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath, 0));
+      SVN_ERR(svn_sqlite__step_done(stmt));
+    }
+
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_ACTUAL_NODE_RECURSIVE));
 
@@ -6596,7 +6784,11 @@ remove_node_txn(void *baton,
       blank_ibb(&ibb);
 
       ibb.repos_id = repos_id;
-      ibb.status = svn_wc__db_status_not_present;
+
+      SVN_ERR_ASSERT(rnb->not_present_status == svn_wc__db_status_not_present
+                     || rnb->not_present_status == svn_wc__db_status_excluded);
+
+      ibb.status = rnb->not_present_status;
       ibb.kind = rnb->not_present_kind;
 
       ibb.repos_relpath = repos_relpath;
@@ -6605,14 +6797,26 @@ remove_node_txn(void *baton,
       SVN_ERR(insert_base_node(&ibb, wcroot, local_relpath, scratch_pool));
     }
 
+  SVN_ERR(add_work_items(wcroot->sdb, rnb->work_items, scratch_pool));
+  if (rnb->conflict)
+    SVN_ERR(mark_conflict(wcroot, local_relpath, rnb->conflict, scratch_pool));
+
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
-svn_wc__db_op_remove_node(svn_wc__db_t *db,
+svn_wc__db_op_remove_node(svn_boolean_t *left_changes,
+                          svn_wc__db_t *db,
                           const char *local_abspath,
+                          svn_boolean_t destroy_wc,
+                          svn_boolean_t destroy_changes,
                           svn_revnum_t not_present_revision,
+                          svn_wc__db_status_t not_present_status,
                           svn_kind_t not_present_kind,
+                          const svn_skel_t *conflict,
+                          const svn_skel_t *work_items,
+                          svn_cancel_func_t cancel_func,
+                          void *cancel_baton,
                           apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
@@ -6625,8 +6829,17 @@ svn_wc__db_op_remove_node(svn_wc__db_t *
                               local_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
+  rnb.db = db;
+  rnb.left_changes = FALSE;
+  rnb.destroy_wc = destroy_wc;
+  rnb.destroy_changes = destroy_changes;
   rnb.not_present_rev = not_present_revision;
+  rnb.not_present_status = not_present_status;
   rnb.not_present_kind = not_present_kind;
+  rnb.conflict = conflict;
+  rnb.work_items = work_items;
+  rnb.cancel_func = cancel_func;
+  rnb.cancel_baton = cancel_baton;
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, remove_node_txn,
                               &rnb, scratch_pool));
@@ -6635,6 +6848,9 @@ svn_wc__db_op_remove_node(svn_wc__db_t *
   SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_infinity,
                         scratch_pool));
 
+  if (left_changes)
+    *left_changes = rnb.left_changes;
+
   return SVN_NO_ERROR;
 }
 
@@ -8574,8 +8790,15 @@ read_url_txn(void *baton,
           else
             {
               /* The parent of the WORKING delete, must be an addition */
-              const char *work_relpath = svn_relpath_dirname(work_del_relpath,
-                                                             scratch_pool);
+              const char *work_relpath = NULL;
+
+              /* work_del_relpath should not be NULL. However, we have
+               * observed instances where that assumption was not met.
+               * Bail out in that case instead of crashing with a segfault.
+               */
+              SVN_ERR_ASSERT(work_del_relpath != NULL);
+              work_relpath = svn_relpath_dirname(work_del_relpath,
+                                                 scratch_pool);
 
               SVN_ERR(scan_addition(NULL, NULL, &repos_relpath, &repos_id,
                                     NULL, NULL, NULL, NULL, NULL, NULL,
@@ -12286,7 +12509,8 @@ svn_wc__db_read_kind(svn_kind_t *kind,
         SVN_ERR(convert_to_working_status(&status, status));
 
       if (status == svn_wc__db_status_not_present
-          || status == svn_wc__db_status_excluded)
+          || status == svn_wc__db_status_excluded
+          || status == svn_wc__db_status_server_excluded)
         {
           *kind = svn_kind_none;
           SVN_ERR(svn_sqlite__reset(stmt_info));

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h Thu Aug  2 19:09:21 2012
@@ -2838,19 +2838,39 @@ svn_wc__db_wclock_owns_lock(svn_boolean_
 */
 
 /* Removes all references to LOCAL_ABSPATH from DB, while optionally leaving
-   tree conflicts and/or a not present node.
+   a not present node.
 
    This operation always recursively removes all nodes at and below
    LOCAL_ABSPATH from NODES and ACTUAL.
 
    If NOT_PRESENT_REVISION specifies a valid revision, leave a not_present
-   BASE node at local_abspath. (Requires an existing BASE node before removing)
+   BASE node at local_abspath of the specified status and kind.
+   (Requires an existing BASE node before removing)
+
+   If DESTROY_WC is TRUE, this operation *installs* workqueue operations to
+   update the local filesystem after the database operation. If DESTROY_CHANGES
+   is FALSE, modified and unversioned files are left after running this
+   operation (and the WQ). If DESTROY_CHANGES and DESTROY_WC are TRUE,
+   LOCAL_ABSPATH and everything below it will be removed by the WQ.
+
+
+   Note: Unlike many similar functions it is a valid scenario for this
+   function to be called on a wcroot! In this case it will just leave the root
+   record in BASE
  */
 svn_error_t *
-svn_wc__db_op_remove_node(svn_wc__db_t *db,
+svn_wc__db_op_remove_node(svn_boolean_t *left_changes,
+                          svn_wc__db_t *db,
                           const char *local_abspath,
+                          svn_boolean_t destroy_wc,
+                          svn_boolean_t destroy_changes,
                           svn_revnum_t not_present_revision,
+                          svn_wc__db_status_t not_present_status,
                           svn_kind_t not_present_kind,
+                          const svn_skel_t *conflict,
+                          const svn_skel_t *work_items,
+                          svn_cancel_func_t cancel_func,
+                          void *cancel_baton,
                           apr_pool_t *scratch_pool);
 
 /* Sets the depth of LOCAL_ABSPATH in its working copy to DEPTH using DB.

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_pristine.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_pristine.c Thu Aug  2 19:09:21 2012
@@ -855,11 +855,12 @@ pristine_cleanup_wcroot(svn_wc__db_wcroo
                         apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
+  svn_error_t *err = NULL;
 
   /* Find each unreferenced pristine in the DB and remove it. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_UNREFERENCED_PRISTINES));
-  while (1)
+  while (! err)
     {
       svn_boolean_t have_row;
       const svn_checksum_t *sha1_checksum;
@@ -870,12 +871,12 @@ pristine_cleanup_wcroot(svn_wc__db_wcroo
 
       SVN_ERR(svn_sqlite__column_checksum(&sha1_checksum, stmt, 0,
                                           scratch_pool));
-      SVN_ERR(pristine_remove_if_unreferenced(wcroot, sha1_checksum,
-                                              scratch_pool));
+      err = pristine_remove_if_unreferenced(wcroot, sha1_checksum,
+                                            scratch_pool);
     }
-  SVN_ERR(svn_sqlite__reset(stmt));
 
-  return SVN_NO_ERROR;
+  return svn_error_trace(
+      svn_error_compose_create(err, svn_sqlite__reset(stmt)));
 }
 
 svn_error_t *

Modified: subversion/branches/master-passphrase/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/main.c Thu Aug  2 19:09:21 2012
@@ -1564,8 +1564,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);
 }
 
@@ -1591,14 +1591,28 @@ svn_cl__check_cancel(void *baton)
     return SVN_NO_ERROR;
 }
 
+
 
 /*** Main. ***/
 
-int
-main(int argc, const char *argv[])
+/* Report and clear the error ERR, and return EXIT_FAILURE. */
+#define EXIT_ERROR(err)                                                 \
+  svn_cmdline_handle_exit_error(err, NULL, "svn: ")
+
+/* A redefinition of the public SVN_INT_ERR macro, that suppresses the
+ * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR. */
+#undef SVN_INT_ERR
+#define SVN_INT_ERR(expr)                                        \
+  do {                                                           \
+    svn_error_t *svn_err__temp = (expr);                         \
+    if (svn_err__temp)                                           \
+      return EXIT_ERROR(svn_err__temp);                          \
+  } while (0)
+
+static int
+sub_main(int argc, const char *argv[], apr_pool_t *pool)
 {
   svn_error_t *err;
-  apr_pool_t *pool;
   int opt_id;
   apr_getopt_t *os;
   svn_cl__opt_state_t opt_state = { 0, { 0 } };
@@ -1615,35 +1629,21 @@ main(int argc, const char *argv[])
   svn_boolean_t use_notifier = TRUE;
   apr_hash_t *changelists;
 
-  /* Initialize the app. */
-  if (svn_cmdline_init("svn", stderr) != EXIT_SUCCESS)
-    return EXIT_FAILURE;
-
-  /* Create our top-level pool.  Use a separate mutexless allocator,
-   * given this application is single threaded.
-   */
-  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
-  err = check_lib_versions();
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(check_lib_versions());
 
 #if defined(WIN32) || defined(__CYGWIN__)
   /* Set the working copy administrative directory name. */
   if (getenv("SVN_ASP_DOT_NET_HACK"))
     {
-      err = svn_wc_set_adm_dir("_svn", pool);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      SVN_INT_ERR(svn_wc_set_adm_dir("_svn", pool));
     }
 #endif
 
   /* Initialize the RA library. */
-  err = svn_ra_initialize(pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_ra_initialize(pool));
 
   /* Init our changelists hash. */
   changelists = apr_hash_make(pool);
@@ -1662,14 +1662,11 @@ main(int argc, const char *argv[])
   if (argc <= 1)
     {
       svn_cl__help(NULL, NULL, pool);
-      svn_pool_destroy(pool);
       return EXIT_FAILURE;
     }
 
   /* Else, parse options. */
-  err = svn_cmdline__getopt_init(&os, argc, argv, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
 
   os->interleave = 1;
   while (1)
@@ -1685,7 +1682,6 @@ main(int argc, const char *argv[])
       else if (apr_err)
         {
           svn_cl__help(NULL, NULL, pool);
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
 
@@ -1700,13 +1696,13 @@ main(int argc, const char *argv[])
             {
               err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                      _("Non-numeric limit argument given"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
           if (opt_state.limit <= 0)
             {
               err = svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
                                     _("Argument to --limit must be positive"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
         }
         break;
@@ -1727,7 +1723,7 @@ main(int argc, const char *argv[])
               err = svn_error_create
                 (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                  _("Can't specify -c with --old"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
 
           for (i = 0; i < change_revs->nelts; i++)
@@ -1760,7 +1756,7 @@ main(int argc, const char *argv[])
                                               _("Negative number in range (%s)"
                                                 " not supported with -c"),
                                               change_str);
-                      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                      return EXIT_ERROR(err);
                     }
                   s = end + 1;
                   while (*s == 'r')
@@ -1772,14 +1768,14 @@ main(int argc, const char *argv[])
                   err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                           _("Non-numeric change argument (%s) "
                                             "given to -c"), change_str);
-                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                  return EXIT_ERROR(err);
                 }
 
               if (changeno == 0)
                 {
                   err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                          _("There is no change 0"));
-                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                  return EXIT_ERROR(err);
                 }
 
               if (is_negative)
@@ -1818,13 +1814,12 @@ main(int argc, const char *argv[])
         if (svn_opt_parse_revision_to_range(opt_state.revision_ranges,
                                             opt_arg, pool) != 0)
           {
-            err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-            if (! err)
-              err = svn_error_createf
+            SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+            err = svn_error_createf
                 (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                  _("Syntax error in revision argument '%s'"),
                  utf8_opt_arg);
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+            return EXIT_ERROR(err);
           }
         break;
       case 'v':
@@ -1844,12 +1839,9 @@ main(int argc, const char *argv[])
         opt_state.incremental = TRUE;
         break;
       case 'F':
-        err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-        if (! err)
-          err = svn_stringbuf_from_file2(&(opt_state.filedata),
-                                         utf8_opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+        SVN_INT_ERR(svn_stringbuf_from_file2(&(opt_state.filedata),
+                                             utf8_opt_arg, pool));
         dash_F_arg = opt_arg;
         break;
       case opt_targets:
@@ -1860,14 +1852,9 @@ main(int argc, const char *argv[])
              the targets into an array, because otherwise we wouldn't
              know what delimiter to use for svn_cstring_split().  */
 
-          err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-
-          if (! err)
-            err = svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool);
-          if (! err)
-            err = svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool);
-          if (err)
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+          SVN_INT_ERR(svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool));
+          SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
           opt_state.targets = svn_cstring_split(buffer_utf8->data, "\n\r",
                                                 TRUE, pool);
         }
@@ -1893,55 +1880,51 @@ main(int argc, const char *argv[])
       case opt_depth:
         err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
         if (err)
-          return svn_cmdline_handle_exit_error
-            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+          return EXIT_ERROR
+            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                _("Error converting depth "
-                                 "from locale to UTF-8")), pool, "svn: ");
+                                 "from locale to UTF-8")));
         opt_state.depth = svn_depth_from_word(utf8_opt_arg);
         if (opt_state.depth == svn_depth_unknown
             || opt_state.depth == svn_depth_exclude)
           {
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("'%s' is not a valid depth; try "
                                    "'empty', 'files', 'immediates', "
                                    "or 'infinity'"),
-                                 utf8_opt_arg), pool, "svn: ");
+                                 utf8_opt_arg));
           }
         break;
       case opt_set_depth:
         err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
         if (err)
-          return svn_cmdline_handle_exit_error
-            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+          return EXIT_ERROR
+            (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                _("Error converting depth "
-                                 "from locale to UTF-8")), pool, "svn: ");
+                                 "from locale to UTF-8")));
         opt_state.set_depth = svn_depth_from_word(utf8_opt_arg);
         /* svn_depth_exclude is okay for --set-depth. */
         if (opt_state.set_depth == svn_depth_unknown)
           {
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("'%s' is not a valid depth; try "
                                    "'exclude', 'empty', 'files', "
                                    "'immediates', or 'infinity'"),
-                                 utf8_opt_arg), pool, "svn: ");
+                                 utf8_opt_arg));
           }
         break;
       case opt_version:
         opt_state.version = TRUE;
         break;
       case opt_auth_username:
-        err = svn_utf_cstring_to_utf8(&opt_state.auth_username,
-                                      opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_username,
+                                            opt_arg, pool));
         break;
       case opt_auth_password:
-        err = svn_utf_cstring_to_utf8(&opt_state.auth_password,
-                                      opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_password,
+                                            opt_arg, pool));
         break;
       case opt_encoding:
         opt_state.encoding = apr_pstrdup(pool, opt_arg);
@@ -1989,9 +1972,8 @@ main(int argc, const char *argv[])
         opt_state.relocate = TRUE;
         break;
       case 'x':
-        err = svn_utf_cstring_to_utf8(&opt_state.extensions, opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.extensions,
+                                            opt_arg, pool));
         break;
       case opt_diff_cmd:
         opt_state.diff.diff_cmd = apr_pstrdup(pool, opt_arg);
@@ -2014,7 +1996,7 @@ main(int argc, const char *argv[])
             err = svn_error_create
               (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                _("Can't specify -c with --old"));
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+            return EXIT_ERROR(err);
           }
         opt_state.old_target = apr_pstrdup(pool, opt_arg);
         break;
@@ -2024,9 +2006,7 @@ main(int argc, const char *argv[])
       case opt_config_dir:
         {
           const char *path_utf8;
-          err = svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool);
-          if (err)
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          SVN_INT_ERR(svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool));
           opt_state.config_dir = svn_dirent_internal_style(path_utf8, pool);
         }
         break;
@@ -2036,12 +2016,9 @@ main(int argc, const char *argv[])
                    apr_array_make(pool, 1,
                                   sizeof(svn_cmdline__config_argument_t*));
 
-        err = svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool);
-        if (!err)
-          err = svn_cmdline__parse_config_option(opt_state.config_options,
-                                                 opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+        SVN_INT_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
+                                                     opt_arg, pool));
         break;
       case opt_autoprops:
         opt_state.autoprops = TRUE;
@@ -2055,13 +2032,12 @@ main(int argc, const char *argv[])
           opt_state.native_eol = apr_pstrdup(pool, opt_arg);
         else
           {
-            err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
-            if (! err)
-              err = svn_error_createf
+            SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+            err = svn_error_createf
                 (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                  _("Syntax error in native-eol argument '%s'"),
                  utf8_opt_arg);
-            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+            return EXIT_ERROR(err);
           }
         break;
       case opt_no_unlock:
@@ -2093,9 +2069,8 @@ main(int argc, const char *argv[])
         opt_state.no_revprops = TRUE;
         break;
       case opt_with_revprop:
-        err = svn_opt_parse_revprop(&opt_state.revprop_table, opt_arg, pool);
-        if (err != SVN_NO_ERROR)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        SVN_INT_ERR(svn_opt_parse_revprop(&opt_state.revprop_table,
+                                          opt_arg, pool));
         break;
       case opt_parents:
         opt_state.parents = TRUE;
@@ -2106,20 +2081,18 @@ main(int argc, const char *argv[])
       case opt_accept:
         opt_state.accept_which = svn_cl__accept_from_word(opt_arg);
         if (opt_state.accept_which == svn_cl__accept_invalid)
-          return svn_cmdline_handle_exit_error
+          return EXIT_ERROR
             (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                _("'%s' is not a valid --accept value"),
-                               opt_arg),
-             pool, "svn: ");
+                               opt_arg));
         break;
       case opt_show_revs:
         opt_state.show_revs = svn_cl__show_revs_from_word(opt_arg);
         if (opt_state.show_revs == svn_cl__show_revs_invalid)
-          return svn_cmdline_handle_exit_error
+          return EXIT_ERROR
             (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                _("'%s' is not a valid --show-revs value"),
-                               opt_arg),
-             pool, "svn: ");
+                               opt_arg));
         break;
       case opt_reintegrate:
         opt_state.reintegrate = TRUE;
@@ -2131,13 +2104,13 @@ main(int argc, const char *argv[])
             {
               err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                       _("Invalid strip count '%s'"), opt_arg);
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
           if (opt_state.strip < 0)
             {
               err = svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
                                      _("Argument to --strip must be positive"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
         }
         break;
@@ -2186,9 +2159,7 @@ main(int argc, const char *argv[])
     }
 
   /* Turn our hash of changelists into an array of unique ones. */
-  err = svn_hash_keys(&(opt_state.changelists), changelists, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_hash_keys(&(opt_state.changelists), changelists, pool));
 
   /* ### This really belongs in libsvn_client.  The trouble is,
      there's no one place there to run it from, no
@@ -2200,9 +2171,7 @@ main(int argc, const char *argv[])
      hand, the alternative is effectively to demand that they call
      svn_config_ensure() instead, so maybe we should have a generic
      init function anyway.  Thoughts?  */
-  err = svn_config_ensure(opt_state.config_dir, pool);
-  if (err)
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_config_ensure(opt_state.config_dir, pool));
 
   /* If the user asked for help, then the rest of the arguments are
      the names of subcommands to get help on (if any), or else they're
@@ -2235,7 +2204,6 @@ main(int argc, const char *argv[])
                 (svn_cmdline_fprintf(stderr, pool,
                                      _("Subcommand argument required\n")));
               svn_cl__help(NULL, NULL, pool);
-              svn_pool_destroy(pool);
               return EXIT_FAILURE;
             }
         }
@@ -2247,15 +2215,13 @@ main(int argc, const char *argv[])
           if (subcommand == NULL)
             {
               const char *first_arg_utf8;
-              err = svn_utf_cstring_to_utf8(&first_arg_utf8, first_arg, pool);
-              if (err)
-                return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              SVN_INT_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8,
+                                                  first_arg, pool));
               svn_error_clear
                 (svn_cmdline_fprintf(stderr, pool,
                                      _("Unknown command: '%s'\n"),
                                      first_arg_utf8));
               svn_cl__help(NULL, NULL, pool);
-              svn_pool_destroy(pool);
               return EXIT_FAILURE;
             }
         }
@@ -2289,7 +2255,6 @@ main(int argc, const char *argv[])
                (stderr, pool, _("Subcommand '%s' doesn't accept option '%s'\n"
                                 "Type 'svn help %s' for usage.\n"),
                 subcommand->name, optstr, subcommand->name));
-          svn_pool_destroy(pool);
           return EXIT_FAILURE;
         }
     }
@@ -2304,7 +2269,7 @@ main(int argc, const char *argv[])
                                  _("Multiple revision arguments "
                                    "encountered; can't specify -c twice, "
                                    "or both -c and -r"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
     }
 
@@ -2315,7 +2280,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--depth and --set-depth are mutually "
                                "exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both --with-all-revprops and
@@ -2325,7 +2290,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--with-all-revprops and --with-no-revprops "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both --with-revprop and
@@ -2335,7 +2300,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--with-revprop and --with-no-revprops "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both -m and -F, when they are
@@ -2348,7 +2313,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--message (-m) and --file (-F) "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* --trust-server-cert can only be used with --non-interactive */
@@ -2357,7 +2322,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--trust-server-cert requires "
                                "--non-interactive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Disallow simultaneous use of both --diff-cmd and
@@ -2367,7 +2332,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("--diff-cmd and --internal-diff "
                                "are mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      return EXIT_ERROR(err);
     }
 
   /* Ensure that 'revision_ranges' has at least one item, and make
@@ -2387,8 +2352,7 @@ main(int argc, const char *argv[])
 
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
-  if ((err = svn_client_create_context(&ctx, pool)))
-    return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+  SVN_INT_ERR(svn_client_create_context(&ctx, pool));
   command_baton.ctx = ctx;
 
   /* If we're running a command that could result in a commit, verify
@@ -2435,7 +2399,7 @@ main(int argc, const char *argv[])
                          _("Lock comment file is a versioned file; "
                            "use '--force-log' to override"));
                     }
-                  return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                  return EXIT_ERROR(err);
                 }
             }
           svn_error_clear(err);
@@ -2463,7 +2427,7 @@ main(int argc, const char *argv[])
                      _("The lock comment is a pathname "
                        "(was -F intended?); use '--force-log' to override"));
                 }
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+              return EXIT_ERROR(err);
             }
         }
     }
@@ -2476,7 +2440,7 @@ main(int argc, const char *argv[])
           err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                                  _("--relocate and --depth are mutually "
                                    "exclusive"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
       if (! descend)
         {
@@ -2484,7 +2448,7 @@ main(int argc, const char *argv[])
                     SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                     _("--relocate and --non-recursive (-N) are mutually "
                       "exclusive"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
     }
 
@@ -2499,7 +2463,7 @@ main(int argc, const char *argv[])
       if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
         {
           err = svn_error_create(SVN_ERR_CLIENT_REVISION_RANGE, NULL, NULL);
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          return EXIT_ERROR(err);
         }
     }
 
@@ -2539,7 +2503,7 @@ main(int argc, const char *argv[])
           svn_error_clear(err);
         }
       else
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+        return EXIT_ERROR(err);
     }
 
   cfg_config = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
@@ -2572,38 +2536,7 @@ main(int argc, const char *argv[])
       err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                              _("--auto-props and --no-auto-props are "
                                "mutually exclusive"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-    }
-
-  /* The --reintegrate option is mutually exclusive with both
-     --ignore-ancestry and --record-only. */
-  if (opt_state.reintegrate)
-    {
-      if (opt_state.ignore_ancestry)
-        {
-          if (opt_state.record_only)
-            {
-              err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                     _("--reintegrate cannot be used with "
-                                       "--ignore-ancestry or "
-                                       "--record-only"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-            }
-          else
-            {
-              err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                     _("--reintegrate cannot be used with "
-                                       "--ignore-ancestry"));
-              return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-            }
-          }
-      else if (opt_state.record_only)
-        {
-          err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                 _("--reintegrate cannot be used with "
-                                   "--record-only"));
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-        }
+      return EXIT_ERROR(err);
     }
 
   /* Update auto-props-enable option, and populate the MIME types map,
@@ -2617,9 +2550,8 @@ main(int argc, const char *argv[])
                      SVN_CONFIG_OPTION_MIMETYPES_FILE, FALSE);
       if (mimetypes_file && *mimetypes_file)
         {
-          if ((err = svn_io_parse_mimetypes_file(&(ctx->mimetypes_map),
-                                                 mimetypes_file, pool)))
-            svn_handle_error2(err, stderr, TRUE, "svn: ");
+          SVN_INT_ERR(svn_io_parse_mimetypes_file(&(ctx->mimetypes_map),
+                                                  mimetypes_file, pool));
         }
 
       if (opt_state.autoprops)
@@ -2657,9 +2589,8 @@ main(int argc, const char *argv[])
     use_notifier = FALSE;
   if (use_notifier)
     {
-      err = svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2, pool);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      SVN_INT_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
+                                       pool));
     }
 
   /* Set up our cancellation support. */
@@ -2689,28 +2620,26 @@ main(int argc, const char *argv[])
 #endif
 
   /* Set up Authentication stuff. */
-  if ((err = svn_cmdline_create_auth_baton(&ab,
-                                           opt_state.non_interactive,
-                                           opt_state.auth_username,
-                                           opt_state.auth_password,
-                                           opt_state.config_dir,
-                                           opt_state.no_auth_cache,
-                                           opt_state.trust_server_cert,
-                                           cfg_config,
-                                           ctx->cancel_func,
-                                           ctx->cancel_baton,
-                                           pool)))
-    svn_handle_error2(err, stderr, TRUE, "svn: ");
+  SVN_INT_ERR(svn_cmdline_create_auth_baton(&ab,
+                                            opt_state.non_interactive,
+                                            opt_state.auth_username,
+                                            opt_state.auth_password,
+                                            opt_state.config_dir,
+                                            opt_state.no_auth_cache,
+                                            opt_state.trust_server_cert,
+                                            cfg_config,
+                                            ctx->cancel_func,
+                                            ctx->cancel_baton,
+                                            pool));
 
   ctx->auth_baton = ab;
 
   /* Set up conflict resolution callback. */
-  if ((err = svn_config_get_bool(cfg_config, &interactive_conflicts,
-                                 SVN_CONFIG_SECTION_MISCELLANY,
-                                 SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS,
-                                 TRUE)))  /* ### interactivity on by default.
-                                                 we can change this. */
-    svn_handle_error2(err, stderr, TRUE, "svn: ");
+  SVN_INT_ERR(svn_config_get_bool(cfg_config, &interactive_conflicts,
+                                  SVN_CONFIG_SECTION_MISCELLANY,
+                                  SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS,
+                                  TRUE));  /* ### interactivity on by default.
+                                                  we can change this. */
 
   /* The new svn behavior is to postpone everything until after the operation
      completed */
@@ -2739,18 +2668,16 @@ main(int argc, const char *argv[])
       if (opt_state.non_interactive)
         {
           if (opt_state.accept_which == svn_cl__accept_edit)
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("--accept=%s incompatible with"
-                                   " --non-interactive"), SVN_CL__ACCEPT_EDIT),
-               pool, "svn: ");
+                                   " --non-interactive"), SVN_CL__ACCEPT_EDIT));
           if (opt_state.accept_which == svn_cl__accept_launch)
-            return svn_cmdline_handle_exit_error
+            return EXIT_ERROR
               (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                  _("--accept=%s incompatible with"
                                    " --non-interactive"),
-                                 SVN_CL__ACCEPT_LAUNCH),
-               pool, "svn: ");
+                                 SVN_CL__ACCEPT_LAUNCH));
         }
 
       opt_state.conflict_func = svn_cl__conflict_handler;
@@ -2792,29 +2719,35 @@ main(int argc, const char *argv[])
                          "(type 'svn help cleanup' for details)"));
         }
 
-      /* Issue #3014:
-       * Don't print anything on broken pipes. The pipe was likely
-       * closed by the process at the other end. We expect that
-       * process to perform error reporting as necessary.
-       *
-       * ### This assumes that there is only one error in a chain for
-       * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */
-      if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR)
-        svn_handle_error2(err, stderr, FALSE, "svn: ");
-
-      svn_error_clear(err);
-      svn_pool_destroy(pool);
-      return EXIT_FAILURE;
+      return EXIT_ERROR(err);
     }
   else
     {
       /* Ensure that stdout is flushed, so the user will see any write errors.
          This makes sure that output is not silently lost. */
-      err = svn_cmdline_fflush(stdout);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+      SVN_INT_ERR(svn_cmdline_fflush(stdout));
 
-      svn_pool_destroy(pool);
       return EXIT_SUCCESS;
     }
 }
+
+int
+main(int argc, const char *argv[])
+{
+  apr_pool_t *pool;
+  int exit_code;
+
+  /* Initialize the app. */
+  if (svn_cmdline_init("svn", stderr) != EXIT_SUCCESS)
+    return EXIT_FAILURE;
+
+  /* Create our top-level pool.  Use a separate mutexless allocator,
+   * given this application is single threaded.
+   */
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
+
+  exit_code = sub_main(argc, argv, pool);
+
+  svn_pool_destroy(pool);
+  return exit_code;
+}

Modified: subversion/branches/master-passphrase/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/merge-cmd.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/merge-cmd.c Thu Aug  2 19:09:21 2012
@@ -371,6 +371,16 @@ svn_cl__merge(apr_getopt_t *os,
   /* More input validation. */
   if (opt_state->reintegrate)
     {
+      if (opt_state->ignore_ancestry)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--reintegrate cannot be used with "
+                                  "--ignore-ancestry"));
+
+      if (opt_state->record_only)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--reintegrate cannot be used with "
+                                  "--record-only"));
+
       if (opt_state->depth != svn_depth_unknown)
         return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                                 _("--depth cannot be used with "

Modified: subversion/branches/master-passphrase/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/notify.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/notify.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/notify.c Thu Aug  2 19:09:21 2012
@@ -214,6 +214,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)))

Modified: subversion/branches/master-passphrase/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnadmin/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnadmin/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnadmin/main.c Thu Aug  2 19:09:21 2012
@@ -136,8 +136,8 @@ check_lib_versions(void)
       { "svn_delta", svn_delta_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 
@@ -593,6 +593,21 @@ parse_args(apr_array_header_t **args,
   return SVN_NO_ERROR;
 }
 
+
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
+subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+  struct svnadmin_opt_state *opt_state = baton;
+  svn_repos_t *repos;
+
+  SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+  SVN_ERR_MALFUNCTION();
+
+  /* merely silence a compiler warning (this will never be executed) */
+  return SVN_NO_ERROR;
+}
+
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
 subcommand_create(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -1775,12 +1790,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 +1818,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 +1838,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 +1854,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 +1868,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 +1881,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 +1924,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 +1960,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 +1970,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 +2004,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 +2014,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 +2035,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 +2049,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 +2081,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 +2123,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/master-passphrase/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svndumpfilter/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svndumpfilter/main.c Thu Aug  2 19:09:21 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. */
@@ -1156,8 +1156,8 @@ check_lib_versions(void)
       { "svn_delta", svn_delta_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 

Modified: subversion/branches/master-passphrase/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnlook/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnlook/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnlook/main.c Thu Aug  2 19:09:21 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);
 }
 

Modified: subversion/branches/master-passphrase/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnmucc/svnmucc.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/master-passphrase/subversion/svnmucc/svnmucc.c Thu Aug  2 19:09:21 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))

Modified: subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/master-passphrase/subversion/svnrdump/load_editor.c Thu Aug  2 19:09:21 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;

Modified: subversion/branches/master-passphrase/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnserve/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnserve/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnserve/main.c Thu Aug  2 19:09:21 2012
@@ -411,8 +411,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);
 }
 

Modified: subversion/branches/master-passphrase/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnsync/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnsync/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnsync/main.c Thu Aug  2 19:09:21 2012
@@ -301,7 +301,6 @@ check_lib_versions(void)
       { "svn_ra",    svn_ra_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
 
   return svn_ver_check_list(&my_version, checklist);

Modified: subversion/branches/master-passphrase/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnversion/main.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnversion/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnversion/main.c Thu Aug  2 19:09:21 2012
@@ -107,8 +107,8 @@ check_lib_versions(void)
       { "svn_wc",     svn_wc_version },
       { NULL, NULL }
     };
-
   SVN_VERSION_DEFINE(my_version);
+
   return svn_ver_check_list(&my_version, checklist);
 }
 

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/merge_symmetric_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/merge_symmetric_tests.py?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/merge_symmetric_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/merge_symmetric_tests.py Thu Aug  2 19:09:21 2012
@@ -785,6 +785,8 @@ def subtree_to_and_fro(sbox):
   svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
   svntest.actions.run_and_verify_svn(None, None, [], 'merge', '--symmetric',
                                      sbox.repo_url + '/A/D', A_COPY_D_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
+                                     '-m', 'Symmetric subtree merge')
 
   # r9 - Make an edit to A/D/H/psi.
   svntest.main.file_write(psi_path, "Trunk Edit to 'psi'.\n")
@@ -816,10 +818,10 @@ def subtree_to_and_fro(sbox):
   #   Select: (p) postpone, (df) diff-full, (e) edit,
   #           (mc) mine-conflict, (tc) theirs-conflict,
   #           (s) show all options: p
-  #   --- Merging r2 through r8 into 'A':
+  #   --- Merging r2 through r9 into 'A':
   #   C    A\D\H\psi
   #   U    A\D\gamma
-  #   --- Recording mergeinfo for merge of r2 through r8 into 'A':
+  #   --- Recording mergeinfo for merge of r2 through r9 into 'A':
   #    U   A
   #   Summary of conflicts:
   #     Text conflicts: 1
@@ -834,7 +836,7 @@ def subtree_to_and_fro(sbox):
                                 "in the way expected",
                                 err, None,
                                 "(svn: E195016: Reintegrate can only be used if "
-                                "revisions 2 through 8 were previously "
+                                "revisions 2 through 9 were previously "
                                 "merged from .*/A to the reintegrate source, "
                                 "but this is not the case:\n)"
                                 "|(  A_COPY\n)"

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py Thu Aug  2 19:09:21 2012
@@ -4501,6 +4501,12 @@ def set_up_branch(sbox, branch_only = Fa
     r(5 + NBR_OF_BRANCHES) - A/D/H/omega
   Return (expected_disk, expected_status).'''
 
+  # With the default parameters, the branching looks like this:
+  #
+  #   A         -1-----3-4-5-6--
+  #                \
+  #   A_COPY        2-----------
+
   wc_dir = sbox.wc_dir
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
@@ -11061,6 +11067,18 @@ def reverse_merge_away_all_mergeinfo(sbo
 def dont_merge_revs_into_subtree_that_predate_it(sbox):
   "dont merge revs into a subtree that predate it"
 
+  #                              +-> merge -c7 A/D/H/nu@7 H_COPY/nu
+  #                              | +-> merge -c2 A/D/H H_COPY
+  #                              | | +-> merge A/D/H H_COPY
+  #                              | | |
+  # A/D/H      A----------------------
+  #     +-psi  +-M-------------M------
+  #     +-nu       A-D C---M-D
+  # H_COPY               C---------G-G
+  #     +-psi            +---------+-.
+  #     +-nu             +-------G---.
+  #            1 2 3 4 5 6 7 8 9 w w w
+
   # Create our good 'ole greek tree.
   sbox.build()
   wc_dir = sbox.wc_dir
@@ -13124,7 +13142,7 @@ def merge_two_edits_to_same_prop(sbox):
       " C   %s\n" % mu_path,
       ], prop_conflicts=1,
       args=['--allow-mixed-revisions',
-            '--accept=theirs-conflict'],
+            '--accept=working'],
       resolved=[mu_path])
   svn_merge(rev4, A_COPY_path, A_path, [
       " C   %s\n" % mu_path,

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/update_tests.py?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/update_tests.py Thu Aug  2 19:09:21 2012
@@ -5520,6 +5520,7 @@ def update_to_HEAD_plus_1(sbox):
                                         None, None,
                                         None, None, None, wc_dir, '-r', '2')
 
+@XFail()
 def update_moved_dir_leaf_del(sbox):
   "update locally moved dir with leaf del"
   sbox.build()
@@ -5554,6 +5555,7 @@ def update_moved_dir_leaf_del(sbox):
                                         None, None, None,
                                         None, None, 1)
 
+@XFail()
 def update_moved_dir_edited_leaf_del(sbox):
   "update locally moved dir with edited leaf del"
   sbox.build()
@@ -5592,6 +5594,7 @@ def update_moved_dir_edited_leaf_del(sbo
                                         None, None, None,
                                         None, None, 1)
 
+@XFail()
 def update_moved_dir_file_add(sbox):
   "update locally moved dir with incoming file"
   sbox.build()
@@ -5634,6 +5637,7 @@ def update_moved_dir_file_add(sbox):
                                         None, None, None,
                                         None, None, 1)
 
+@XFail()
 def update_moved_dir_dir_add(sbox):
   "update locally moved dir with incoming dir"
   sbox.build()

Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_client/client-test.c Thu Aug  2 19:09:21 2012
@@ -33,6 +33,7 @@
 #include "svn_client.h"
 #include "svn_repos.h"
 #include "svn_subst.h"
+#include "private/svn_wc_private.h"
 
 #include "../svn_test.h"
 #include "../svn_test_fs.h"
@@ -720,6 +721,88 @@ test_youngest_common_ancestor(const svn_
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_externals_parse(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  int i;
+  struct external_info
+    {
+      const char *line;
+      const char *url;
+      const char *local_path;
+      svn_revnum_t peg_rev;
+      svn_revnum_t rev;
+      
+    } items[] = {
+        {
+            "dir http://server/svn/a",
+            "http://server/svn/a",
+            "dir"
+        },
+        {
+            "/svn/home dir",
+            "u://svr/svn/home",
+            "dir"
+        },
+        {
+            "//server/home dir",
+            "u://server/home",
+            "dir"
+        },
+        {
+            "../../../../home dir",
+            "u://svr/svn/home",
+            "dir",
+        },
+        {
+            "^/../repB/tools/scripts scripts",
+            "u://svr/svn/cur/repB/tools/scripts",
+            "scripts"
+        },
+        { 
+            "^/../repB/tools/README.txt scripts/README.txt",
+            "u://svr/svn/cur/repB/tools/README.txt",
+            "scripts/README.txt"
+        },
+    };
+  
+
+  for (i = 0; i < sizeof(items) / sizeof(items[0]); i++)
+    {
+      apr_array_header_t *results;
+      svn_wc_external_item2_t *external_item;
+      const char *resolved_url;
+      SVN_ERR(svn_wc_parse_externals_description3(&results, "/my/current/dir",
+                                                  items[i].line, FALSE, pool));
+
+      SVN_TEST_ASSERT(results && results->nelts == 1);
+
+      external_item = APR_ARRAY_IDX(results, 0, svn_wc_external_item2_t *);
+
+      SVN_ERR(svn_wc__resolve_relative_external_url(&resolved_url,
+                                                    external_item,
+                                                    "u://svr/svn/cur/dir",
+                                                    "u://svr/svn/cur/dir/sd/fl",
+                                                    pool, pool));
+
+      SVN_TEST_STRING_ASSERT(resolved_url, items[i].url);
+      SVN_TEST_STRING_ASSERT(external_item->target_dir, items[i].local_path);
+
+      if (items[i].peg_rev != 0)
+        SVN_TEST_ASSERT(external_item->peg_revision.value.number
+                                == items[i].peg_rev);
+      if (items[i].rev != 0)
+        SVN_TEST_ASSERT(external_item->revision.value.number == items[i].rev);
+      SVN_TEST_ASSERT(svn_uri_is_canonical(resolved_url, pool));
+    }
+
+
+  return SVN_NO_ERROR;
+
+}
+
+
+
 
 /* ========================================================================== */
 
@@ -737,5 +820,6 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_OPTS_PASS(test_16k_add, "test adding 16k files"),
 #endif
     SVN_TEST_OPTS_PASS(test_youngest_common_ancestor, "test youngest_common_ancestor"),
+    SVN_TEST_OPTS_PASS(test_externals_parse, "test svn_wc_parse_externals_description3"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c Thu Aug  2 19:09:21 2012
@@ -670,6 +670,7 @@ test_dirent_canonicalize(apr_pool_t *poo
     { "foo/../",              "foo/.." },
     { "foo/../.",             "foo/.." },
     { "foo//.//bar",          "foo/bar" },
+    { "//foo",                "/foo" },
     { "///foo",               "/foo" },
     { "/.//./.foo",           "/.foo" },
     { ".///.foo",             ".foo" },
@@ -743,6 +744,7 @@ test_relpath_canonicalize(apr_pool_t *po
     { "foo/../",              "foo/.." },
     { "foo/../.",             "foo/.." },
     { "foo//.//bar",          "foo/bar" },
+    { "//foo",                "foo" },
     { "///foo",               "foo" },
     { "/.//./.foo",           ".foo" },
     { ".///.foo",             ".foo" },
@@ -919,6 +921,7 @@ static const testcase_canonicalize_t uri
     { "foo/../",                         NULL },
     { "foo/../.",                        NULL },
     { "foo//.//bar",                     NULL },
+    { "//foo",                           NULL },
     { "///foo",                          NULL },
     { "/.//./.foo",                      NULL },
     { ".///.foo",                        NULL },
@@ -1006,6 +1009,7 @@ test_dirent_is_canonical(apr_pool_t *poo
     { "foo/../",               FALSE },
     { "foo/../.",              FALSE },
     { "foo//.//bar",           FALSE },
+    { "//foo",                 FALSE },
     { "///foo",                FALSE },
     { "/.//./.foo",            FALSE },
     { ".///.foo",              FALSE },
@@ -1106,6 +1110,7 @@ test_relpath_is_canonical(apr_pool_t *po
     { "foo/../",               FALSE },
     { "foo/../.",              FALSE },
     { "foo//.//bar",           FALSE },
+    { "//foo",                 FALSE },
     { "///foo",                FALSE },
     { "/.//./.foo",            FALSE },
     { ".///.foo",              FALSE },

Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1368653&r1=1368652&r2=1368653&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/mergeinfo-test.c Thu Aug  2 19:09:21 2012
@@ -78,7 +78,7 @@ verify_mergeinfo_parse(const char *input
     {
       const void *path;
       void *val;
-      apr_array_header_t *ranges;
+      svn_rangelist_t *ranges;
       svn_merge_range_t *range;
       int j;
 
@@ -236,7 +236,7 @@ test_mergeinfo_dup(apr_pool_t *pool)
 {
   apr_hash_t *orig_mergeinfo, *copied_mergeinfo;
   apr_pool_t *subpool;
-  apr_array_header_t *rangelist;
+  svn_rangelist_t *rangelist;
 
   /* Assure that copies which should be empty turn out that way. */
   subpool = svn_pool_create(pool);
@@ -399,7 +399,7 @@ range_to_string(svn_merge_range_t *range
    verified (e.g. "svn_rangelist_intersect"), while TYPE is a word
    describing what the ranges being examined represent. */
 static svn_error_t *
-verify_ranges_match(const apr_array_header_t *actual_rangelist,
+verify_ranges_match(const svn_rangelist_t *actual_rangelist,
                     svn_merge_range_t *expected_ranges, int nbr_expected,
                     const char *func_verified, const char *type,
                     apr_pool_t *pool)
@@ -436,7 +436,7 @@ verify_mergeinfo_deltas(apr_hash_t *delt
                         const char *func_verified, const char *type,
                         apr_pool_t *pool)
 {
-  apr_array_header_t *rangelist;
+  svn_rangelist_t *rangelist;
 
   if (apr_hash_count(deltas) != 1)
     /* Deltas on "/trunk" expected. */
@@ -479,7 +479,7 @@ test_diff_mergeinfo(apr_pool_t *pool)
 static svn_error_t *
 test_rangelist_reverse(apr_pool_t *pool)
 {
-  apr_array_header_t *rangelist;
+  svn_rangelist_t *rangelist;
   svn_merge_range_t expected_rangelist[3] =
     { {10, 9, TRUE}, {7, 4, TRUE}, {3, 2, TRUE} };
 
@@ -494,7 +494,7 @@ test_rangelist_reverse(apr_pool_t *pool)
 static svn_error_t *
 test_rangelist_intersect(apr_pool_t *pool)
 {
-  apr_array_header_t *rangelist1, *rangelist2, *intersection;
+  svn_rangelist_t *rangelist1, *rangelist2, *intersection;
 
   /* Expected intersection when considering inheritance. */
   svn_merge_range_t intersection_consider_inheritance[] =
@@ -562,7 +562,7 @@ test_mergeinfo_intersect(apr_pool_t *poo
 {
   svn_merge_range_t expected_intersection[3] =
     { {0, 1, TRUE}, {2, 4, TRUE}, {11, 12, TRUE} };
-  apr_array_header_t *rangelist;
+  svn_rangelist_t *rangelist;
   apr_hash_t *intersection;
 
   SVN_ERR(svn_mergeinfo_parse(&info1, "/trunk: 1-6,12-16\n/foo: 31", pool));
@@ -728,7 +728,7 @@ test_merge_mergeinfo(apr_pool_t *pool)
 
       for (j = 0; j < mergeinfo[i].expected_paths; j++)
         {
-          apr_array_header_t *rangelist =
+          svn_rangelist_t *rangelist =
             apr_hash_get(info1, mergeinfo[i].path_rngs[j].path,
                          APR_HASH_KEY_STRING);
           if (!rangelist)
@@ -751,7 +751,7 @@ test_remove_rangelist(apr_pool_t *pool)
 {
   int i, j;
   svn_error_t *err, *child_err;
-  apr_array_header_t *output, *eraser, *whiteboard;
+  svn_rangelist_t *output, *eraser, *whiteboard;
 
   /* Struct for svn_rangelist_remove test data.
      Parse WHITEBOARD and ERASER to hashes and then get the rangelist for
@@ -938,7 +938,7 @@ randomly_fill_rev_array(svn_boolean_t *r
 /* Set *RANGELIST to a rangelist representing the revisions that are marked
  * with TRUE in the array REVS[RANDOM_REV_ARRAY_LENGTH]. */
 static svn_error_t *
-rev_array_to_rangelist(apr_array_header_t **rangelist,
+rev_array_to_rangelist(svn_rangelist_t **rangelist,
                        svn_boolean_t *revs,
                        apr_pool_t *pool)
 {
@@ -980,7 +980,7 @@ test_rangelist_remove_randomly(apr_pool_
       svn_boolean_t first_revs[RANDOM_REV_ARRAY_LENGTH],
         second_revs[RANDOM_REV_ARRAY_LENGTH],
         expected_revs[RANDOM_REV_ARRAY_LENGTH];
-      apr_array_header_t *first_rangelist, *second_rangelist,
+      svn_rangelist_t *first_rangelist, *second_rangelist,
         *expected_rangelist, *actual_rangelist;
       /* There will be at most RANDOM_REV_ARRAY_LENGTH ranges in
          expected_rangelist. */
@@ -1038,7 +1038,7 @@ test_rangelist_intersect_randomly(apr_po
       svn_boolean_t first_revs[RANDOM_REV_ARRAY_LENGTH],
         second_revs[RANDOM_REV_ARRAY_LENGTH],
         expected_revs[RANDOM_REV_ARRAY_LENGTH];
-      apr_array_header_t *first_rangelist, *second_rangelist,
+      svn_rangelist_t *first_rangelist, *second_rangelist,
         *expected_rangelist, *actual_rangelist;
       /* There will be at most RANDOM_REV_ARRAY_LENGTH ranges in
          expected_rangelist. */
@@ -1105,7 +1105,7 @@ test_remove_mergeinfo(apr_pool_t *pool)
 static svn_error_t *
 test_rangelist_to_string(apr_pool_t *pool)
 {
-  apr_array_header_t *result;
+  svn_rangelist_t *result;
   svn_string_t *output;
   svn_string_t *expected = svn_string_create("3,5,7-11,13-14", pool);
 
@@ -1162,7 +1162,7 @@ test_rangelist_merge(apr_pool_t *pool)
 {
   int i;
   svn_error_t *err, *child_err;
-  apr_array_header_t *rangelist1, *rangelist2;
+  svn_rangelist_t *rangelist1, *rangelist2;
 
   /* Struct for svn_rangelist_merge test data.  Similar to
      mergeinfo_merge_test_data struct in svn_mergeinfo_merge() test. */
@@ -1359,7 +1359,7 @@ test_rangelist_diff(apr_pool_t *pool)
 {
   int i;
   svn_error_t *err, *child_err;
-  apr_array_header_t *from, *to, *added, *deleted;
+  svn_rangelist_t *from, *to, *added, *deleted;
 
   /* Structure containing two ranges to diff and the expected output of the
      diff both when considering and ignoring range inheritance. */