subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1693629 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/resolved.c
Date Fri, 31 Jul 2015 16:51:27 GMT
Author: stsp
Date: Fri Jul 31 16:51:27 2015
New Revision: 1693629

URL: http://svn.apache.org/r1693629
Log:
Make svn_client_conflict_option_merged_text usable with property conflicts.

* subversion/include/svn_client.h
  (svn_client_conflict_option_id_t): Remove outdated comment.
  (svn_client_conflict_option_set_merged_propval): Declare.

* subversion/libsvn_client/resolved.c
  (svn_client_conflict_option_t): Add new type-specific data for merged
   property value.
  (conflict_resolver_func): Make use of the merged property value if the
   option ID matches svn_client_conflict_option_merged_text. Whitespace fix.
  (svn_client_conflict_option_set_merged_propval): Implement.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/resolved.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1693629&r1=1693628&r2=1693629&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Fri Jul 31 16:51:27 2015
@@ -4390,13 +4390,30 @@ typedef enum svn_client_conflict_option_
   svn_client_conflict_option_working_text,
   svn_client_conflict_option_incoming_new_text_for_conflicted_hunks_only,
   svn_client_conflict_option_working_text_for_conflicted_hunks_only,
-  svn_client_conflict_option_merged_text, /* unsupported */
+  svn_client_conflict_option_merged_text,
   svn_client_conflict_option_unspecified
   /* Values derived from svn_wc_conflict_choice_t end here. */
 
 } svn_client_conflict_option_id_t;
 
 /**
+ * Set a merged property value on @a option to @a merged_propval.
+ * 
+ * Setting the merged value is required before resolving the property
+ * conflict using an option with ID svn_client_conflict_option_merged_text.
+ *
+ * The contents of @a merged_propval are not copied, so the storage it
+ * points to needs to remain valid until svn_client_conflict_prop_resolve()
+ * has been called with @a option.
+ *
+ * @since New in 1.10.
+ */
+void
+svn_client_conflict_option_set_merged_propval(
+  svn_client_conflict_option_t *option,
+  const svn_string_t *merged_propval);
+
+/**
  * Return a conflict for the conflicted path @a local_abspath.
  * 
  * @since New in 1.10.

Modified: subversion/trunk/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolved.c?rev=1693629&r1=1693628&r2=1693629&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/resolved.c (original)
+++ subversion/trunk/subversion/libsvn_client/resolved.c Fri Jul 31 16:51:27 2015
@@ -194,6 +194,9 @@ struct svn_client_conflict_option_t
       /* Indicates the property to resolve in case of a property conflict.
        * If set to "", all properties are resolved to this option. */
       const char *propname;
+
+      /* A merged property value, if supplied by the API user, else NULL. */
+      const svn_string_t *merged_propval;
     } prop;
   } type_data;
 
@@ -398,6 +401,13 @@ conflict_resolver_func(svn_wc_conflict_r
                                                         scratch_pool));
 
       resolution = svn_client_conflict_option_get_id(option);
+      conflict_choice = conflict_option_id_to_wc_conflict_choice(resolution);
+      *result = svn_wc_create_conflict_result(conflict_choice, NULL,
+                                              result_pool);
+      if (resolution == svn_client_conflict_option_merged_text)
+        (*result)->merged_value = option->type_data.prop.merged_propval;
+        
+      return SVN_NO_ERROR;
     }
   else
     return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
@@ -409,7 +419,7 @@ conflict_resolver_func(svn_wc_conflict_r
                              _("No resolution for conflicted path '%s'"),
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
-    
+
   conflict_choice = conflict_option_id_to_wc_conflict_choice(resolution);
   *result = svn_wc_create_conflict_result(conflict_choice, NULL, result_pool);
 
@@ -458,6 +468,14 @@ svn_client_conflict_walk(const char *loc
   return SVN_NO_ERROR;
 }
 
+void
+svn_client_conflict_option_set_merged_propval(
+  svn_client_conflict_option_t *option,
+  const svn_string_t *merged_propval)
+{
+  option->type_data.prop.merged_propval = merged_propval;
+}
+
 /* 
  * Resolve the conflict at LOCAL_ABSPATH. Currently only supports
  * an OPTION_ID which can be mapped to svn_wc_conflict_choice_t and



Mime
View raw message