You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/03/17 13:31:43 UTC

svn commit: r1667290 - in /subversion/trunk/subversion: libsvn_wc/ tests/libsvn_wc/

Author: rhuijben
Date: Tue Mar 17 12:31:42 2015
New Revision: 1667290

URL: http://svn.apache.org/r1667290
Log:
When obtaining conflicts from wc-db, also allow directly obtaining properties.
We already read from the records that have the data, so this doesn't have a
real cost, while reading them separatly (introduced in r1667228).

The final result after the combination of these patches is that we provide
better information using less database transactions, so this provides an
overall performance improvement.

This patch also makes the resolver avoid creating temporary files during
resolves where the code already knows that nobody is using these files,
because there is no resolver callback.

* subversion/libsvn_wc/conflicts.c
  (read_prop_conflict_descs): Stop abusing no tempfile flag for not showing
    details. Only read base properties if we don't already have them.
  (svn_wc__read_conflicts): Allow obtaining skel in one step, and not reading
    not-tree conflicts.
  (resolve_tree_conflict_on_node,
   svn_wc__mark_resolved_text_conflict,
   svn_wc__mark_resolved_prop_conflicts): Update caller.
  (conflict_status_walker): Use one db operation instead of two.

* subversion/libsvn_wc/copy.c
  (copy_versioned_file,
   remove_node_conflict_markers): Update caller.

* subversion/libsvn_wc/delete.c
  (create_delete_wq_items): Update caller.

* subversion/libsvn_wc/entries.c
  (read_one_entry): Update caller.

* subversion/libsvn_wc/info.c
  (build_info_for_node): Update caller.
  (svn_wc__get_info): Update caller.

* subversion/libsvn_wc/props.c
  (svn_wc__create_prejfile): Update caller.

* subversion/libsvn_wc/questions.c
  (internal_conflicted_p): Update caller.

* subversion/libsvn_wc/tree_conflicts.c
  (svn_wc__get_tree_conflict): Update caller.

* subversion/libsvn_wc/wc.h
  (svn_wc__read_conflicts): Add two arguments.

* subversion/libsvn_wc/wc_db.c
  (op_revert_txn): Update caller.
  (svn_wc__db_read_conflict,
   svn_wc__db_read_conflict_internal): Handle properties.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_read_conflict): Add optional properties argument.

* subversion/libsvn_wc/wc_db_private.h
  (svn_wc__db_read_conflict_internal): Add optional properties argument.

* subversion/libsvn_wc/wc_db_update_move.c
  (create_tree_conflict,
   bump_moved_layer,
   svn_wc__db_op_raise_moved_away): Update caller.

* subversion/libsvn_wc/workqueue.c
  (run_prej_install,
   run_set_text_conflict_markers,
   run_set_property_conflict_marker): Update caller.

* subversion/tests/libsvn_wc/conflict-data-test.c
  (test_prop_conflict_resolving,
   test_binary_file_conflict): Update caller.

* subversion/tests/libsvn_wc/op-depth-test.c
  (check_db_conflicts): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    subversion/trunk/subversion/libsvn_wc/copy.c
    subversion/trunk/subversion/libsvn_wc/delete.c
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/libsvn_wc/info.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/questions.c
    subversion/trunk/subversion/libsvn_wc/tree_conflicts.c
    subversion/trunk/subversion/libsvn_wc/wc.h
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/libsvn_wc/wc_db_private.h
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
    subversion/trunk/subversion/libsvn_wc/workqueue.c
    subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Tue Mar 17 12:31:42 2015
@@ -2054,7 +2054,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;
@@ -2062,8 +2062,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,
@@ -2072,7 +2080,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;
@@ -2083,7 +2093,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;
@@ -2095,8 +2105,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;
@@ -2143,22 +2156,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);
         }
@@ -2170,12 +2187,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);
         }
@@ -2185,12 +2205,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);
         }
@@ -2204,13 +2227,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;
@@ -2220,12 +2245,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;
+
+  if (!conflict_skel)
+    conflict_skel = &the_conflict_skel;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict_skel, &node_kind,
+  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,
@@ -2235,7 +2267,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,
@@ -2246,24 +2278,21 @@ 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;
-      apr_hash_t *props;
 
-      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,
+                                      db, local_abspath, *conflict_skel,
                                       svn_prop_get_value(props,
                                                          SVN_PROP_MIME_TYPE),
                                       operation, left_version, right_version,
@@ -2277,7 +2306,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));
 
@@ -2648,7 +2677,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));
 
@@ -2820,7 +2849,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)
@@ -2849,7 +2879,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)
@@ -2934,10 +2965,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/trunk/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/delete.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/delete.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/delete.c (original)
+++ subversion/trunk/subversion/libsvn_wc/delete.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Tue Mar 17 12:31:42 2015
@@ -751,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/trunk/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c (original)
+++ subversion/trunk/subversion/libsvn_wc/questions.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/tree_conflicts.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/tree_conflicts.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Mar 17 12:31:42 2015
@@ -6889,7 +6889,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));
     }
@@ -13942,6 +13942,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,
@@ -13955,7 +13956,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));
@@ -13964,6 +13965,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,
@@ -13974,6 +13976,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,
@@ -13982,59 +13986,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,
@@ -14043,20 +14070,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/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_private.h?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_private.h Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Tue Mar 17 12:31:42 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/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue Mar 17 12:31:42 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/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c Tue Mar 17 12:31:42 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));
 
@@ -937,9 +937,10 @@ test_binary_file_conflict(const svn_test
 
   /* 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, sbox.wc_ctx->db,
+  SVN_ERR(svn_wc__read_conflicts(&conflicts, NULL, sbox.wc_ctx->db,
                                  sbox_wc_path(&sbox, "binary-file"),
-                                 FALSE, /* create_tempfiles */
+                                 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 *);

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1667290&r1=1667289&r2=1667290&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Tue Mar 17 12:31:42 2015
@@ -515,7 +515,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));
 
@@ -5981,8 +5981,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);