You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/06/05 11:22:51 UTC

svn commit: r1489765 [13/22] - in /subversion/branches/verify-keep-going: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/hook-scripts/ contrib/server-side/fsfsfixer/ contrib/server-side/fsfsfixer/fixer/ notes/ subversion...

Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/temp_serializer.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/temp_serializer.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/temp_serializer.c Wed Jun  5 09:22:43 2013
@@ -267,7 +267,7 @@ void
 svn_temp_serializer__pop(svn_temp_serializer__context_t *context)
 {
   source_stack_t *old = context->source;
-  
+
   /* we may pop the original struct but not further */
   assert(context->source);
 

Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c Wed Jun  5 09:22:43 2013
@@ -31,6 +31,9 @@
 #include "svn_props.h"
 #include "svn_private_config.h"
 
+#include "private/svn_dep_compat.h"
+#include "private/svn_string_private.h"
+
 svn_error_t *
 svn_revnum_parse(svn_revnum_t *rev,
                  const char *str,
@@ -38,28 +41,37 @@ svn_revnum_parse(svn_revnum_t *rev,
 {
   char *end;
 
-  svn_revnum_t result = strtol(str, &end, 10);
+  svn_revnum_t result = (svn_revnum_t)svn__strtoul(str, &end);
 
   if (endptr)
-    *endptr = end;
+    *endptr = str;
 
   if (str == end)
-    return svn_error_createf(SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
-                             _("Invalid revision number found parsing '%s'"),
-                             str);
-
-  if (result < 0)
+    return svn_error_createf
+              (SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
+               *str == '-' ? _("Negative revision number found parsing '%s'")
+                           : _("Invalid revision number found parsing '%s'"),
+               str);
+
+  /* a revision number with more than 9 digits is suspicious.
+     Have a closer look at those. */
+  if (str + 10 <= end)
     {
-      /* The end pointer from strtol() is valid, but a negative revision
-         number is invalid, so move the end pointer back to the
-         beginning of the string. */
-      if (endptr)
-        *endptr = str;
-
-      return svn_error_createf(SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
-                               _("Negative revision number found parsing '%s'"),
-                               str);
+      /* we support 32 bit revision numbers only. check for overflows */
+      if (str + 10 < end)
+        return svn_error_createf
+                  (SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
+                  _("Revision number longer than 10 digits '%s'"), str);
+        
+      /* we support 32 bit revision numbers only. check for overflows */
+      if (*str > '2' || (apr_uint32_t)result > APR_INT32_MAX)
+        return svn_error_createf
+                  (SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
+                  _("Revision number too large or not normalized '%s'"), str);
     }
+  
+  if (endptr)
+    *endptr = end;
 
   *rev = result;
 

Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c Wed Jun  5 09:22:43 2013
@@ -121,8 +121,8 @@ xlate_handle_node_cleanup(void *arg)
 }
 
 void
-svn_utf_initialize2(apr_pool_t *pool,
-                    svn_boolean_t assume_native_utf8)
+svn_utf_initialize2(svn_boolean_t assume_native_utf8,
+                    apr_pool_t *pool)
 {
   if (!xlate_handle_hash)
     {
@@ -945,7 +945,7 @@ svn_utf_cstring_from_utf8(const char **d
   SVN_ERR(get_uton_xlate_handle_node(&node, pool));
   err = convert_cstring(dest, src, node, pool);
   err = svn_error_compose_create(
-          err, 
+          err,
           put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
 
   return err;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_validate.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_validate.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_validate.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_validate.c Wed Jun  5 09:22:43 2013
@@ -271,12 +271,12 @@ first_non_fsm_start_char(const char *dat
       max_len -= len;
 
       for (; len > 0; ++data, --len)
-        if (*data < 0 || *data >= 0x80)
+        if ((unsigned char)*data >= 0x80)
           return data;
     }
-    
+
 #endif
-    
+
   /* Scan the input one machine word at a time. */
   for (; max_len > sizeof(apr_uintptr_t)
        ; data += sizeof(apr_uintptr_t), max_len -= sizeof(apr_uintptr_t))
@@ -285,7 +285,7 @@ first_non_fsm_start_char(const char *dat
 
   /* The remaining odd bytes will be examined the naive way: */
   for (; max_len > 0; ++data, --max_len)
-    if (*data < 0 || *data >= 0x80)
+    if ((unsigned char)*data >= 0x80)
       break;
 
   return data;
@@ -304,7 +304,7 @@ first_non_fsm_start_char_cstring(const c
    * segfault.
    */
   for (; (apr_uintptr_t)data & (sizeof(apr_uintptr_t)-1); ++data)
-    if (*data <= 0 || *data >= 0x80)
+    if (*data == 0 || (unsigned char)*data >= 0x80)
       return data;
 
   /* Scan the input one machine word at a time. */
@@ -331,7 +331,7 @@ first_non_fsm_start_char_cstring(const c
 
   /* The remaining odd bytes will be examined the naive way: */
   for (; ; ++data)
-    if (*data <= 0 || *data >= 0x80)
+    if (*data == 0 || (unsigned char)*data >= 0x80)
       break;
 
   return data;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_width.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_width.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_width.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/utf_width.c Wed Jun  5 09:22:43 2013
@@ -195,7 +195,7 @@ mk_wcwidth(apr_uint32_t ucs)
 
   /* if we arrive here, ucs is not a combining or C0/C1 control character */
 
-  return 1 + 
+  return 1 +
     (ucs >= 0x1100 &&
      (ucs <= 0x115f ||                    /* Hangul Jamo init. consonants */
       ucs == 0x2329 || ucs == 0x232a ||

Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c Wed Jun  5 09:22:43 2013
@@ -202,7 +202,7 @@ svn_version__parse_version_string(svn_ve
 {
   svn_error_t *err;
   svn_version_t *version;
-  apr_array_header_t *pieces = 
+  apr_array_header_t *pieces =
     svn_cstring_split(version_string, ".", FALSE, result_pool);
 
   if ((pieces->nelts < 2) || (pieces->nelts > 3))

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c Wed Jun  5 09:22:43 2013
@@ -123,7 +123,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
                                scratch_pool, scratch_pool));
 
   if (status != svn_wc__db_status_normal
-      && !((status == svn_wc__db_status_added 
+      && !((status == svn_wc__db_status_added
             || status == svn_wc__db_status_incomplete)
            && (kind == svn_node_dir
                || (kind == svn_node_file && checksum != NULL)

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c Wed Jun  5 09:22:43 2013
@@ -1139,7 +1139,7 @@ svn_wc__get_pristine_contents_by_checksu
                                           apr_pool_t *scratch_pool)
 {
   svn_boolean_t present;
-  
+
   *contents = NULL;
 
   SVN_ERR(svn_wc__db_pristine_check(&present, wc_ctx->db, wri_abspath,
@@ -1153,9 +1153,9 @@ svn_wc__get_pristine_contents_by_checksu
       gpl_baton->wc_ctx = wc_ctx;
       gpl_baton->wri_abspath = wri_abspath;
       gpl_baton->checksum = checksum;
-      
+
       *contents = svn_stream_lazyopen_create(get_pristine_lazyopen_func,
-                                             gpl_baton, result_pool);
+                                             gpl_baton, FALSE, result_pool);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c Wed Jun  5 09:22:43 2013
@@ -159,16 +159,16 @@ conflict__read_location(svn_wc_conflict_
     }
   c = c->next;
 
-  repos_root_url = apr_pstrmemdup(scratch_pool, c->data, c->len);
+  repos_root_url = apr_pstrmemdup(result_pool, c->data, c->len);
   c = c->next;
 
   if (c->is_atom)
-    repos_uuid = apr_pstrmemdup(scratch_pool, c->data, c->len);
+    repos_uuid = apr_pstrmemdup(result_pool, c->data, c->len);
   else
     repos_uuid = NULL;
   c = c->next;
 
-  repos_relpath = apr_pstrmemdup(scratch_pool, c->data, c->len);
+  repos_relpath = apr_pstrmemdup(result_pool, c->data, c->len);
   c = c->next;
 
   SVN_ERR(svn_skel__parse_int(&v, c, scratch_pool));
@@ -1513,6 +1513,71 @@ generate_propconflict(svn_boolean_t *con
   return SVN_NO_ERROR;
 }
 
+/* Perform a 3-way merge in which conflicts are expected, showing the
+ * conflicts in the way specified by STYLE, and using MERGE_OPTIONS.
+ *
+ * The three input files are LEFT_ABSPATH (the base), DETRANSLATED_TARGET
+ * and RIGHT_ABSPATH.  The output is stored in a new temporary file,
+ * whose name is put into *CHOSEN_ABSPATH.
+ *
+ * The output file will be deleted according to DELETE_WHEN.  If
+ * DELETE_WHEN is 'on pool cleanup', it refers to RESULT_POOL.
+ *
+ * DB and WRI_ABSPATH are used to choose a directory for the output file.
+ *
+ * Allocate *CHOSEN_ABSPATH in RESULT_POOL.  Use SCRATCH_POOL for temporary
+ * allocations.
+ */
+static svn_error_t *
+merge_showing_conflicts(const char **chosen_abspath,
+                        svn_wc__db_t *db,
+                        const char *wri_abspath,
+                        svn_diff_conflict_display_style_t style,
+                        const apr_array_header_t *merge_options,
+                        const char *left_abspath,
+                        const char *detranslated_target,
+                        const char *right_abspath,
+                        svn_io_file_del_t delete_when,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
+{
+  const char *temp_dir;
+  svn_stream_t *chosen_stream;
+  svn_diff_t *diff;
+  svn_diff_file_options_t *diff3_options;
+
+  diff3_options = svn_diff_file_options_create(scratch_pool);
+  if (merge_options)
+    SVN_ERR(svn_diff_file_options_parse(diff3_options,
+                                        merge_options,
+                                        scratch_pool));
+
+  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir, db,
+                                         wri_abspath,
+                                         scratch_pool, scratch_pool));
+  /* We need to open the stream in RESULT_POOL because that controls the
+   * lifetime of the file if DELETE_WHEN is 'on pool cleanup'.  (We also
+   * want to allocate CHOSEN_ABSPATH in RESULT_POOL, but we don't care
+   * about the stream itself.) */
+  SVN_ERR(svn_stream_open_unique(&chosen_stream, chosen_abspath,
+                                 temp_dir, delete_when,
+                                 result_pool, scratch_pool));
+  SVN_ERR(svn_diff_file_diff3_2(&diff,
+                                left_abspath,
+                                detranslated_target, right_abspath,
+                                diff3_options, scratch_pool));
+  SVN_ERR(svn_diff_file_output_merge2(chosen_stream, diff,
+                                      left_abspath,
+                                      detranslated_target,
+                                      right_abspath,
+                                      NULL, NULL, NULL, NULL, /* markers */
+                                      style,
+                                      scratch_pool));
+  SVN_ERR(svn_stream_close(chosen_stream));
+
+  return SVN_NO_ERROR;
+}
+
 /* Resolve the text conflict on DB/LOCAL_ABSPATH in the manner specified
  * by CHOICE.
  *
@@ -1530,6 +1595,8 @@ generate_propconflict(svn_boolean_t *con
  * DETRANSLATED_TARGET is the detranslated version of 'mine' (see
  * detranslate_wc_file() above).  MERGE_OPTIONS are passed to the
  * diff3 implementation in case a 3-way merge has to be carried out.
+ *
+ * ### This is redundantly similar to resolve_text_conflict_on_node().
  */
 static svn_error_t *
 eval_text_conflict_func_result(svn_skel_t **work_items,
@@ -1575,47 +1642,20 @@ eval_text_conflict_func_result(svn_skel_
       case svn_wc_conflict_choose_theirs_conflict:
       case svn_wc_conflict_choose_mine_conflict:
         {
-          const char *chosen_abspath;
-          const char *temp_dir;
-          svn_stream_t *chosen_stream;
-          svn_diff_t *diff;
-          svn_diff_conflict_display_style_t style;
-          svn_diff_file_options_t *diff3_options;
-
-          diff3_options = svn_diff_file_options_create(scratch_pool);
+          svn_diff_conflict_display_style_t style
+            = choice == svn_wc_conflict_choose_theirs_conflict
+                ? svn_diff_conflict_display_latest
+                : svn_diff_conflict_display_modified;
 
-          if (merge_options)
-             SVN_ERR(svn_diff_file_options_parse(diff3_options,
-                                                 merge_options,
-                                                 scratch_pool));
-
-          style = choice == svn_wc_conflict_choose_theirs_conflict
-                    ? svn_diff_conflict_display_latest
-                    : svn_diff_conflict_display_modified;
-
-          SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir, db,
-                                                 local_abspath,
-                                                 scratch_pool, scratch_pool));
-          SVN_ERR(svn_stream_open_unique(&chosen_stream, &chosen_abspath,
-                                         temp_dir, svn_io_file_del_none,
-                                         scratch_pool, scratch_pool));
-
-          SVN_ERR(svn_diff_file_diff3_2(&diff,
-                                        left_abspath,
-                                        detranslated_target, right_abspath,
-                                        diff3_options, scratch_pool));
-          SVN_ERR(svn_diff_file_output_merge2(chosen_stream, diff,
-                                              left_abspath,
-                                              detranslated_target,
-                                              right_abspath,
-                                              /* markers ignored */
-                                              NULL, NULL,
-                                              NULL, NULL,
-                                              style,
-                                              scratch_pool));
-          SVN_ERR(svn_stream_close(chosen_stream));
-
-          install_from_abspath = chosen_abspath;
+          SVN_ERR(merge_showing_conflicts(&install_from_abspath,
+                                          db, local_abspath,
+                                          style, merge_options,
+                                          left_abspath,
+                                          detranslated_target,
+                                          right_abspath,
+                                          /* ### why not same as other caller? */
+                                          svn_io_file_del_none,
+                                          scratch_pool, scratch_pool));
           remove_source = TRUE;
           *is_resolved = TRUE;
           break;
@@ -1654,7 +1694,7 @@ eval_text_conflict_func_result(svn_skel_
                                           FALSE /* record_fileinfo */,
                                           result_pool, scratch_pool));
     *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
-    
+
     SVN_ERR(svn_wc__wq_build_sync_file_flags(&work_item, db, local_abspath,
                                              result_pool, scratch_pool));
     *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
@@ -1716,42 +1756,33 @@ save_merge_result(svn_skel_t **work_item
 
 
 /* Call the conflict resolver callback for a text conflict, and resolve
- * the conflict if it tells us to do so.
+ * the conflict if the callback tells us to do so.  (Do not mark the
+ * conflict as resolved.)
  *
- * Assume that there is a text conflict on the path DB/LOCAL_ABSPATH.
+ * Assume that there is a text conflict on the path DB/LOCAL_ABSPATH,
+ * and CDESC is the conflict description.
  *
  * Call CONFLICT_FUNC with CONFLICT_BATON to find out whether and how
- * it wants to resolve the conflict.  Pass it a conflict description
- * containing OPERATION, LEFT/RIGHT_ABSPATH, LEFT/RIGHT_VERSION,
- * RESULT_TARGET and DETRANSLATED_TARGET.
+ * it wants to resolve the conflict.
  *
  * If the callback returns a resolution other than 'postpone', then
  * perform that requested resolution and prepare to mark the conflict
- * as resolved.
+ * as resolved ... ?? by adding work items to *WORK_ITEMS ??.
+ *
+ * MERGE_OPTIONS is used if the resolver callback requests a merge.
  *
  * Return *WORK_ITEMS that will do the on-disk work required to complete
  * the resolution (but not to mark the conflict as resolved), and set
  * *WAS_RESOLVED to true, if it was resolved.  Set *WORK_ITEMS to NULL
  * and *WAS_RESOLVED to FALSE otherwise.
- *
- * RESULT_TARGET is the path to the merged file produced by the internal
- * or external 3-way merge, which may contain conflict markers, in
- * repository normal form.  DETRANSLATED_TARGET is the 'mine' version of
- * the file, also in RNF.
  */
 static svn_error_t *
 resolve_text_conflict(svn_skel_t **work_items,
                       svn_boolean_t *was_resolved,
                       svn_wc__db_t *db,
                       const char *local_abspath,
+                      svn_wc_conflict_description2_t *cdesc,
                       const apr_array_header_t *merge_options,
-                      svn_wc_operation_t operation,
-                      const char *left_abspath,
-                      const char *right_abspath,
-                      const svn_wc_conflict_version_t *left_version,
-                      const svn_wc_conflict_version_t *right_version,
-                      const char *result_target,
-                      const char *detranslated_target,
                       svn_wc_conflict_resolver_func2_t conflict_func,
                       void *conflict_baton,
                       apr_pool_t *result_pool,
@@ -1759,8 +1790,6 @@ resolve_text_conflict(svn_skel_t **work_
 {
   svn_wc_conflict_result_t *result;
   svn_skel_t *work_item;
-  svn_wc_conflict_description2_t *cdesc;
-  apr_hash_t *props;
 
   *work_items = NULL;
   *was_resolved = FALSE;
@@ -1768,21 +1797,6 @@ resolve_text_conflict(svn_skel_t **work_
   /* Give the conflict resolution callback a chance to clean
      up the conflicts before we mark the file 'conflicted' */
 
-  SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
-                              scratch_pool, scratch_pool));
-
-  cdesc = svn_wc_conflict_description_create_text2(local_abspath,
-                                                   scratch_pool);
-  cdesc->is_binary = FALSE;
-  cdesc->mime_type = svn_prop_get_value(props, SVN_PROP_MIME_TYPE);
-  cdesc->base_abspath = left_abspath;
-  cdesc->their_abspath = right_abspath;
-  cdesc->my_abspath = detranslated_target;
-  cdesc->merged_file = result_target;
-  cdesc->operation = operation;
-  cdesc->src_left_version = left_version;
-  cdesc->src_right_version = right_version;
-
   SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
                         scratch_pool));
   if (result == NULL)
@@ -1798,7 +1812,7 @@ resolve_text_conflict(svn_skel_t **work_
                                     merged-file first: */
                                 result->merged_file
                                   ? result->merged_file
-                                  : result_target,
+                                  : cdesc->merged_file,
                                 result_pool, scratch_pool));
     }
 
@@ -1809,13 +1823,13 @@ resolve_text_conflict(svn_skel_t **work_
                                              db, local_abspath,
                                              result->choice,
                                              merge_options,
-                                             left_abspath,
-                                             right_abspath,
+                                             cdesc->base_abspath,
+                                             cdesc->their_abspath,
                                              /* ### Sure this is an abspath? */
                                              result->merged_file
                                                ? result->merged_file
-                                               : result_target,
-                                             detranslated_target,
+                                               : cdesc->merged_file,
+                                             cdesc->my_abspath,
                                              result_pool, scratch_pool));
       *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
     }
@@ -1826,19 +1840,74 @@ resolve_text_conflict(svn_skel_t **work_
 }
 
 
+/* Set *DESC to a new description of the text conflict in
+ * CONFLICT_SKEL.  If there is no text conflict in CONFLICT_SKEL, return
+ * an error.
+ *
+ * Use OPERATION and shallow copies of LEFT_VERSION and RIGHT_VERSION,
+ * rather than reading them from CONFLICT_SKEL.  Use IS_BINARY and
+ * MIME_TYPE for the corresponding fields of *DESC.
+ *
+ * Allocate results in RESULT_POOL.  SCRATCH_POOL is used for temporary
+ * allocations. */
 static svn_error_t *
-setup_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         svn_wc_operation_t operation,
-                         const svn_wc_conflict_version_t *left_version,
-                         const svn_wc_conflict_version_t *right_version,
-                         svn_wc_conflict_reason_t local_change,
-                         svn_wc_conflict_action_t incoming_change,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
+read_text_conflict_desc(svn_wc_conflict_description2_t **desc,
+                        svn_wc__db_t *db,
+                        const char *local_abspath,
+                        const svn_skel_t *conflict_skel,
+                        svn_boolean_t is_binary,
+                        const char *mime_type,
+                        svn_wc_operation_t operation,
+                        const svn_wc_conflict_version_t *left_version,
+                        const svn_wc_conflict_version_t *right_version,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
+{
+  *desc = svn_wc_conflict_description_create_text2(local_abspath, result_pool);
+  (*desc)->is_binary = is_binary;
+  (*desc)->mime_type = mime_type;
+  (*desc)->operation = operation;
+  (*desc)->src_left_version = left_version;
+  (*desc)->src_right_version = right_version;
+
+  SVN_ERR(svn_wc__conflict_read_text_conflict(&(*desc)->my_abspath,
+                                              &(*desc)->base_abspath,
+                                              &(*desc)->their_abspath,
+                                              db, local_abspath,
+                                              conflict_skel,
+                                              result_pool, scratch_pool));
+  (*desc)->merged_file = apr_pstrdup(result_pool, local_abspath);
+
+  return SVN_NO_ERROR;
+}
+
+/* Set *CONFLICT_DESC to a new description of the tree conflict in
+ * CONFLICT_SKEL.  If there is no tree conflict in CONFLICT_SKEL, return
+ * an error.
+ *
+ * Use OPERATION and shallow copies of LEFT_VERSION and RIGHT_VERSION,
+ * rather than reading them from CONFLICT_SKEL.
+ *
+ * Allocate results in RESULT_POOL.  SCRATCH_POOL is used for temporary
+ * allocations. */
+static svn_error_t *
+read_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
+                        svn_wc__db_t *db,
+                        const char *local_abspath,
+                        const svn_skel_t *conflict_skel,
+                        svn_wc_operation_t operation,
+                        const svn_wc_conflict_version_t *left_version,
+                        const svn_wc_conflict_version_t *right_version,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
 {
   svn_node_kind_t tc_kind;
+  svn_wc_conflict_reason_t local_change;
+  svn_wc_conflict_action_t incoming_change;
+
+  SVN_ERR(svn_wc__conflict_read_tree_conflict(
+            &local_change, &incoming_change, NULL,
+            db, local_abspath, conflict_skel, scratch_pool, scratch_pool));
 
   if (left_version)
     tc_kind = left_version->node_kind;
@@ -1966,30 +2035,29 @@ svn_wc__conflict_invoke_resolver(svn_wc_
           SVN_ERR(svn_wc__mark_resolved_prop_conflicts(db, local_abspath,
                                                        scratch_pool));
         }
+      svn_pool_destroy(iterpool);
     }
 
   if (text_conflicted)
     {
-      const char *mine_abspath;
-      const char *their_original_abspath;
-      const char *their_abspath;
       svn_skel_t *work_items;
       svn_boolean_t was_resolved;
+      svn_wc_conflict_description2_t *desc;
+      apr_hash_t *props;
 
-      SVN_ERR(svn_wc__conflict_read_text_conflict(&mine_abspath,
-                                                  &their_original_abspath,
-                                                  &their_abspath,
-                                                  db, local_abspath,
-                                                  conflict_skel,
-                                                  scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
+                                    scratch_pool, scratch_pool));
+
+      SVN_ERR(read_text_conflict_desc(&desc,
+                                      db, local_abspath, conflict_skel, FALSE,
+                                      svn_prop_get_value(props,
+                                                         SVN_PROP_MIME_TYPE),
+                                      operation, left_version, right_version,
+                                      scratch_pool, scratch_pool));
 
       SVN_ERR(resolve_text_conflict(&work_items, &was_resolved,
-                                    db, local_abspath,
+                                    db, local_abspath, desc,
                                     merge_options,
-                                    operation,
-                                    their_original_abspath, their_abspath,
-                                    left_version, right_version,
-                                    local_abspath, mine_abspath,
                                     resolver_func, resolver_baton,
                                     scratch_pool, scratch_pool));
 
@@ -2010,23 +2078,13 @@ svn_wc__conflict_invoke_resolver(svn_wc_
 
   if (tree_conflicted)
     {
-      svn_wc_conflict_reason_t local_change;
-      svn_wc_conflict_action_t incoming_change;
       svn_wc_conflict_result_t *result;
       svn_wc_conflict_description2_t *desc;
 
-      SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change,
-                                                  &incoming_change,
-                                                  NULL,
-                                                  db, local_abspath,
-                                                  conflict_skel,
-                                                  scratch_pool, scratch_pool));
-
-      SVN_ERR(setup_tree_conflict_desc(&desc,
-                                       db, local_abspath,
-                                       operation, left_version, right_version,
-                                       local_change, incoming_change,
-                                       scratch_pool, scratch_pool));
+      SVN_ERR(read_tree_conflict_desc(&desc,
+                                      db, local_abspath, conflict_skel,
+                                      operation, left_version, right_version,
+                                      scratch_pool, scratch_pool));
 
       /* Tell the resolver func about this conflict. */
       SVN_ERR(resolver_func(&result, desc, resolver_baton, scratch_pool,
@@ -2042,24 +2100,29 @@ svn_wc__conflict_invoke_resolver(svn_wc_
 
 /* Read all property conflicts contained in CONFLICT_SKEL into
  * individual conflict descriptions, and append those descriptions
- * to the CONFLICTS array.
+ * to the CONFLICTS array.  If there is no property conflict in
+ * CONFLICT_SKEL, return an error.
  *
  * If NOT create_tempfiles, always create a legacy property conflict
  * descriptor.
  *
+ * Use NODE_KIND, OPERATION and shallow copies of LEFT_VERSION and
+ * RIGHT_VERSION, rather than reading them from CONFLICT_SKEL.
+ *
  * Allocate results in RESULT_POOL. SCRATCH_POOL is used for temporary
  * allocations. */
 static svn_error_t *
-read_prop_conflicts(apr_array_header_t *conflicts,
-                    svn_wc__db_t *db,
-                    const char *local_abspath,
-                    svn_skel_t *conflict_skel,
-                    svn_boolean_t create_tempfiles,
-                    svn_wc_operation_t operation,
-                    const svn_wc_conflict_version_t *left_version,
-                    const svn_wc_conflict_version_t *right_version,
-                    apr_pool_t *result_pool,
-                    apr_pool_t *scratch_pool)
+read_prop_conflict_descs(apr_array_header_t *conflicts,
+                         svn_wc__db_t *db,
+                         const char *local_abspath,
+                         svn_skel_t *conflict_skel,
+                         svn_boolean_t create_tempfiles,
+                         svn_node_kind_t node_kind,
+                         svn_wc_operation_t operation,
+                         const svn_wc_conflict_version_t *left_version,
+                         const svn_wc_conflict_version_t *right_version,
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
 {
   const char *prop_reject_file;
   apr_hash_t *my_props;
@@ -2068,7 +2131,7 @@ read_prop_conflicts(apr_array_header_t *
   apr_hash_t *conflicted_props;
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
-  
+
   SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_file,
                                               &my_props,
                                               &their_old_props,
@@ -2084,7 +2147,7 @@ read_prop_conflicts(apr_array_header_t *
       svn_wc_conflict_description2_t *desc;
 
       desc  = svn_wc_conflict_description_create_prop2(local_abspath,
-                                                       svn_node_unknown,
+                                                       node_kind,
                                                        "", result_pool);
 
       /* ### This should be changed. The prej file should be stored
@@ -2115,7 +2178,7 @@ read_prop_conflicts(apr_array_header_t *
       svn_pool_clear(iterpool);
 
       desc  = svn_wc_conflict_description_create_prop2(local_abspath,
-                                                       svn_node_unknown,
+                                                       node_kind,
                                                        propname,
                                                        result_pool);
 
@@ -2127,11 +2190,12 @@ read_prop_conflicts(apr_array_header_t *
 
       my_value = svn_hash_gets(my_props, propname);
       their_value = svn_hash_gets(their_props, propname);
+      old_value = svn_hash_gets(their_old_props, propname);
 
       /* Compute the incoming side of the conflict ('action'). */
       if (their_value == NULL)
         desc->action = svn_wc_conflict_action_delete;
-      else if (my_value == NULL)
+      else if (old_value == NULL)
         desc->action = svn_wc_conflict_action_add;
       else
         desc->action = svn_wc_conflict_action_edit;
@@ -2139,7 +2203,7 @@ read_prop_conflicts(apr_array_header_t *
       /* Compute the local side of the conflict ('reason'). */
       if (my_value == NULL)
         desc->reason = svn_wc_conflict_reason_deleted;
-      else if (their_value == NULL)
+      else if (old_value == NULL)
         desc->reason = svn_wc_conflict_reason_added;
       else
         desc->reason = svn_wc_conflict_reason_edited;
@@ -2182,7 +2246,6 @@ read_prop_conflicts(apr_array_header_t *
           SVN_ERR(svn_stream_close(s));
         }
 
-      old_value = svn_hash_gets(their_old_props, propname);
       if (old_value)
         {
           svn_stream_t *s;
@@ -2235,7 +2298,7 @@ svn_wc__read_conflicts(const apr_array_h
   SVN_ERR(svn_wc__conflict_read_info(&operation, &locations, &text_conflicted,
                                      &prop_conflicted, &tree_conflicted,
                                      db, local_abspath, conflict_skel,
-                                     scratch_pool, scratch_pool));
+                                     result_pool, scratch_pool));
 
   cflcts = apr_array_make(result_pool, 4,
                           sizeof(svn_wc_conflict_description2_t*));
@@ -2246,51 +2309,37 @@ svn_wc__read_conflicts(const apr_array_h
     right_version = APR_ARRAY_IDX(locations, 1, const svn_wc_conflict_version_t *);
 
   if (prop_conflicted)
-    SVN_ERR(read_prop_conflicts(cflcts, db, local_abspath, conflict_skel,
-                                create_tempfiles,
-                                operation, left_version, right_version,
-                                result_pool, scratch_pool));
+    {
+      svn_node_kind_t node_kind
+        = left_version ? left_version->node_kind : svn_node_unknown;
+
+      SVN_ERR(read_prop_conflict_descs(cflcts,
+                                       db, local_abspath, conflict_skel,
+                                       create_tempfiles, node_kind,
+                                       operation, left_version, right_version,
+                                       result_pool, scratch_pool));
+    }
 
   if (text_conflicted)
     {
       svn_wc_conflict_description2_t *desc;
-      desc  = svn_wc_conflict_description_create_text2(local_abspath,
-                                                       result_pool);
-
-      desc->operation = operation;
-      desc->src_left_version = left_version;
-      desc->src_right_version = right_version;
-
-      SVN_ERR(svn_wc__conflict_read_text_conflict(&desc->my_abspath,
-                                                  &desc->base_abspath,
-                                                  &desc->their_abspath,
-                                                  db, local_abspath,
-                                                  conflict_skel,
-                                                  result_pool, scratch_pool));
-
-      desc->merged_file = apr_pstrdup(result_pool, local_abspath);
 
+      SVN_ERR(read_text_conflict_desc(&desc,
+                                      db, local_abspath, conflict_skel,
+                                      FALSE /*is_binary*/, NULL /*mime_type*/,
+                                      operation, left_version, right_version,
+                                      result_pool, scratch_pool));
       APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t*) = desc;
     }
 
   if (tree_conflicted)
     {
-      svn_wc_conflict_reason_t local_change;
-      svn_wc_conflict_action_t incoming_change;
       svn_wc_conflict_description2_t *desc;
 
-      SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change,
-                                                  &incoming_change,
-                                                  NULL,
-                                                  db, local_abspath,
-                                                  conflict_skel,
-                                                  scratch_pool, scratch_pool));
-
-      SVN_ERR(setup_tree_conflict_desc(&desc,
-                                       db, local_abspath,
-                                       operation, left_version, right_version,
-                                       local_change, incoming_change,
-                                       result_pool, scratch_pool));
+      SVN_ERR(read_tree_conflict_desc(&desc,
+                                      db, local_abspath, conflict_skel,
+                                      operation, left_version, right_version,
+                                      result_pool, scratch_pool));
 
       APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description2_t *) = desc;
     }
@@ -2302,38 +2351,93 @@ svn_wc__read_conflicts(const apr_array_h
 
 /*** Resolving a conflict automatically ***/
 
-/*
- * Resolve the text conflict found in DB/LOCAL_ABSPATH/CONFLICTS
- * according to CONFLICT_CHOICE.  (Don't mark it as resolved.)
+/* Prepare to delete an artifact file at ARTIFACT_FILE_ABSPATH in the
+ * working copy at DB/WRI_ABSPATH.
  *
- * If there were any marker files recorded and present on disk, append to
- * *WORK_ITEMS work items to remove them, and set *REMOVED_REJECT_FILES
- * to TRUE.  Otherwise, don't change *REMOVED_REJECT_FILES.
+ * Set *WORK_ITEMS to a new work item that, when run, will delete the
+ * artifact file; or to NULL if there is no file to delete.
  *
- * It is an error if there is no text conflict.
+ * Set *FILE_FOUND to TRUE if the artifact file is found on disk and its
+ * node kind is 'file'; otherwise do not change *FILE_FOUND.  FILE_FOUND
+ * may be NULL if not required.
+ */
+static svn_error_t *
+remove_artifact_file_if_exists(svn_skel_t **work_items,
+                               svn_boolean_t *file_found,
+                               svn_wc__db_t *db,
+                               const char *wri_abspath,
+                               const char *artifact_file_abspath,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
+{
+  *work_items = NULL;
+  if (artifact_file_abspath)
+    {
+      svn_node_kind_t node_kind;
+
+      SVN_ERR(svn_io_check_path(artifact_file_abspath, &node_kind,
+                                scratch_pool));
+      if (node_kind == svn_node_file)
+        {
+          SVN_ERR(svn_wc__wq_build_file_remove(work_items,
+                                               db, wri_abspath,
+                                               artifact_file_abspath,
+                                               result_pool, scratch_pool));
+          if (file_found)
+            *file_found = TRUE;
+        }
+    }
+
+  return SVN_NO_ERROR;
+}
+
+/*
+ * Resolve the text conflict found in DB/LOCAL_ABSPATH according
+ * to CONFLICT_CHOICE.
+ *
+ * It is not an error if there is no text conflict. If a text conflict
+ * existed and was resolved, set *DID_RESOLVE to TRUE, else set it to FALSE.
  *
  * Note: When there are no conflict markers to remove there is no existing
  * text conflict; just a database containing old information, which we should
  * remove to avoid checking all the time. Resolving a text conflict by
  * removing all the marker files is a fully supported scenario since
  * Subversion 1.0.
+ *
+ * ### This is redundantly similar to eval_text_conflict_func_result().
  */
 static svn_error_t *
-resolve_text_conflict_on_node(svn_boolean_t *removed_reject_files,
-                              svn_skel_t **work_items,
+resolve_text_conflict_on_node(svn_boolean_t *did_resolve,
                               svn_wc__db_t *db,
                               const char *local_abspath,
-                              svn_wc_operation_t operation,
-                              svn_skel_t *conflicts,
                               svn_wc_conflict_choice_t conflict_choice,
+                              const char *merged_file,
+                              svn_cancel_func_t cancel_func,
+                              void *cancel_baton,
                               apr_pool_t *scratch_pool)
 {
   const char *conflict_old = NULL;
   const char *conflict_new = NULL;
   const char *conflict_working = NULL;
   const char *auto_resolve_src;
-  svn_node_kind_t node_kind;
   svn_skel_t *work_item;
+  svn_skel_t *work_items = NULL;
+  svn_skel_t *conflicts;
+  svn_wc_operation_t operation;
+  svn_boolean_t text_conflicted;
+
+  *did_resolve = FALSE;
+
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+                                   scratch_pool, scratch_pool));
+  if (!conflicts)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, &text_conflicted,
+                                     NULL, NULL, db, local_abspath, conflicts,
+                                     scratch_pool, scratch_pool));
+  if (!text_conflicted)
+    return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__conflict_read_text_conflict(&conflict_working,
                                               &conflict_old,
@@ -2355,47 +2459,28 @@ resolve_text_conflict_on_node(svn_boolea
       auto_resolve_src = conflict_new;
       break;
     case svn_wc_conflict_choose_merged:
-      auto_resolve_src = NULL;
+      auto_resolve_src = merged_file;
       break;
     case svn_wc_conflict_choose_theirs_conflict:
     case svn_wc_conflict_choose_mine_conflict:
       {
         if (conflict_old && conflict_working && conflict_new)
           {
-            const char *temp_dir;
-            svn_stream_t *tmp_stream = NULL;
-            svn_diff_t *diff;
-            svn_diff_conflict_display_style_t style =
-              conflict_choice == svn_wc_conflict_choose_theirs_conflict
-              ? svn_diff_conflict_display_latest
-              : svn_diff_conflict_display_modified;
-
-            SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir, db,
-                                                   local_abspath,
-                                                   scratch_pool,
-                                                   scratch_pool));
-            SVN_ERR(svn_stream_open_unique(&tmp_stream,
-                                           &auto_resolve_src,
-                                           temp_dir,
-                                           svn_io_file_del_on_pool_cleanup,
-                                           scratch_pool, scratch_pool));
+            svn_diff_conflict_display_style_t style
+              = conflict_choice == svn_wc_conflict_choose_theirs_conflict
+                  ? svn_diff_conflict_display_latest
+                  : svn_diff_conflict_display_modified;
 
-            SVN_ERR(svn_diff_file_diff3_2(&diff,
-                                          conflict_old,
-                                          conflict_working,
-                                          conflict_new,
-                                          svn_diff_file_options_create(
-                                            scratch_pool),
-                                          scratch_pool));
-            SVN_ERR(svn_diff_file_output_merge2(tmp_stream, diff,
-                                                conflict_old,
-                                                conflict_working,
-                                                conflict_new,
-                                                /* markers ignored */
-                                                NULL, NULL, NULL, NULL,
-                                                style,
-                                                scratch_pool));
-            SVN_ERR(svn_stream_close(tmp_stream));
+            SVN_ERR(merge_showing_conflicts(&auto_resolve_src,
+                                            db, local_abspath,
+                                            style,
+                                            NULL /*merge_options*/,
+                                            conflict_old,
+                                            conflict_working,
+                                            conflict_new,
+                                            /* ### why not same as other caller? */
+                                            svn_io_file_del_on_pool_cleanup,
+                                            scratch_pool, scratch_pool));
           }
         else
           auto_resolve_src = NULL;
@@ -2411,12 +2496,12 @@ resolve_text_conflict_on_node(svn_boolea
       SVN_ERR(svn_wc__wq_build_file_copy_translated(
                 &work_item, db, local_abspath,
                 auto_resolve_src, local_abspath, scratch_pool, scratch_pool));
-      *work_items = svn_wc__wq_merge(*work_items, work_item, scratch_pool);
+      work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
 
       SVN_ERR(svn_wc__wq_build_sync_file_flags(&work_item, db,
                                                local_abspath,
                                                scratch_pool, scratch_pool));
-      *work_items = svn_wc__wq_merge(*work_items, work_item, scratch_pool);
+      work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
     }
 
   /* Legacy behavior: Only report text conflicts as resolved when at least
@@ -2425,60 +2510,36 @@ resolve_text_conflict_on_node(svn_boolea
      If not the UI shows the conflict as already resolved
      (and in this case we just remove the in-db conflict) */
 
-  if (conflict_old)
-    {
-      SVN_ERR(svn_io_check_path(conflict_old, &node_kind, scratch_pool));
-      if (node_kind == svn_node_file)
-        {
-          SVN_ERR(svn_wc__wq_build_file_remove(&work_item, db,
-                                               local_abspath,
-                                               conflict_old,
-                                               scratch_pool, scratch_pool));
-          *work_items = svn_wc__wq_merge(*work_items, work_item, scratch_pool);
-          *removed_reject_files = TRUE;
-        }
-    }
+  SVN_ERR(remove_artifact_file_if_exists(&work_item, did_resolve,
+                                         db, local_abspath, conflict_old,
+                                         scratch_pool, scratch_pool));
+  work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
 
-  if (conflict_new)
-    {
-      SVN_ERR(svn_io_check_path(conflict_new, &node_kind, scratch_pool));
-      if (node_kind == svn_node_file)
-        {
-          SVN_ERR(svn_wc__wq_build_file_remove(&work_item, db,
-                                               local_abspath,
-                                               conflict_new,
-                                               scratch_pool, scratch_pool));
-          *work_items = svn_wc__wq_merge(*work_items, work_item, scratch_pool);
-          *removed_reject_files = TRUE;
-        }
-    }
+  SVN_ERR(remove_artifact_file_if_exists(&work_item, did_resolve,
+                                         db, local_abspath, conflict_new,
+                                         scratch_pool, scratch_pool));
+  work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
 
-  if (conflict_working)
-    {
-      SVN_ERR(svn_io_check_path(conflict_working, &node_kind, scratch_pool));
-      if (node_kind == svn_node_file)
-        {
-          SVN_ERR(svn_wc__wq_build_file_remove(&work_item, db,
-                                               local_abspath,
-                                               conflict_working,
-                                               scratch_pool, scratch_pool));
-          *work_items = svn_wc__wq_merge(*work_items, work_item, scratch_pool);
-          *removed_reject_files = TRUE;
-        }
-    }
+  SVN_ERR(remove_artifact_file_if_exists(&work_item, did_resolve,
+                                         db, local_abspath, conflict_working,
+                                         scratch_pool, scratch_pool));
+  work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+
+  SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath,
+                                      TRUE, FALSE, FALSE,
+                                      work_items, scratch_pool));
+  SVN_ERR(svn_wc__wq_run(db, local_abspath, cancel_func, cancel_baton,
+                         scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
 /*
- * Resolve the property conflicts found in DB/LOCAL_ABSPATH/CONFLICTS
- * according to CONFLICT_CHOICE.  (Don't mark it as resolved.)
- *
- * If there was a reject file recorded and present on disk, append to
- * *WORK_ITEMS a work item to remove it, and set *REMOVED_REJECT_FILE
- * to TRUE.  Otherwise, don't change *REMOVED_REJECT_FILE.
+ * Resolve the property conflicts found in DB/LOCAL_ABSPATH according
+ * to CONFLICT_CHOICE.
  *
- * It is an error if there is no prop conflict.
+ * It is not an error if there is no prop conflict. If a prop conflict
+ * existed and was resolved, set *DID_RESOLVE to TRUE, else set it to FALSE.
  *
  * Note: When there are no conflict markers on-disk to remove there is
  * no existing text conflict (unless we are still in the process of
@@ -2509,16 +2570,16 @@ resolve_text_conflict_on_node(svn_boolea
  *
  */
 static svn_error_t *
-resolve_prop_conflict_on_node(svn_boolean_t *removed_reject_file,
-                              svn_skel_t **work_items,
+resolve_prop_conflict_on_node(svn_boolean_t *did_resolve,
                               svn_wc__db_t *db,
                               const char *local_abspath,
-                              svn_wc_operation_t operation,
-                              svn_skel_t *conflicts,
+                              const char *conflicted_propname,
                               svn_wc_conflict_choice_t conflict_choice,
+                              const char *merged_file,
+                              svn_cancel_func_t cancel_func,
+                              void *cancel_baton,
                               apr_pool_t *scratch_pool)
 {
-  svn_node_kind_t node_kind;
   const char *prop_reject_file;
   apr_hash_t *mine_props;
   apr_hash_t *their_old_props;
@@ -2526,6 +2587,24 @@ resolve_prop_conflict_on_node(svn_boolea
   apr_hash_t *conflicted_props;
   apr_hash_t *old_props;
   apr_hash_t *resolve_from = NULL;
+  svn_skel_t *work_items = NULL;
+  svn_skel_t *conflicts;
+  svn_wc_operation_t operation;
+  svn_boolean_t prop_conflicted;
+
+  *did_resolve = FALSE;
+
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+                                   scratch_pool, scratch_pool));
+
+  if (!conflicts)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, &prop_conflicted,
+                                     NULL, db, local_abspath, conflicts,
+                                     scratch_pool, scratch_pool));
+  if (!prop_conflicted)
+    return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_file,
                                               &mine_props, &their_old_props,
@@ -2564,7 +2643,24 @@ resolve_prop_conflict_on_node(svn_boolea
       resolve_from = their_props;
       break;
     case svn_wc_conflict_choose_merged:
-      resolve_from = NULL;
+      if (merged_file && conflicted_propname[0] != '\0')
+        {
+          apr_hash_t *actual_props;
+          svn_stream_t *stream;
+          svn_string_t *merged_propval;
+
+          SVN_ERR(svn_wc__db_read_props(&actual_props, db, local_abspath,
+                                        scratch_pool, scratch_pool));
+          resolve_from = actual_props;
+
+          SVN_ERR(svn_stream_open_readonly(&stream, merged_file,
+                                           scratch_pool, scratch_pool));
+          SVN_ERR(svn_string_from_stream(&merged_propval, stream,
+                                         scratch_pool, scratch_pool));
+          svn_hash_sets(resolve_from, conflicted_propname, merged_propval);
+        }
+      else
+        resolve_from = NULL;
       break;
     default:
       return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
@@ -2601,39 +2697,36 @@ resolve_prop_conflict_on_node(svn_boolea
      If not the UI shows the conflict as already resolved
      (and in this case we just remove the in-db conflict) */
 
-  if (prop_reject_file)
-    {
-      SVN_ERR(svn_io_check_path(prop_reject_file, &node_kind, scratch_pool));
-      if (node_kind == svn_node_file)
-        {
-          svn_skel_t *work_item;
+  {
+    svn_skel_t *work_item;
 
-          SVN_ERR(svn_wc__wq_build_file_remove(&work_item, db,
-                                               local_abspath,
-                                               prop_reject_file,
-                                               scratch_pool, scratch_pool));
-          *work_items = svn_wc__wq_merge(*work_items, work_item, scratch_pool);
-          *removed_reject_file = TRUE;
-        }
-    }
+    SVN_ERR(remove_artifact_file_if_exists(&work_item, did_resolve,
+                                           db, local_abspath, prop_reject_file,
+                                           scratch_pool, scratch_pool));
+    work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+  }
+
+  SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath, FALSE, TRUE, FALSE,
+                                      work_items, scratch_pool));
+  SVN_ERR(svn_wc__wq_run(db, local_abspath, cancel_func, cancel_baton,
+                         scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
 /*
- * Resolve the tree conflict found in DB/LOCAL_ABSPATH/CONFLICTS
- * according to CONFLICT_CHOICE.  (Don't mark it as resolved.)
+ * Resolve the tree conflict found in DB/LOCAL_ABSPATH according to
+ * CONFLICT_CHOICE.
  *
- * ### ... append to *WORK_ITEMS work items to ...?
+ * It is not an error if there is no tree conflict. If a tree conflict
+ * existed and was resolved, set *DID_RESOLVE to TRUE, else set it to FALSE.
  *
- * It is an error if there is no tree conflict.
+ * It is not an error if there is no tree conflict.
  */
 static svn_error_t *
-resolve_tree_conflict_on_node(svn_skel_t **work_items,
+resolve_tree_conflict_on_node(svn_boolean_t *did_resolve,
                               svn_wc__db_t *db,
                               const char *local_abspath,
-                              svn_wc_operation_t operation,
-                              svn_skel_t *conflicts,
                               svn_wc_conflict_choice_t conflict_choice,
                               svn_wc_notify_func2_t notify_func,
                               void *notify_baton,
@@ -2643,9 +2736,24 @@ resolve_tree_conflict_on_node(svn_skel_t
 {
   svn_wc_conflict_reason_t reason;
   svn_wc_conflict_action_t action;
-  svn_boolean_t did_resolve = FALSE;
+  svn_skel_t *conflicts;
+  svn_wc_operation_t operation;
+  svn_boolean_t tree_conflicted;
 
-  SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL, 
+  *did_resolve = FALSE;
+
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+                                   scratch_pool, scratch_pool));
+  if (!conflicts)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, NULL,
+                                     &tree_conflicted, db, local_abspath,
+                                     conflicts, scratch_pool, scratch_pool));
+  if (!tree_conflicted)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL,
                                               db, local_abspath,
                                               conflicts,
                                               scratch_pool, scratch_pool));
@@ -2663,7 +2771,7 @@ resolve_tree_conflict_on_node(svn_skel_t
               SVN_ERR(svn_wc__db_resolve_break_moved_away_children(
                         db, local_abspath, notify_func, notify_baton,
                         scratch_pool));
-              did_resolve = TRUE;
+              *did_resolve = TRUE;
             }
           else if (conflict_choice == svn_wc_conflict_choose_mine_conflict)
             {
@@ -2674,7 +2782,7 @@ resolve_tree_conflict_on_node(svn_skel_t
               SVN_ERR(svn_wc__db_resolve_delete_raise_moved_away(
                         db, local_abspath, notify_func, notify_baton,
                         scratch_pool));
-              did_resolve = TRUE;
+              *did_resolve = TRUE;
             }
           else
             return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
@@ -2699,7 +2807,7 @@ resolve_tree_conflict_on_node(svn_skel_t
                         notify_func, notify_baton,
                         cancel_func, cancel_baton,
                         scratch_pool));
-              did_resolve = TRUE;
+              *did_resolve = TRUE;
             }
           else if (conflict_choice == svn_wc_conflict_choose_merged)
             {
@@ -2714,7 +2822,7 @@ resolve_tree_conflict_on_node(svn_skel_t
                                                           notify_func,
                                                           notify_baton,
                                                           scratch_pool));
-              did_resolve = TRUE;
+              *did_resolve = TRUE;
             }
           else
             return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
@@ -2727,7 +2835,7 @@ resolve_tree_conflict_on_node(svn_skel_t
         }
     }
 
-  if (! did_resolve && conflict_choice != svn_wc_conflict_choose_merged)
+  if (! *did_resolve && conflict_choice != svn_wc_conflict_choose_merged)
     {
       /* For other tree conflicts, there is no way to pick
        * theirs-full or mine-full, etc. Throw an error if the
@@ -2741,110 +2849,13 @@ resolve_tree_conflict_on_node(svn_skel_t
                                                       scratch_pool));
     }
 
+  SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath, FALSE, FALSE, TRUE,
+                                      NULL, scratch_pool));
+  SVN_ERR(svn_wc__wq_run(db, local_abspath, cancel_func, cancel_baton,
+                         scratch_pool));
   return SVN_NO_ERROR;
 }
 
-/* Conflict resolution involves removing the conflict files, if they exist,
-   and clearing the conflict filenames from the entry.  The latter needs to
-   be done whether or not the conflict files exist.
-
-   ### This func combines *resolving* and *marking as resolved* -- seems poor.
-
-   LOCAL_ABSPATH in DB is the path to the item to be resolved.
-   RESOLVE_TEXT, RESOLVE_PROPS and RESOLVE_TREE are TRUE iff text, property
-   and tree conflicts respectively are to be resolved.
-
-   If this call marks any conflict as resolved, set *DID_RESOLVE to true,
-   else to false.
-   If asked to resolve a text or prop conflict, only set *DID_RESOLVE
-   to true if a conflict marker file was present, because if no marker
-   file was present then the conflict is considered to be marked as
-   resolved already.
-   ### If asked to resolve a tree conflict, always set *DID_RESOLVE to true.
-       This would make sense if 'resolve_tree' is only requested when
-       there is in fact a tree conflict to be resolved, but, for
-       consistency with text & prop conflicts, the code should probably
-       say "if (resolve_tree && tree_conflicted) *did_resolve = TRUE".
-
-   See svn_wc_resolved_conflict5() for how CONFLICT_CHOICE behaves.
-*/
-static svn_error_t *
-resolve_conflict_on_node(svn_boolean_t *did_resolve,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         svn_boolean_t resolve_text,
-                         svn_boolean_t resolve_props,
-                         svn_boolean_t resolve_tree,
-                         svn_wc_conflict_choice_t conflict_choice,
-                         svn_wc_notify_func2_t notify_func,
-                         void *notify_baton,
-                         svn_cancel_func_t cancel_func,
-                         void *cancel_baton,
-                         apr_pool_t *scratch_pool)
-{
-  svn_skel_t *conflicts;
-  svn_wc_operation_t operation;
-  svn_boolean_t text_conflicted;
-  svn_boolean_t prop_conflicted;
-  svn_boolean_t tree_conflicted;
-  svn_skel_t *work_items = NULL;
-
-  *did_resolve = FALSE;
-
-  SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
-                                   scratch_pool, scratch_pool));
-
-  if (!conflicts)
-    return SVN_NO_ERROR;
-
-  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, &text_conflicted,
-                                     &prop_conflicted, &tree_conflicted,
-                                     db, local_abspath, conflicts,
-                                     scratch_pool, scratch_pool));
-
-  if (resolve_text && text_conflicted)
-    SVN_ERR(resolve_text_conflict_on_node(did_resolve, &work_items,
-                                          db, local_abspath,
-                                          operation, conflicts,
-                                          conflict_choice,
-                                          scratch_pool));
-
-  if (resolve_props && prop_conflicted)
-    SVN_ERR(resolve_prop_conflict_on_node(did_resolve, &work_items,
-                                          db, local_abspath,
-                                          operation, conflicts,
-                                          conflict_choice,
-                                          scratch_pool));
-
-  if (resolve_tree)
-    {
-      SVN_ERR(resolve_tree_conflict_on_node(&work_items,
-                                            db, local_abspath,
-                                            operation, conflicts,
-                                            conflict_choice,
-                                            notify_func, notify_baton,
-                                            cancel_func, cancel_baton,
-                                            scratch_pool));
-      *did_resolve = TRUE;
-    }
-
-  if (resolve_text || resolve_props || resolve_tree)
-    {
-      SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath,
-                                          resolve_text, resolve_props,
-                                          resolve_tree, work_items,
-                                          scratch_pool));
-
-      /* Run the work queue to remove conflict marker files. */
-      SVN_ERR(svn_wc__wq_run(db, local_abspath,
-                             cancel_func, cancel_baton,
-                             scratch_pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
 svn_error_t *
 svn_wc__mark_resolved_text_conflict(svn_wc__db_t *db,
                                     const char *local_abspath,
@@ -2852,15 +2863,11 @@ svn_wc__mark_resolved_text_conflict(svn_
 {
   svn_boolean_t ignored_result;
 
-  return svn_error_trace(resolve_conflict_on_node(
+  return svn_error_trace(resolve_text_conflict_on_node(
                            &ignored_result,
                            db, local_abspath,
-                           TRUE /* resolve_text */,
-                           FALSE /* resolve_props */,
-                           FALSE /* resolve_tree */,
-                           svn_wc_conflict_choose_merged,
-                           NULL, NULL, /* notify_func */
-                           NULL, NULL, /* cancel_func */
+                           svn_wc_conflict_choose_merged, NULL,
+                           NULL, NULL,
                            scratch_pool));
 }
 
@@ -2871,15 +2878,11 @@ svn_wc__mark_resolved_prop_conflicts(svn
 {
   svn_boolean_t ignored_result;
 
-  return svn_error_trace(resolve_conflict_on_node(
+  return svn_error_trace(resolve_prop_conflict_on_node(
                            &ignored_result,
-                           db, local_abspath,
-                           FALSE /* resolve_text */,
-                           TRUE /* resolve_props */,
-                           FALSE /* resolve_tree */,
-                           svn_wc_conflict_choose_merged,
-                           NULL, NULL, /* notify_func */
-                           NULL, NULL, /* cancel_func */
+                           db, local_abspath, "",
+                           svn_wc_conflict_choose_merged, NULL,
+                           NULL, NULL,
                            scratch_pool));
 }
 
@@ -2901,8 +2904,6 @@ struct conflict_status_walker_baton
 };
 
 /* Implements svn_wc_status4_t to walk all conflicts to resolve.
- *
- * ### Bug: ignores the resolver callback's 'result->merged_file' output.
  */
 static svn_error_t *
 conflict_status_walker(void *baton,
@@ -2931,6 +2932,7 @@ conflict_status_walker(void *baton,
       const svn_wc_conflict_description2_t *cd;
       svn_boolean_t did_resolve;
       svn_wc_conflict_choice_t my_choice = cswb->conflict_choice;
+      const char *merged_file = NULL;
 
       cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description2_t *);
 
@@ -2949,7 +2951,8 @@ conflict_status_walker(void *baton,
                                       iterpool, iterpool));
 
           my_choice = result->choice;
-          /* ### Bug: ignores result->merged_file (and ->save_merged) */
+          merged_file = result->merged_file;
+          /* ### Bug: ignores result->save_merged */
         }
 
 
@@ -2961,18 +2964,15 @@ conflict_status_walker(void *baton,
           case svn_wc_conflict_kind_tree:
             if (!cswb->resolve_tree)
               break;
-            SVN_ERR(resolve_conflict_on_node(&did_resolve,
-                                             db,
-                                             local_abspath,
-                                             FALSE /* resolve_text */,
-                                             FALSE /* resolve_props */,
-                                             TRUE /* resolve_tree */,
-                                             my_choice,
-                                             cswb->notify_func,
-                                             cswb->notify_baton,
-                                             cswb->cancel_func,
-                                             cswb->cancel_baton,
-                                             iterpool));
+            SVN_ERR(resolve_tree_conflict_on_node(&did_resolve,
+                                                  db,
+                                                  local_abspath,
+                                                  my_choice,
+                                                  cswb->notify_func,
+                                                  cswb->notify_baton,
+                                                  cswb->cancel_func,
+                                                  cswb->cancel_baton,
+                                                  iterpool));
 
             resolved = TRUE;
             break;
@@ -2981,18 +2981,14 @@ conflict_status_walker(void *baton,
             if (!cswb->resolve_text)
               break;
 
-            SVN_ERR(resolve_conflict_on_node(&did_resolve,
-                                             db,
-                                             local_abspath,
-                                             TRUE /* resolve_text */,
-                                             FALSE /* resolve_props */,
-                                             FALSE /* resolve_tree */,
-                                             my_choice,
-                                             cswb->notify_func,
-                                             cswb->notify_baton,
-                                             cswb->cancel_func,
-                                             cswb->cancel_baton,
-                                             iterpool));
+            SVN_ERR(resolve_text_conflict_on_node(&did_resolve,
+                                                  db,
+                                                  local_abspath,
+                                                  my_choice,
+                                                  merged_file,
+                                                  cswb->cancel_func,
+                                                  cswb->cancel_baton,
+                                                  iterpool));
 
             if (did_resolve)
               resolved = TRUE;
@@ -3002,28 +2998,21 @@ conflict_status_walker(void *baton,
             if (!cswb->resolve_prop)
               break;
 
-            /* ### this is bogus. resolve_conflict_on_node() does not handle
-               ### individual property resolution.  */
             if (*cswb->resolve_prop != '\0' &&
                 strcmp(cswb->resolve_prop, cd->property_name) != 0)
               {
-                break; /* Skip this property conflict */
+                break; /* This is not the property we want to resolve. */
               }
 
-
-            /* We don't have property name handling here yet :( */
-            SVN_ERR(resolve_conflict_on_node(&did_resolve,
-                                             db,
-                                             local_abspath,
-                                             FALSE /* resolve_text */,
-                                             TRUE /* resolve_props */,
-                                             FALSE /* resolve_tree */,
-                                             my_choice,
-                                             cswb->notify_func,
-                                             cswb->notify_baton,
-                                             cswb->cancel_func,
-                                             cswb->cancel_baton,
-                                             iterpool));
+            SVN_ERR(resolve_prop_conflict_on_node(&did_resolve,
+                                                  db,
+                                                  local_abspath,
+                                                  cd->property_name,
+                                                  my_choice,
+                                                  merged_file,
+                                                  cswb->cancel_func,
+                                                  cswb->cancel_baton,
+                                                  iterpool));
 
             if (did_resolve)
               resolved = TRUE;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.h?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.h Wed Jun  5 09:22:43 2013
@@ -401,14 +401,18 @@ svn_wc__conflict_create_markers(svn_skel
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool);
 
-/* Call the interactive conflict resolver RESOLVER_FUNC with RESOLVER_BATON to
-   allow resolving the conflicts on LOCAL_ABSPATH.
+/* Call the conflict resolver RESOLVER_FUNC with RESOLVER_BATON for each
+   of the conflicts on LOCAL_ABSPATH.  Depending on the results that
+   the callback returns, perhaps resolve the conflicts, and perhaps mark
+   them as resolved in the WC DB.
 
    Call RESOLVER_FUNC once for each property conflict, and again for any
    text conflict, and again for any tree conflict on the node.
 
    CONFLICT_SKEL contains the details of the conflicts on LOCAL_ABSPATH.
 
+   Use MERGE_OPTIONS when the resolver requests a merge.
+
    Resolver actions are directly applied to the in-db state of LOCAL_ABSPATH,
    so the conflict and the state in CONFLICT_SKEL must already be installed in
    wc.db. */

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c Wed Jun  5 09:22:43 2013
@@ -779,7 +779,7 @@ copy_or_move(svn_boolean_t *move_degrade
         {
           svn_revnum_t min_rev;
           svn_revnum_t max_rev;
-        
+
           /* Verify that the move source is a single-revision subtree. */
           SVN_ERR(svn_wc__db_min_max_revisions(&min_rev, &max_rev, db,
                                                src_abspath, FALSE, scratch_pool));

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c Wed Jun  5 09:22:43 2013
@@ -82,7 +82,7 @@
 
 /* Overall crawler editor baton.
  */
-struct edit_baton_t 
+struct edit_baton_t
 {
   /* A wc db. */
   svn_wc__db_t *db;
@@ -2362,9 +2362,9 @@ wrap_ensure_empty_file(wc_diff_wrap_bato
     return SVN_NO_ERROR;
 
   /* Create a unique file in the tempdir */
-  SVN_ERR(svn_io_open_uniquely_named(NULL, &wb->empty_file, NULL, NULL, NULL,
-                                     svn_io_file_del_on_pool_cleanup,
-                                     wb->result_pool, scratch_pool));
+  SVN_ERR(svn_io_open_unique_file3(NULL, &wb->empty_file, NULL,
+                                   svn_io_file_del_on_pool_cleanup,
+                                   wb->result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2431,8 +2431,8 @@ wrap_dir_opened(void **new_dir_baton,
 /* svn_diff_tree_processor_t function */
 static svn_error_t *
 wrap_dir_added(const char *relpath,
-               const svn_diff_source_t *right_source,
                const svn_diff_source_t *copyfrom_source,
+               const svn_diff_source_t *right_source,
                /*const*/ apr_hash_t *copyfrom_props,
                /*const*/ apr_hash_t *right_props,
                void *dir_baton,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c Wed Jun  5 09:22:43 2013
@@ -201,6 +201,15 @@ diff_status_callback(void *baton,
       case svn_wc_status_ignored:
         return SVN_NO_ERROR; /* No diff */
 
+      case svn_wc_status_conflicted:
+        if (status->text_status == svn_wc_status_none
+            && status->prop_status == svn_wc_status_none)
+          {
+            /* Node is an actual only node describing a tree conflict */
+            return SVN_NO_ERROR;
+          }
+        break;
+
       default:
         break; /* Go check other conditions */
     }
@@ -355,7 +364,7 @@ diff_status_callback(void *baton,
                                                    SVN_INVALID_REVNUM,
                                                    eb->changelist_hash,
                                                    eb->processor,
-                                                   eb->cur 
+                                                   eb->cur
                                                         ? eb->cur->baton
                                                         : NULL,
                                                    FALSE,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c Wed Jun  5 09:22:43 2013
@@ -73,6 +73,7 @@ typedef struct db_node_t {
   apr_time_t recorded_time;
   apr_hash_t *properties;
   svn_boolean_t file_external;
+  apr_array_header_t *inherited_props;
 } db_node_t;
 
 typedef struct db_actual_node_t {
@@ -1521,6 +1522,10 @@ insert_node(svn_sqlite__db_t *sdb,
   if (node->file_external)
     SVN_ERR(svn_sqlite__bind_int(stmt, 20, 1));
 
+  if (node->inherited_props)
+    SVN_ERR(svn_sqlite__bind_iprops(stmt, 23, node->inherited_props,
+                                    scratch_pool));
+
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
 
   return SVN_NO_ERROR;
@@ -1560,7 +1565,9 @@ insert_actual_node(svn_sqlite__db_t *sdb
                                 actual_node->conflict_new,
                                 actual_node->prop_reject,
                                 actual_node->tree_conflict_data,
-                                strlen(actual_node->tree_conflict_data),
+                                actual_node->tree_conflict_data
+                                    ? strlen(actual_node->tree_conflict_data)
+                                    : 0,
                                 scratch_pool, scratch_pool));
 
   if (conflict_data)
@@ -1574,6 +1581,31 @@ insert_actual_node(svn_sqlite__db_t *sdb
   return svn_error_trace(svn_sqlite__insert(NULL, stmt));
 }
 
+static svn_boolean_t
+is_switched(db_node_t *parent,
+            db_node_t *child,
+            apr_pool_t *scratch_pool)
+{
+  if (parent && child)
+    {
+      if (parent->repos_id != child->repos_id)
+        return TRUE;
+
+      if (parent->repos_relpath && child->repos_relpath)
+        {
+          const char *unswitched
+            = svn_relpath_join(parent->repos_relpath,
+                               svn_relpath_basename(child->local_relpath,
+                                                    scratch_pool),
+                               scratch_pool);
+          if (strcmp(unswitched, child->repos_relpath))
+            return TRUE;
+        }
+    }
+
+  return FALSE;
+}
+
 struct write_baton {
   db_node_t *base;
   db_node_t *work;
@@ -1706,7 +1738,7 @@ write_entry(struct write_baton **entry_n
   */
 
   WRITE_ENTRY_ASSERT(parent_node || entry->schedule == svn_wc_schedule_normal);
-                                                                    
+
   WRITE_ENTRY_ASSERT(!parent_node || parent_node->base
                      || parent_node->below_work || parent_node->work);
 
@@ -2071,6 +2103,12 @@ write_entry(struct write_baton **entry_n
       if (entry->file_external_path)
         base_node->file_external = TRUE;
 
+      /* Switched nodes get an empty iprops cache. */
+      if (parent_node
+          && is_switched(parent_node->base, base_node, scratch_pool))
+        base_node->inherited_props
+          = apr_array_make(scratch_pool, 0, sizeof(svn_prop_inherited_item_t*));
+
       SVN_ERR(insert_node(sdb, base_node, scratch_pool));
 
       /* We have to insert the lock after the base node, because the node
@@ -2104,7 +2142,7 @@ write_entry(struct write_baton **entry_n
       below_working_node->repos_id = work->repos_id;
 
       /* This is just guessing. If the node below would have been switched
-         or if it was updated to a different version, the guess would 
+         or if it was updated to a different version, the guess would
          fail. But we don't have better information pre wc-ng :( */
       if (work->repos_relpath)
         below_working_node->repos_relpath

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c Wed Jun  5 09:22:43 2013
@@ -769,7 +769,7 @@ merge_file_trivial(svn_skel_t **work_ite
     {
       /* If the locally existing, changed file equals the incoming 'right'
        * file, there is no conflict.  For binary files, we historically
-       * conflicted them needlessly, while merge_text_file figured it out 
+       * conflicted them needlessly, while merge_text_file figured it out
        * eventually and returned svn_wc_merge_unchanged for them, which
        * is what we do here. */
       if (same_right_target)
@@ -871,10 +871,11 @@ merge_text_file(svn_skel_t **work_items,
   SVN_ERR(svn_io_file_close(result_f, pool));
 
   /* Determine the MERGE_OUTCOME, and record any conflict. */
-  if (contains_conflicts && ! dry_run)
+  if (contains_conflicts)
     {
       *merge_outcome = svn_wc_merge_conflict;
-      if (*merge_outcome == svn_wc_merge_conflict)
+
+      if (! dry_run)
         {
           const char *left_copy, *right_copy, *target_copy;
 
@@ -902,12 +903,7 @@ merge_text_file(svn_skel_t **work_items,
                                                           result_pool,
                                                           scratch_pool));
         }
-
-      if (*merge_outcome == svn_wc_merge_merged)
-        goto done;
     }
-  else if (contains_conflicts && dry_run)
-      *merge_outcome = svn_wc_merge_conflict;
   else
     {
       svn_boolean_t same, special;
@@ -941,7 +937,6 @@ merge_text_file(svn_skel_t **work_items,
       *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
     }
 
-done:
   /* Remove the tempfile after use */
   SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, mt->local_abspath,
                                        result_target,
@@ -1419,6 +1414,6 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
             *merge_content_outcome = svn_wc_merge_merged;
         }
     }
-  
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c Wed Jun  5 09:22:43 2013
@@ -81,12 +81,10 @@ append_prop_conflict(svn_stream_t *strea
   /* TODO:  someday, perhaps prefix each conflict_description with a
      timestamp or something? */
   const svn_string_t *conflict_desc;
-  const char *native_text;
 
   SVN_ERR(prop_conflict_from_skel(&conflict_desc, prop_skel, pool, pool));
-  native_text = svn_utf_cstring_from_utf8_fuzzy(conflict_desc->data, pool);
 
-  return svn_stream_puts(stream, native_text);
+  return svn_stream_puts(stream, conflict_desc->data);
 }
 
 /*---------------------------------------------------------------------*/
@@ -614,12 +612,26 @@ prop_conflict_from_skel(const svn_string
           const char *mine_marker = _("<<<<<<< (local property value)");
           const char *incoming_marker = _(">>>>>>> (incoming property value)");
           const char *separator = "=======";
+          svn_string_t *original_ascii =
+            svn_string_create(svn_utf_cstring_from_utf8_fuzzy(original->data,
+                                                              scratch_pool),
+                              scratch_pool);
+          svn_string_t *mine_ascii =
+            svn_string_create(svn_utf_cstring_from_utf8_fuzzy(mine->data,
+                                                              scratch_pool),
+                              scratch_pool);
+          svn_string_t *incoming_ascii =
+            svn_string_create(svn_utf_cstring_from_utf8_fuzzy(incoming->data,
+                                                              scratch_pool),
+                              scratch_pool);
 
           style = svn_diff_conflict_display_modified_latest;
           stream = svn_stream_from_stringbuf(buf, scratch_pool);
           SVN_ERR(svn_stream_skip(stream, buf->len));
           SVN_ERR(svn_diff_mem_string_output_merge2(stream, diff,
-                                                    original, mine, incoming,
+                                                    original_ascii,
+                                                    mine_ascii,
+                                                    incoming_ascii,
                                                     NULL, mine_marker,
                                                     incoming_marker, separator,
                                                     style, scratch_pool));
@@ -1158,7 +1170,7 @@ svn_wc__merge_props(svn_skel_t **conflic
       to_val = to_val ? svn_string_dup(to_val, result_pool) : NULL;
 
       svn_hash_sets(their_props, propname, to_val);
-      
+
 
       /* We already know that state is at least `changed', so mark
          that, but remember that we may later upgrade to `merged' or
@@ -1626,9 +1638,9 @@ validate_eol_prop_against_file(const cha
   if (mime_type && svn_mime_type_is_binary(mime_type->data))
     return svn_error_createf
       (SVN_ERR_ILLEGAL_TARGET, NULL,
-       _("Can't set '" SVN_PROP_EOL_STYLE "': "
+       _("Can't set '%s': "
          "file '%s' has binary mime type property"),
-       path_display);
+       SVN_PROP_EOL_STYLE, path_display);
 
   /* Now ask the getter for the contents of the file; this will do a
      newline translation.  All we really care about here is whether or