subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1674436 - in /subversion/branches/1.9.x: ./ subversion/libsvn_wc/ subversion/svn/ subversion/tests/libsvn_wc/
Date Sat, 18 Apr 2015 04:00:41 GMT
Author: svn-role
Date: Sat Apr 18 04:00:40 2015
New Revision: 1674436

URL: http://svn.apache.org/r1674436
Log:
Merge the r1667228 group from trunk:

 * r1667228, r1667234, r1667249, r1667250, r1667258, r1667290, r1667691, r1667692, r1667693
   Fix various problems with binary file conflicts.
   Justification:
     Conflict description API violates its own promises for binaries.
     Current behaviour can cause user confusion since conflict prompt
     options for binary files won't work as expected.
   Notes:
     r1667258, r1667290 resolve a performance regression introduced by the
     code which now needs the actual property values. It also avoids creating temporary
     files for property conflicts in cases where a caller can never use them.
   Votes:
     +1: rhuijben, stefan2, brane, philip
     +1: stsp (r1667228, r1667234, r1667249, r1667250, r1667691, r1667692, r1667693 only)

Modified:
    subversion/branches/1.9.x/   (props changed)
    subversion/branches/1.9.x/STATUS
    subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c
    subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.h
    subversion/branches/1.9.x/subversion/libsvn_wc/copy.c
    subversion/branches/1.9.x/subversion/libsvn_wc/delete.c
    subversion/branches/1.9.x/subversion/libsvn_wc/entries.c
    subversion/branches/1.9.x/subversion/libsvn_wc/info.c
    subversion/branches/1.9.x/subversion/libsvn_wc/merge.c
    subversion/branches/1.9.x/subversion/libsvn_wc/props.c
    subversion/branches/1.9.x/subversion/libsvn_wc/questions.c
    subversion/branches/1.9.x/subversion/libsvn_wc/tree_conflicts.c
    subversion/branches/1.9.x/subversion/libsvn_wc/update_editor.c
    subversion/branches/1.9.x/subversion/libsvn_wc/wc.h
    subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.c
    subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.h
    subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_private.h
    subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_update_move.c
    subversion/branches/1.9.x/subversion/libsvn_wc/workqueue.c
    subversion/branches/1.9.x/subversion/svn/conflict-callbacks.c
    subversion/branches/1.9.x/subversion/tests/libsvn_wc/conflict-data-test.c
    subversion/branches/1.9.x/subversion/tests/libsvn_wc/op-depth-test.c

Propchange: subversion/branches/1.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Apr 18 04:00:40 2015
@@ -91,4 +91,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663697,1663706,1663738,1663749,1663791,1663991,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666851,1667101,1667106-1667107,1667233,1667235,1667301,1667471,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,1670347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,167
 3065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170
+/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663697,1663706,1663738,1663749,1663791,1663991,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666851,1667101,1667106-1667107,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,1670347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,167
 2511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170

Modified: subversion/branches/1.9.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/STATUS?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/STATUS (original)
+++ subversion/branches/1.9.x/STATUS Sat Apr 18 04:00:40 2015
@@ -38,20 +38,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1667228, r1667234, r1667249, r1667250, r1667258, r1667290, r1667691, r1667692, r1667693
-   Fix various problems with binary file conflicts.
-   Justification:
-     Conflict description API violates its own promises for binaries.
-     Current behaviour can cause user confusion since conflict prompt
-     options for binary files won't work as expected.
-   Notes:
-     r1667258, r1667290 resolve a performance regression introduced by the
-     code which now needs the actual property values. It also avoids creating temporary
-     files for property conflicts in cases where a caller can never use them.
-   Votes:
-     +1: rhuijben, stefan2, brane, philip
-     +1: stsp (r1667228, r1667234, r1667249, r1667250, r1667691, r1667692, r1667693 only)
-
  * r1663671, r1666832
    Resolve an assertion on a bad update report involving incomplete status
    Justification:

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c Sat Apr 18 04:00:40 2015
@@ -1142,6 +1142,7 @@ static svn_error_t *
 generate_propconflict(svn_boolean_t *conflict_remains,
                       svn_wc__db_t *db,
                       const char *local_abspath,
+                      svn_node_kind_t kind,
                       svn_wc_operation_t operation,
                       const svn_wc_conflict_version_t *left_version,
                       const svn_wc_conflict_version_t *right_version,
@@ -1159,24 +1160,11 @@ generate_propconflict(svn_boolean_t *con
   svn_wc_conflict_result_t *result = NULL;
   svn_wc_conflict_description2_t *cdesc;
   const char *dirpath = svn_dirent_dirname(local_abspath, scratch_pool);
-  svn_node_kind_t kind;
   const svn_string_t *new_value = NULL;
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
-                               FALSE /* allow_missing */,
-                               FALSE /* show_deleted */,
-                               FALSE /* show_hidden */,
-                               scratch_pool));
-
-  if (kind == svn_node_none)
-    return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                             _("The node '%s' was not found."),
-                             svn_dirent_local_style(local_abspath,
-                                                    scratch_pool));
-
   cdesc = svn_wc_conflict_description_create_prop2(
                 local_abspath,
-                (kind == svn_node_dir) ? svn_node_dir : svn_node_file,
+                kind,
                 propname, scratch_pool);
 
   cdesc->operation = operation;
@@ -1681,7 +1669,13 @@ build_text_conflict_resolve_items(svn_sk
         SVN_ERR_ASSERT(choice == svn_wc_conflict_choose_postpone);
     }
 
-  SVN_ERR_ASSERT(install_from_abspath != NULL);
+  if (install_from_abspath == NULL)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("Conflict on '%s' could not be resolved "
+                               "because the chosen version of the file "
+                               "is not available."),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
 
   /* ### It would be nice if we could somehow pass RECORD_FILEINFO
          as true in some easy cases. */
@@ -1739,7 +1733,6 @@ read_text_conflict_desc(svn_wc_conflict_
                         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,
@@ -1748,8 +1741,8 @@ read_text_conflict_desc(svn_wc_conflict_
                         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)->is_binary = mime_type ? svn_mime_type_is_binary(mime_type) : FALSE;
   (*desc)->operation = operation;
   (*desc)->src_left_version = left_version;
   (*desc)->src_right_version = right_version;
@@ -1839,6 +1832,7 @@ resolve_tree_conflict_on_node(svn_boolea
 svn_error_t *
 svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
                                  const char *local_abspath,
+                                 svn_node_kind_t kind,
                                  const svn_skel_t *conflict_skel,
                                  const apr_array_header_t *merge_options,
                                  svn_wc_conflict_resolver_func2_t resolver_func,
@@ -1915,7 +1909,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
             SVN_ERR(cancel_func(cancel_baton));
 
           SVN_ERR(generate_propconflict(&conflict_remains,
-                                        db, local_abspath,
+                                        db, local_abspath, kind,
                                         operation,
                                         left_version,
                                         right_version,
@@ -1960,7 +1954,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
                                     scratch_pool, scratch_pool));
 
       SVN_ERR(read_text_conflict_desc(&desc,
-                                      db, local_abspath, conflict_skel, FALSE,
+                                      db, local_abspath, conflict_skel,
                                       svn_prop_get_value(props,
                                                          SVN_PROP_MIME_TYPE),
                                       operation, left_version, right_version,
@@ -2066,7 +2060,7 @@ read_prop_conflict_descs(apr_array_heade
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
-  const char *prop_reject_file;
+  const char *prop_reject_abspath;
   apr_hash_t *base_props;
   apr_hash_t *my_props;
   apr_hash_t *their_old_props;
@@ -2074,8 +2068,16 @@ read_prop_conflict_descs(apr_array_heade
   apr_hash_t *conflicted_props;
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
+  svn_boolean_t prop_conflicted;
 
-  SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_file,
+  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, &prop_conflicted,
+                                     NULL, db, local_abspath, conflict_skel,
+                                     scratch_pool, scratch_pool));
+
+  if (!prop_conflicted)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_abspath,
                                               &my_props,
                                               &their_old_props,
                                               &their_props,
@@ -2084,7 +2086,9 @@ read_prop_conflict_descs(apr_array_heade
                                               conflict_skel,
                                               scratch_pool, scratch_pool));
 
-  if ((! create_tempfiles) || apr_hash_count(conflicted_props) == 0)
+  prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_abspath);
+
+  if (apr_hash_count(conflicted_props) == 0)
     {
       /* Legacy prop conflict with only a .reject file. */
       svn_wc_conflict_description2_t *desc;
@@ -2095,7 +2099,7 @@ read_prop_conflict_descs(apr_array_heade
 
       /* ### For property conflicts, cd2 stores prop_reject_abspath in
        * ### their_abspath, and stores theirs_abspath in merged_file. */
-      desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->prop_reject_abspath = prop_reject_abspath; /* in result_pool */
       desc->their_abspath = desc->prop_reject_abspath;
 
       desc->operation = operation;
@@ -2107,8 +2111,11 @@ read_prop_conflict_descs(apr_array_heade
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_wc__db_read_pristine_props(&base_props, db, local_abspath,
-                                         result_pool, scratch_pool));
+  if (operation == svn_wc_operation_merge)
+    SVN_ERR(svn_wc__db_read_pristine_props(&base_props, db, local_abspath,
+                                           result_pool, scratch_pool));
+  else
+    base_props = NULL;
   iterpool = svn_pool_create(scratch_pool);
   for (hi = apr_hash_first(scratch_pool, conflicted_props);
        hi;
@@ -2155,22 +2162,26 @@ read_prop_conflict_descs(apr_array_heade
 
       /* ### For property conflicts, cd2 stores prop_reject_abspath in
        * ### their_abspath, and stores theirs_abspath in merged_file. */
-      desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->prop_reject_abspath = prop_reject_abspath; /* in result_pool */
       desc->their_abspath = desc->prop_reject_abspath;
 
-      desc->prop_value_base = svn_hash_gets(base_props, propname);
+      desc->prop_value_base = base_props ? svn_hash_gets(base_props, propname)
+                                         : desc->prop_value_incoming_old;
 
       if (my_value)
         {
           svn_stream_t *s;
           apr_size_t len;
 
-          SVN_ERR(svn_stream_open_unique(&s, &desc->my_abspath, NULL,
-                                         svn_io_file_del_on_pool_cleanup,
-                                         result_pool, iterpool));
-          len = my_value->len;
-          SVN_ERR(svn_stream_write(s, my_value->data, &len));
-          SVN_ERR(svn_stream_close(s));
+          if (create_tempfiles)
+            {
+              SVN_ERR(svn_stream_open_unique(&s, &desc->my_abspath, NULL,
+                                             svn_io_file_del_on_pool_cleanup,
+                                             result_pool, iterpool));
+              len = my_value->len;
+              SVN_ERR(svn_stream_write(s, my_value->data, &len));
+              SVN_ERR(svn_stream_close(s));
+            }
 
           desc->prop_value_working = svn_string_dup(my_value, result_pool);
         }
@@ -2182,12 +2193,15 @@ read_prop_conflict_descs(apr_array_heade
 
           /* ### For property conflicts, cd2 stores prop_reject_abspath in
            * ### their_abspath, and stores theirs_abspath in merged_file. */
-          SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
-                                         svn_io_file_del_on_pool_cleanup,
-                                         result_pool, iterpool));
-          len = their_value->len;
-          SVN_ERR(svn_stream_write(s, their_value->data, &len));
-          SVN_ERR(svn_stream_close(s));
+          if (create_tempfiles)
+            {
+              SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
+                                             svn_io_file_del_on_pool_cleanup,
+                                             result_pool, iterpool));
+              len = their_value->len;
+              SVN_ERR(svn_stream_write(s, their_value->data, &len));
+              SVN_ERR(svn_stream_close(s));
+            }
 
           desc->prop_value_incoming_new = svn_string_dup(their_value, result_pool);
         }
@@ -2197,12 +2211,15 @@ read_prop_conflict_descs(apr_array_heade
           svn_stream_t *s;
           apr_size_t len;
 
-          SVN_ERR(svn_stream_open_unique(&s, &desc->base_abspath, NULL,
-                                         svn_io_file_del_on_pool_cleanup,
-                                         result_pool, iterpool));
-          len = old_value->len;
-          SVN_ERR(svn_stream_write(s, old_value->data, &len));
-          SVN_ERR(svn_stream_close(s));
+          if (create_tempfiles)
+            {
+              SVN_ERR(svn_stream_open_unique(&s, &desc->base_abspath, NULL,
+                                             svn_io_file_del_on_pool_cleanup,
+                                             result_pool, iterpool));
+              len = old_value->len;
+              SVN_ERR(svn_stream_write(s, old_value->data, &len));
+              SVN_ERR(svn_stream_close(s));
+            }
 
           desc->prop_value_incoming_old = svn_string_dup(old_value, result_pool);
         }
@@ -2216,13 +2233,15 @@ read_prop_conflict_descs(apr_array_heade
 
 svn_error_t *
 svn_wc__read_conflicts(const apr_array_header_t **conflicts,
+                       svn_skel_t **conflict_skel,
                        svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t create_tempfiles,
+                       svn_boolean_t only_tree_conflict,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
 {
-  svn_skel_t *conflict_skel;
+  svn_skel_t *the_conflict_skel;
   apr_array_header_t *cflcts;
   svn_boolean_t prop_conflicted;
   svn_boolean_t text_conflicted;
@@ -2232,12 +2251,19 @@ svn_wc__read_conflicts(const apr_array_h
   const svn_wc_conflict_version_t *left_version = NULL;
   const svn_wc_conflict_version_t *right_version = NULL;
   svn_node_kind_t node_kind;
+  apr_hash_t *props;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict_skel, &node_kind,
+  if (!conflict_skel)
+    conflict_skel = &the_conflict_skel;
+
+  SVN_ERR(svn_wc__db_read_conflict(conflict_skel, &node_kind, &props,
                                    db, local_abspath,
-                                   scratch_pool, scratch_pool));
+                                   (conflict_skel == &the_conflict_skel)
+                                        ? scratch_pool
+                                        : result_pool,
+                                   scratch_pool));
 
-  if (!conflict_skel)
+  if (!*conflict_skel)
     {
       /* Some callers expect not NULL */
       *conflicts = apr_array_make(result_pool, 0,
@@ -2247,7 +2273,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,
+                                     db, local_abspath, *conflict_skel,
                                      result_pool, scratch_pool));
 
   cflcts = apr_array_make(result_pool, 4,
@@ -2258,22 +2284,23 @@ svn_wc__read_conflicts(const apr_array_h
   if (locations && locations->nelts > 1)
     right_version = APR_ARRAY_IDX(locations, 1, const svn_wc_conflict_version_t *);
 
-  if (prop_conflicted)
+  if (prop_conflicted && !only_tree_conflict)
     {
       SVN_ERR(read_prop_conflict_descs(cflcts,
-                                       db, local_abspath, conflict_skel,
+                                       db, local_abspath, *conflict_skel,
                                        create_tempfiles, node_kind,
                                        operation, left_version, right_version,
                                        result_pool, scratch_pool));
     }
 
-  if (text_conflicted)
+  if (text_conflicted && !only_tree_conflict)
     {
       svn_wc_conflict_description2_t *desc;
 
       SVN_ERR(read_text_conflict_desc(&desc,
-                                      db, local_abspath, conflict_skel,
-                                      FALSE /*is_binary*/, NULL /*mime_type*/,
+                                      db, local_abspath, *conflict_skel,
+                                      svn_prop_get_value(props,
+                                                         SVN_PROP_MIME_TYPE),
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
       APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t *) = desc;
@@ -2285,7 +2312,7 @@ svn_wc__read_conflicts(const apr_array_h
 
       SVN_ERR(read_tree_conflict_desc(&desc,
                                       db, local_abspath, node_kind,
-                                      conflict_skel,
+                                      *conflict_skel,
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
 
@@ -2655,7 +2682,7 @@ resolve_tree_conflict_on_node(svn_boolea
 
               /* We might now have a moved-away on *this* path, let's
                  try to resolve that directly if that is the case */
-              SVN_ERR(svn_wc__db_read_conflict(&new_conflicts, NULL,
+              SVN_ERR(svn_wc__db_read_conflict(&new_conflicts, NULL, NULL,
                                                db, local_abspath,
                                                scratch_pool, scratch_pool));
 
@@ -2826,7 +2853,8 @@ svn_wc__mark_resolved_text_conflict(svn_
   svn_skel_t *work_items;
   svn_skel_t *conflict;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, local_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                   db, local_abspath,
                                    scratch_pool, scratch_pool));
 
   if (!conflict)
@@ -2855,7 +2883,8 @@ svn_wc__mark_resolved_prop_conflicts(svn
   svn_boolean_t ignored_result;
   svn_skel_t *conflicts;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL,
+                                   db, local_abspath,
                                    scratch_pool, scratch_pool));
 
   if (!conflicts)
@@ -2940,10 +2969,10 @@ conflict_status_walker(void *baton,
 
   iterpool = svn_pool_create(scratch_pool);
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, local_abspath,
-                                   scratch_pool, scratch_pool));
-
-  SVN_ERR(svn_wc__read_conflicts(&conflicts, db, local_abspath, TRUE,
+  SVN_ERR(svn_wc__read_conflicts(&conflicts, &conflict,
+                                 db, local_abspath,
+                                 (cswb->conflict_func != NULL) /* tmp files */,
+                                 FALSE /* only tree conflicts */,
                                  scratch_pool, iterpool));
 
   for (i = 0; i < conflicts->nelts; i++)

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.h?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.h Sat Apr 18 04:00:40 2015
@@ -419,6 +419,7 @@ svn_wc__conflict_create_markers(svn_skel
 svn_error_t *
 svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
                                  const char *local_abspath,
+                                 svn_node_kind_t kind,
                                  const svn_skel_t *conflict_skel,
                                  const apr_array_header_t *merge_options,
                                  svn_wc_conflict_resolver_func2_t resolver_func,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/copy.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/copy.c Sat Apr 18 04:00:40 2015
@@ -258,8 +258,9 @@ copy_versioned_file(svn_wc__db_t *db,
           svn_error_t *err;
 
           /* Is there a text conflict at the source path? */
-          SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, src_abspath,
-                                         scratch_pool, scratch_pool));
+          SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                           db, src_abspath,
+                                           scratch_pool, scratch_pool));
 
           err = svn_wc__conflict_read_text_conflict(&conflict_working, NULL, NULL,
                                                     db, src_abspath, conflict,
@@ -945,7 +946,8 @@ remove_node_conflict_markers(svn_wc__db_
 {
   svn_skel_t *conflict;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, src_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                   db, src_abspath,
                                    scratch_pool, scratch_pool));
 
   /* Do we have conflict markers that should be removed? */

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/delete.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/delete.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/delete.c Sat Apr 18 04:00:40 2015
@@ -135,7 +135,8 @@ create_delete_wq_items(svn_skel_t **work
       const apr_array_header_t *markers;
       int i;
 
-      SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, local_abspath,
+      SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                       db, local_abspath,
                                        scratch_pool, scratch_pool));
 
       SVN_ERR(svn_wc__conflict_read_markers(&markers, db, local_abspath,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/entries.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/entries.c Sat Apr 18 04:00:40 2015
@@ -483,9 +483,10 @@ read_one_entry(const svn_wc_entry_t **ne
           child_abspath = svn_dirent_join(dir_abspath, child_name,
                                           scratch_pool);
 
-          SVN_ERR(svn_wc__read_conflicts(&child_conflicts,
+          SVN_ERR(svn_wc__read_conflicts(&child_conflicts, NULL,
                                          db, child_abspath,
                                          FALSE /* create tempfiles */,
+                                         TRUE /* tree_conflicts_only */,
                                          scratch_pool, scratch_pool));
 
           for (j = 0; j < child_conflicts->nelts; j++)
@@ -938,7 +939,7 @@ read_one_entry(const svn_wc_entry_t **ne
       svn_skel_t *conflict;
       svn_boolean_t text_conflicted;
       svn_boolean_t prop_conflicted;
-      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL,
+      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, NULL,
                                                 wcroot, entry_relpath,
                                                 scratch_pool, scratch_pool));
 

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/info.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/info.c Sat Apr 18 04:00:40 2015
@@ -283,9 +283,10 @@ build_info_for_node(svn_wc__info2_t **in
                                 local_abspath, result_pool, scratch_pool));
 
   if (conflicted)
-    SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
-                                   local_abspath,
-                                   TRUE /* ### create tempfiles */,
+    SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, NULL,
+                                   db, local_abspath,
+                                   FALSE /* create tempfiles */,
+                                   FALSE /* only tree conflicts */,
                                    result_pool, scratch_pool));
   else
     wc_info->conflicts = NULL;
@@ -530,9 +531,10 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
       info->repos_root_URL = repos_root_url;
       info->repos_UUID = repos_uuid;
 
-      SVN_ERR(svn_wc__read_conflicts(&conflicts,
+      SVN_ERR(svn_wc__read_conflicts(&conflicts, NULL,
                                      wc_ctx->db, this_abspath,
-                                     TRUE /* ### create tempfiles */,
+                                     FALSE /* create tempfiles */,
+                                     FALSE /* only tree conflicts */,
                                      iterpool, iterpool));
       if (! conflicts || ! conflicts->nelts)
         continue;

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/merge.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/merge.c Sat Apr 18 04:00:40 2015
@@ -1230,6 +1230,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
   apr_hash_t *pristine_props = NULL;
   apr_hash_t *old_actual_props;
   apr_hash_t *new_actual_props = NULL;
+  svn_node_kind_t kind;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(left_abspath));
   SVN_ERR_ASSERT(svn_dirent_is_absolute(right_abspath));
@@ -1242,7 +1243,6 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
   /* Sanity check:  the merge target must be a file under revision control */
   {
     svn_wc__db_status_t status;
-    svn_node_kind_t kind;
     svn_boolean_t had_props;
     svn_boolean_t props_mod;
     svn_boolean_t conflicted;
@@ -1405,7 +1405,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
           svn_boolean_t text_conflicted, prop_conflicted;
 
           SVN_ERR(svn_wc__conflict_invoke_resolver(
-                    wc_ctx->db, target_abspath,
+                    wc_ctx->db, target_abspath, kind,
                     conflict_skel, merge_options,
                     conflict_func, conflict_baton,
                     cancel_func, cancel_baton,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/props.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/props.c Sat Apr 18 04:00:40 2015
@@ -327,7 +327,8 @@ svn_wc_merge_props3(svn_wc_notify_state_
     {
       svn_boolean_t prop_conflicted;
 
-      SVN_ERR(svn_wc__conflict_invoke_resolver(db, local_abspath, conflict_skel,
+      SVN_ERR(svn_wc__conflict_invoke_resolver(db, local_abspath, kind,
+                                               conflict_skel,
                                                NULL /* merge_options */,
                                                conflict_func, conflict_baton,
                                                cancel_func, cancel_baton,
@@ -750,7 +751,8 @@ svn_wc__create_prejfile(const char **tmp
       apr_hash_t *conflicted_props;
       svn_skel_t *conflicts;
 
-      SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+      SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL,
+                                       db, local_abspath,
                                       scratch_pool, scratch_pool));
 
       SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, NULL, NULL,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/questions.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/questions.c Sat Apr 18 04:00:40 2015
@@ -369,7 +369,8 @@ internal_conflicted_p(svn_boolean_t *tex
   svn_boolean_t resolved_text = FALSE;
   svn_boolean_t resolved_props = FALSE;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL,
+                                   db, local_abspath,
                                    scratch_pool, scratch_pool));
 
   if (!conflicts)

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/tree_conflicts.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/tree_conflicts.c Sat Apr 18 04:00:40 2015
@@ -485,8 +485,10 @@ svn_wc__get_tree_conflict(const svn_wc_c
   int i;
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(svn_wc__read_conflicts(&conflicts,
-                                 wc_ctx->db, local_abspath, FALSE,
+  SVN_ERR(svn_wc__read_conflicts(&conflicts, NULL,
+                                 wc_ctx->db, local_abspath,
+                                 FALSE /* temp files */,
+                                 TRUE /* only tree conflicts */,
                                  scratch_pool, scratch_pool));
 
   if (!conflicts || conflicts->nelts == 0)

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/update_editor.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/update_editor.c Sat Apr 18 04:00:40 2015
@@ -1812,6 +1812,7 @@ delete_entry(const char *path,
     {
       if (eb->conflict_func)
         SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, local_abspath,
+                                                 kind,
                                                  tree_conflict,
                                                  NULL /* merge_options */,
                                                  eb->conflict_func,
@@ -2802,6 +2803,7 @@ close_directory(void *dir_baton,
 
   if (conflict_skel && eb->conflict_func)
     SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, db->local_abspath,
+                                             svn_node_dir,
                                              conflict_skel,
                                              NULL /* merge_options */,
                                              eb->conflict_func,
@@ -2987,6 +2989,7 @@ absent_node(const char *path,
       {
         if (eb->conflict_func)
           SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, local_abspath,
+                                                   kind,
                                                    tree_conflict,
                                                    NULL /* merge_options */,
                                                    eb->conflict_func,
@@ -4511,6 +4514,7 @@ close_file(void *file_baton,
 
   if (conflict_skel && eb->conflict_func)
     SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, fb->local_abspath,
+                                             svn_node_file,
                                              conflict_skel,
                                              NULL /* merge_options */,
                                              eb->conflict_func,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/wc.h?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/wc.h Sat Apr 18 04:00:40 2015
@@ -635,9 +635,11 @@ svn_wc__write_check(svn_wc__db_t *db,
  */
 svn_error_t *
 svn_wc__read_conflicts(const apr_array_header_t **conflicts,
+                       svn_skel_t **conflict_skel,
                        svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t create_tempfiles,
+                       svn_boolean_t only_tree_conflict,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool);
 

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.c Sat Apr 18 04:00:40 2015
@@ -6846,7 +6846,7 @@ op_revert_txn(void *baton,
     }
   else
     {
-      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, wcroot,
+      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, NULL, wcroot,
                                                 local_relpath,
                                                 scratch_pool, scratch_pool));
     }
@@ -13900,6 +13900,7 @@ svn_wc__db_get_conflict_marker_files(apr
 svn_error_t *
 svn_wc__db_read_conflict(svn_skel_t **conflict,
                          svn_node_kind_t *kind,
+                         apr_hash_t **props,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          apr_pool_t *result_pool,
@@ -13913,7 +13914,7 @@ svn_wc__db_read_conflict(svn_skel_t **co
                               local_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  return svn_error_trace(svn_wc__db_read_conflict_internal(conflict, kind,
+  return svn_error_trace(svn_wc__db_read_conflict_internal(conflict, kind, props,
                                                            wcroot, local_relpath,
                                                            result_pool,
                                                            scratch_pool));
@@ -13922,6 +13923,7 @@ svn_wc__db_read_conflict(svn_skel_t **co
 svn_error_t *
 svn_wc__db_read_conflict_internal(svn_skel_t **conflict,
                                   svn_node_kind_t *kind,
+                                  apr_hash_t **props,
                                   svn_wc__db_wcroot_t *wcroot,
                                   const char *local_relpath,
                                   apr_pool_t *result_pool,
@@ -13932,6 +13934,8 @@ svn_wc__db_read_conflict_internal(svn_sk
 
   if (kind)
     *kind = svn_node_none;
+  if (props)
+    *props = NULL;
 
   /* Check if we have a conflict in ACTUAL */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -13940,59 +13944,82 @@ svn_wc__db_read_conflict_internal(svn_sk
 
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
-  if (!have_row || kind)
+  if (have_row)
     {
-      /* Do this while stmt is still open to avoid closing the sqlite
-         transaction and then reopening. */
-      svn_sqlite__stmt_t *stmt_node;
-      svn_error_t *err;
-      svn_boolean_t have_info = FALSE;
+      apr_size_t cfl_len;
+      const void *cfl_data;
 
-      err = svn_sqlite__get_statement(&stmt_node, wcroot->sdb,
-                                      STMT_SELECT_NODE_INFO);
+      /* svn_skel__parse doesn't copy data, so store in result_pool */
+      cfl_data = svn_sqlite__column_blob(stmt, 2, &cfl_len, result_pool);
 
-      if (err)
-        stmt_node = NULL;
+      if (cfl_data)
+        *conflict = svn_skel__parse(cfl_data, cfl_len, result_pool);
       else
-        err = svn_sqlite__bindf(stmt_node, "is", wcroot->wc_id,
-                                local_relpath);
+        *conflict = NULL;
 
-      if (!err)
-        err = svn_sqlite__step(&have_info, stmt_node);
-
-      if (!err && kind && have_info)
+      if (props)
         {
-          svn_wc__db_status_t status;
-          int op_depth = svn_sqlite__column_int(stmt_node, 0);
-
-          status = svn_sqlite__column_token(stmt_node, 3, presence_map);
+          svn_error_t *err;
 
-          if (op_depth > 0)
-            err = convert_to_working_status(&status, status);
+          err = svn_error_trace(svn_sqlite__column_properties(props, stmt, 1,
+                                                              result_pool,
+                                                              scratch_pool));
 
-          if (!err && (status == svn_wc__db_status_normal
-                       || status == svn_wc__db_status_added
-                       || status == svn_wc__db_status_deleted
-                       || status == svn_wc__db_status_incomplete))
-            {
-              *kind = svn_sqlite__column_token(stmt_node, 4, kind_map);
-            }
+          if (err)
+            return svn_error_compose_create(err, svn_sqlite__reset(stmt));
         }
+    }
+  else
+    *conflict = NULL;
+
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  if (!have_row || kind || (props && !*props))
+    {
+      svn_error_t *err = NULL;
+      svn_boolean_t have_info = FALSE;
+
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_SELECT_NODE_INFO));
 
-      if (stmt_node)
-        err = svn_error_compose_create(err,
-                                       svn_sqlite__reset(stmt_node));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                local_relpath));
+
+      SVN_ERR(svn_sqlite__step(&have_info, stmt));
 
-      if (!have_row || err)
+      if (have_info)
         {
-          SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
+          if (kind)
+            {
+              svn_wc__db_status_t status;
+              int op_depth = svn_sqlite__column_int(stmt, 0);
+
+              status = svn_sqlite__column_token(stmt, 3, presence_map);
+
+              if (op_depth > 0)
+                err = convert_to_working_status(&status, status);
 
-          if (have_info)
+              if (!err && (status == svn_wc__db_status_normal
+                           || status == svn_wc__db_status_added
+                           || status == svn_wc__db_status_deleted
+                           || status == svn_wc__db_status_incomplete))
+                {
+                  *kind = svn_sqlite__column_token(stmt, 4, kind_map);
+                }
+            }
+
+          /* Need props, and no props in ACTUAL? */
+          if (!err && (props && !*props))
             {
-              *conflict = NULL;
-              return SVN_NO_ERROR;
+              err = svn_sqlite__column_properties(props, stmt, 14,
+                                                  result_pool, scratch_pool);
             }
+        }
 
+      SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
+
+      if (!have_row && !have_info)
+        {
           return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                                    _("The node '%s' was not found."),
                                    path_for_error_message(wcroot,
@@ -14001,20 +14028,7 @@ svn_wc__db_read_conflict_internal(svn_sk
         }
     }
 
-  {
-    apr_size_t cfl_len;
-    const void *cfl_data;
-
-    /* svn_skel__parse doesn't copy data, so store in result_pool */
-    cfl_data = svn_sqlite__column_blob(stmt, 2, &cfl_len, result_pool);
-
-    if (cfl_data)
-      *conflict = svn_skel__parse(cfl_data, cfl_len, result_pool);
-    else
-      *conflict = NULL;
-
-    return svn_error_trace(svn_sqlite__reset(stmt));
-  }
+  return SVN_NO_ERROR;
 }
 
 

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.h?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/wc_db.h Sat Apr 18 04:00:40 2015
@@ -2364,7 +2364,9 @@ svn_wc__db_get_conflict_marker_files(apr
 
 /* Read the conflict information recorded on LOCAL_ABSPATH in *CONFLICT,
    an editable conflict skel. If kind is not NULL, also read the node kind
-   in *KIND. (SHOW_HIDDEN: false, SHOW_DELETED: true)
+   in *KIND. (SHOW_HIDDEN: false, SHOW_DELETED: true). If props is not NULL
+   read the actual properties in this value if they exist. (Set to NULL in case
+   the node is deleted, etc.)
 
    If the node exists, but does not have a conflict set *CONFLICT to NULL,
    otherwise return a SVN_ERR_WC_PATH_NOT_FOUND error.
@@ -2374,6 +2376,7 @@ svn_wc__db_get_conflict_marker_files(apr
 svn_error_t *
 svn_wc__db_read_conflict(svn_skel_t **conflict,
                          svn_node_kind_t *kind,
+                         apr_hash_t **props,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          apr_pool_t *result_pool,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_private.h?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_private.h Sat Apr 18 04:00:40 2015
@@ -355,6 +355,7 @@ svn_wc__db_fetch_repos_info(const char *
 svn_error_t *
 svn_wc__db_read_conflict_internal(svn_skel_t **conflict,
                                   svn_node_kind_t *kind,
+                                  apr_hash_t **props,
                                   svn_wc__db_wcroot_t *wcroot,
                                   const char *local_relpath,
                                   apr_pool_t *result_pool,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_update_move.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/wc_db_update_move.c Sat Apr 18 04:00:40 2015
@@ -377,7 +377,7 @@ create_tree_conflict(svn_skel_t **confli
                                            child_relpath, scratch_pool);
     }
 
-  err = svn_wc__db_read_conflict_internal(&conflict, NULL,
+  err = svn_wc__db_read_conflict_internal(&conflict, NULL, NULL,
                                           wcroot, local_relpath,
                                           result_pool, scratch_pool);
   if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -2095,8 +2095,8 @@ bump_moved_layer(svn_boolean_t *recurse,
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, wcroot,
-                                            src_root_relpath,
+  SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, NULL,
+                                            wcroot, src_root_relpath,
                                             scratch_pool, scratch_pool));
 
   /* ### TODO: check this is the right sort of tree-conflict? */
@@ -2450,7 +2450,7 @@ svn_wc__db_op_raise_moved_away(svn_wc__d
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_WC__DB_WITH_TXN4(
-    svn_wc__db_read_conflict_internal(&conflict, NULL,
+    svn_wc__db_read_conflict_internal(&conflict, NULL, NULL,
                                       wcroot, local_relpath,
                                       scratch_pool, scratch_pool),
     fetch_conflict_details(&move_src_op_depth,

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/workqueue.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/workqueue.c Sat Apr 18 04:00:40 2015
@@ -1106,7 +1106,7 @@ run_prej_install(work_item_baton_t *wqb,
   SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
                                   local_relpath, scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL, db, local_abspath,
                                    scratch_pool, scratch_pool));
 
   SVN_ERR(svn_wc__conflict_read_prop_conflict(&prejfile_abspath,
@@ -1286,7 +1286,7 @@ run_set_text_conflict_markers(work_item_
     /* Check if we should combine with a property conflict... */
     svn_skel_t *conflicts;
 
-    SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+    SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL, db, local_abspath,
                                      scratch_pool, scratch_pool));
 
     if (! conflicts)
@@ -1352,7 +1352,8 @@ run_set_property_conflict_marker(work_it
     svn_skel_t *conflicts;
     apr_hash_t *prop_names;
 
-    SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+    SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL,
+                                     db, local_abspath,
                                      scratch_pool, scratch_pool));
 
     if (! conflicts)

Modified: subversion/branches/1.9.x/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/svn/conflict-callbacks.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/1.9.x/subversion/svn/conflict-callbacks.c Sat Apr 18 04:00:40 2015
@@ -422,7 +422,7 @@ static const resolver_option_t text_conf
                                   svn_wc_conflict_choose_undefined },
   { "df", N_("show diff"),        N_("show all changes made to merged file"),
                                   svn_wc_conflict_choose_undefined },
-  { "r",  N_("mark resolved"),   N_("accept merged version of file"),
+  { "r",  N_("mark resolved"),   N_("accept merged version of file  [working]"),
                                   svn_wc_conflict_choose_merged },
   { "",   "",                     "", svn_wc_conflict_choose_unspecified },
   { "dc", N_("display conflict"), N_("show all conflicts "
@@ -461,6 +461,28 @@ static const resolver_option_t text_conf
   { NULL }
 };
 
+/* Resolver options for a binary file conflict. */
+static const resolver_option_t binary_conflict_options[] =
+{
+  /* Translators: keep long_desc below 70 characters (wrap with a left
+     margin of 9 spaces if needed); don't translate the words within square
+     brackets. */
+  { "r",  N_("mark resolved"),   N_("accept the working copy version of file "
+                                    " [working]"),
+                                  svn_wc_conflict_choose_merged },
+  { "tf", N_("their version"),    N_("accept the incoming version of file "
+                                     " [theirs-full]"),
+                                  svn_wc_conflict_choose_theirs_full },
+  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later "
+                                     " [postpone]"),
+                                  svn_wc_conflict_choose_postpone },
+  { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
+                                  svn_wc_conflict_choose_postpone },
+  { "s",  N_("show all options"), N_("show this list (also 'h', '?')"),
+                                  svn_wc_conflict_choose_undefined },
+  { NULL }
+};
+
 /* Resolver options for a property conflict */
 static const resolver_option_t prop_conflict_options[] =
 {
@@ -686,14 +708,22 @@ handle_text_conflict(svn_wc_conflict_res
   /* Have they done *something* (edit, look at diff, etc) to
      give them a rational basis for choosing (r)esolved? */
   svn_boolean_t knows_something = FALSE;
-
+  const char *local_relpath;
+  
   SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_text);
 
-  SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
-                              _("Conflict discovered in file '%s'.\n"),
-                              svn_cl__local_style_skip_ancestor(
-                                b->path_prefix, desc->local_abspath,
-                                scratch_pool)));
+  local_relpath = svn_cl__local_style_skip_ancestor(b->path_prefix,
+                                                    desc->local_abspath,
+                                                    scratch_pool);;
+
+  if (desc->is_binary)
+    SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                _("Conflict discovered in binary file '%s'.\n"),
+                                local_relpath));
+  else
+    SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                _("Conflict discovered in file '%s'.\n"),
+                                local_relpath));
 
   /* ### TODO This whole feature availability check is grossly outdated.
      DIFF_ALLOWED needs either to be redefined or to go away.
@@ -703,13 +733,17 @@ handle_text_conflict(svn_wc_conflict_res
      markers to the user (this is the typical 3-way merge
      scenario), or if no base is available, we can show a diff
      between mine and theirs. */
-  if ((desc->merged_file && desc->base_abspath)
-      || (!desc->base_abspath && desc->my_abspath && desc->their_abspath))
+  if (!desc->is_binary &&
+      ((desc->merged_file && desc->base_abspath)
+      || (!desc->base_abspath && desc->my_abspath && desc->their_abspath)))
     diff_allowed = TRUE;
 
   while (TRUE)
     {
-      const char *options[ARRAY_LEN(text_conflict_options)];
+      const resolver_option_t *conflict_options = desc->is_binary
+                                                    ? binary_conflict_options
+                                                    : text_conflict_options;
+      const char *options[ARRAY_LEN(conflict_options)];
       const char **next_option = options;
       const resolver_option_t *opt;
 
@@ -731,24 +765,26 @@ handle_text_conflict(svn_wc_conflict_res
           if (knows_something)
             *next_option++ = "r";
 
-          if (! desc->is_binary)
-            {
-              *next_option++ = "mc";
-              *next_option++ = "tc";
-            }
+          *next_option++ = "mc";
+          *next_option++ = "tc";
         }
       else
         {
           if (knows_something)
             *next_option++ = "r";
-          *next_option++ = "mf";
+
+          /* The 'mine-full' option selects the ".mine" file so only offer
+           * it if that file exists. It does not exist for binary files,
+           * for example (questionable historical behaviour since 1.0). */
+          if (desc->my_abspath)
+            *next_option++ = "mf";
+
           *next_option++ = "tf";
         }
       *next_option++ = "s";
       *next_option++ = NULL;
 
-      SVN_ERR(prompt_user(&opt, text_conflict_options, options, b->pb,
-                          iterpool));
+      SVN_ERR(prompt_user(&opt, conflict_options, options, b->pb, iterpool));
       if (! opt)
         continue;
 
@@ -762,7 +798,7 @@ handle_text_conflict(svn_wc_conflict_res
       else if (strcmp(opt->code, "s") == 0)
         {
           SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
-                                      help_string(text_conflict_options,
+                                      help_string(conflict_options,
                                                   iterpool)));
         }
       else if (strcmp(opt->code, "dc") == 0)

Modified: subversion/branches/1.9.x/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/branches/1.9.x/subversion/tests/libsvn_wc/conflict-data-test.c Sat Apr 18 04:00:40 2015
@@ -853,7 +853,7 @@ test_prop_conflict_resolving(const svn_t
   SVN_ERR(sbox_wc_update(&b, "", 1));
 
   A_abspath = sbox_wc_path(&b, "A");
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL,
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
                                    b.wc_ctx->db, A_abspath,
                                    pool, pool));
 
@@ -880,7 +880,7 @@ test_prop_conflict_resolving(const svn_t
   SVN_ERR(sbox_wc_resolve_prop(&b, "A", "prop-3",
                                svn_wc_conflict_choose_merged));
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL,
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
                                    b.wc_ctx->db, A_abspath,
                                    pool, pool));
 
@@ -910,6 +910,45 @@ test_prop_conflict_resolving(const svn_t
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_binary_file_conflict(const svn_test_opts_t *opts,
+                          apr_pool_t *pool)
+{
+  svn_test__sandbox_t sbox;
+  const apr_array_header_t *conflicts;
+  svn_wc_conflict_description2_t *desc;
+
+  SVN_ERR(svn_test__sandbox_create(&sbox, "test_binary_file_conflict", opts, pool));
+
+  /* Create and add a binary file. */
+  SVN_ERR(sbox_file_write(&sbox, "binary-file", "\xff\xff"));
+  SVN_ERR(sbox_wc_add(&sbox, "binary-file"));
+  SVN_ERR(sbox_wc_propset(&sbox, SVN_PROP_MIME_TYPE,
+                          "application/octet-stream", "binary-file"));
+  SVN_ERR(sbox_wc_commit(&sbox, "binary-file")); /* r1 */
+
+  /* Make a change to the binary file. */
+  SVN_ERR(sbox_file_write(&sbox, "binary-file", "\xfc\xfc\xfc\xfc\xfc\xfc"));
+  SVN_ERR(sbox_wc_commit(&sbox, "binary-file")); /* r2 */
+
+  /* Update back to r1, make a conflicting change to binary file. */
+  SVN_ERR(sbox_wc_update(&sbox, "binary-file", 1));
+  SVN_ERR(sbox_file_write(&sbox, "binary-file", "\xfd\xfd\xfd\xfd"));
+
+  /* Update to HEAD and ensure the conflict is marked as binary. */
+  SVN_ERR(sbox_wc_update(&sbox, "binary-file", 2));
+  SVN_ERR(svn_wc__read_conflicts(&conflicts, NULL, sbox.wc_ctx->db,
+                                 sbox_wc_path(&sbox, "binary-file"),
+                                 FALSE /* create_tempfiles */,
+                                 FALSE /* only_tree_conflict */,
+                                 pool, pool));
+  SVN_TEST_ASSERT(conflicts->nelts == 1);
+  desc = APR_ARRAY_IDX(conflicts, 0, svn_wc_conflict_description2_t *);
+  SVN_TEST_ASSERT(desc->is_binary);
+
+  return SVN_NO_ERROR;
+}
+
 
 /* The test table.  */
 
@@ -934,6 +973,8 @@ static struct svn_test_descriptor_t test
                        "test prop conflicts"),
     SVN_TEST_OPTS_PASS(test_prop_conflict_resolving,
                        "test property conflict resolving"),
+    SVN_TEST_OPTS_PASS(test_binary_file_conflict,
+                       "test binary file conflict"),
     SVN_TEST_NULL
   };
 

Modified: subversion/branches/1.9.x/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/tests/libsvn_wc/op-depth-test.c?rev=1674436&r1=1674435&r2=1674436&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/1.9.x/subversion/tests/libsvn_wc/op-depth-test.c Sat Apr 18 04:00:40 2015
@@ -514,7 +514,7 @@ check_db_conflicts(svn_test__sandbox_t *
       local_abspath = svn_dirent_join(b->wc_abspath, info->local_relpath,
                                       iterpool);
 
-      SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL,
+      SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
                                        b->wc_ctx->db, local_abspath,
                                        iterpool, iterpool));
 
@@ -5974,8 +5974,8 @@ check_tree_conflict_repos_path(svn_test_
   const apr_array_header_t *locations;
   svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, b->wc_ctx->db,
-                                   sbox_wc_path(b, wc_path),
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                   b->wc_ctx->db, sbox_wc_path(b, wc_path),
                                    b->pool, b->pool));
 
   SVN_TEST_ASSERT(conflict != NULL);



Mime
View raw message