subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1619122 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/conflicts.c libsvn_wc/util.c
Date Wed, 20 Aug 2014 14:58:08 GMT
Author: stsp
Date: Wed Aug 20 14:58:08 2014
New Revision: 1619122

URL: http://svn.apache.org/r1619122
Log:
Add svn_string_t property values to svn_wc_conflict_description2_t.

For historical reasons these values are available in temporary files.
However, svn_string_t is the canonical representations for property values
and can be easier to work with when implementing conflict resolvers.

* subversion/include/svn_wc.h
  (svn_wc_conflict_description2_t): Add prop_value_base, prop_value_working,
   prop_value_incoming_old, prop_value_incoming_new.

* subversion/libsvn_wc/conflicts.c
  (generate_propconflict, read_prop_conflict_descs): Set property values.

* subversion/libsvn_wc/util.c
  (svn_wc_conflict_description2_dup): Copy property values if set.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    subversion/trunk/subversion/libsvn_wc/util.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1619122&r1=1619121&r2=1619122&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed Aug 20 14:58:08 2014
@@ -1861,7 +1861,35 @@ typedef struct svn_wc_conflict_descripti
    * @since New in 1.9. */
   const char *prop_reject_abspath;
 
-  /* NOTE: Add new fields at the end to preserve binary compatibility.
+  /* For property conflicts, the local base value of the property, i.e. the
+   * value of the property as of the BASE revision of the working copy.
+   * For conflicts created during update/switch this contains the
+   * post-update/switch property value. The pre-update/switch value can
+   * be found in prop_value_incoming_old.
+   * Only set if available, so might be @c NULL.
+   * @since New in 1.9. */
+  const svn_string_t *prop_value_base;
+
+  /* For property conflicts, the local working value of the property,
+   * i.e. the value of the property in the working copy, possibly with
+   * local modiciations.
+   * Only set if available, so might be @c NULL.
+   * @since New in 1.9. */
+  const svn_string_t *prop_value_working;
+
+  /* For property conflicts, the incoming old value of the property,
+   * i.e. the value the property had at @c src_left_version.
+   * Only set if available, so might be @c NULL.
+   * @since New in 1.9 */
+  const svn_string_t *prop_value_incoming_old;
+
+  /* For property conflicts, the incoming new value of the property,
+   * i.e. the value the property had at @c src_right_version.
+   * Only set if available, so might be @c NULL.
+   * @since New in 1.9 */
+  const svn_string_t *prop_value_incoming_new;
+
+/* NOTE: Add new fields at the end to preserve binary compatibility.
      Also, if you add fields here, you have to update
      svn_wc_conflict_description2_dup and perhaps
      svn_wc_conflict_description_create_text2,

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1619122&r1=1619121&r2=1619122&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Wed Aug 20 14:58:08 2014
@@ -1193,6 +1193,7 @@ generate_propconflict(svn_boolean_t *con
                                   svn_io_file_del_on_pool_cleanup,
                                   scratch_pool));
       cdesc->my_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
+      cdesc->prop_value_working = working_val;
     }
 
   if (incoming_new_val)
@@ -1207,6 +1208,7 @@ generate_propconflict(svn_boolean_t *con
       /* ### For property conflicts, cd2 stores prop_reject_abspath in
        * ### their_abspath, and stores theirs_abspath in merged_file. */
       cdesc->merged_file = svn_dirent_join(dirpath, file_name, scratch_pool);
+      cdesc->prop_value_incoming_new = incoming_new_val;
     }
 
   if (!base_val && !incoming_old_val)
@@ -1272,6 +1274,9 @@ generate_propconflict(svn_boolean_t *con
                                   svn_io_file_del_on_pool_cleanup, scratch_pool));
       cdesc->base_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
 
+      cdesc->prop_value_base = base_val;
+      cdesc->prop_value_incoming_old = incoming_old_val;
+
       if (working_val && incoming_new_val)
         {
           svn_stream_t *mergestream;
@@ -2021,6 +2026,7 @@ read_prop_conflict_descs(apr_array_heade
                          apr_pool_t *scratch_pool)
 {
   const char *prop_reject_file;
+  apr_hash_t *base_props;
   apr_hash_t *my_props;
   apr_hash_t *their_old_props;
   apr_hash_t *their_props;
@@ -2060,6 +2066,8 @@ read_prop_conflict_descs(apr_array_heade
       return SVN_NO_ERROR;
     }
 
+  SVN_ERR(svn_wc__db_base_get_props(&base_props, db, local_abspath,
+                                    result_pool, scratch_pool));
   iterpool = svn_pool_create(scratch_pool);
   for (hi = apr_hash_first(scratch_pool, conflicted_props);
        hi;
@@ -2109,10 +2117,8 @@ read_prop_conflict_descs(apr_array_heade
       desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
       desc->their_abspath = desc->prop_reject_abspath;
 
-      /* ### This should be changed. The conflict description for
-       * ### props should contain these values as svn_string_t,
-       * ### rather than in temporary files. We need to rev the
-       * ### conflict description struct for this. */
+      desc->prop_value_base = svn_hash_gets(base_props, propname);
+
       if (my_value)
         {
           svn_stream_t *s;
@@ -2124,6 +2130,8 @@ read_prop_conflict_descs(apr_array_heade
           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);
         }
 
       if (their_value)
@@ -2139,6 +2147,8 @@ read_prop_conflict_descs(apr_array_heade
           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);
         }
 
       if (old_value)
@@ -2152,6 +2162,8 @@ read_prop_conflict_descs(apr_array_heade
           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);
         }
 
       APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t *) = desc;

Modified: subversion/trunk/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/util.c?rev=1619122&r1=1619121&r2=1619122&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/util.c (original)
+++ subversion/trunk/subversion/libsvn_wc/util.c Wed Aug 20 14:58:08 2014
@@ -311,6 +311,19 @@ svn_wc_conflict_description2_dup(const s
   if (conflict->prop_reject_abspath)
     new_conflict->prop_reject_abspath = new_conflict->their_abspath;
 
+  if (conflict->prop_value_base)
+    new_conflict->prop_value_base =
+      svn_string_dup(conflict->prop_value_base, pool);
+  if (conflict->prop_value_working)
+    new_conflict->prop_value_working =
+      svn_string_dup(conflict->prop_value_working, pool);
+  if (conflict->prop_value_incoming_old)
+    new_conflict->prop_value_incoming_old =
+      svn_string_dup(conflict->prop_value_incoming_old, pool);
+  if (conflict->prop_value_incoming_new)
+    new_conflict->prop_value_incoming_new =
+      svn_string_dup(conflict->prop_value_incoming_new, pool);
+
   return new_conflict;
 }
 



Mime
View raw message