[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1687489 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/resolved.c svn/cl-conflicts.c svn/cl-conflicts.h svn/conflict-callbacks.c svn/info-cmd.c svn/status.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Thu, 25 Jun 2015 12:59:16 +0000

I think it would help future conflict resolve code if we call the conflict resolver only once per conflicted path. This would allow providing all conflict details (<text, prop> | <tree>) to a user, which can then really apply resolve operations like all-theirs (knowing what the consequences are).


I’m not sure if the 'svn_client_conflict_t’ really prepares for that situation, as it appears that it still assumes all conflict details may be different for multiple conflicts on a single path.




I would think that you need two opaque types: one for the conflicted path (defining operation, reason, urls, etc.) and one for the individual conflicts that apply to the path (text, properties, tc specific details)



A default implementation would then be able to callback to the current once per conflict callbacks, while new implementations can use all information at once.


      Bert





Sent from Surface





From: Stefan Sperling
Sent: ‎Thursday‎, ‎June‎ ‎25‎, ‎2015 ‎2‎:‎19‎ ‎PM
To: commits_at_subversion.apache.org





Author: stsp
Date: Thu Jun 25 12:19:09 2015
New Revision: 1687489

URL: http://svn.apache.org/r1687489
Log:
Introduce svn_client_conflict_t and start making use of it in the resolver.

Right now, this new opaque type simply wraps the old struct. This is required
to keep the current resolver implementation working for now.

The plan is to develop new resolver functionality using the new type and
eventually phase out the old struct entirely.

* subversion/include/svn_client.h
  (svn_client_conflict_t, svn_client_conflict_get,
   svn_client_conflict_from_wc_description2_t): Declare.
  (svn_client_conflict_get_kind,
   svn_client_conflict_get_local_abspath,
   svn_client_conflict_get_operation,
   svn_client_conflict_get_incoming_change,
   svn_client_conflict_get_local_change,
   svn_client_conflict_get_repos_info,
   svn_client_conflict_get_incoming_old_repos_location,
   svn_client_conflict_get_incoming_new_repos_location,
   svn_client_conflict_tree_get_victim_node_kind,
   svn_client_conflict_prop_get_propname,
   svn_client_conflict_text_get_mime_type,
   svn_client_conflict_text_get_contents): Expect svn_client_conflict_t.

* subversion/libsvn_client/resolved.c
  (svn_client_conflict_t, svn_client_conflict_get,
   svn_client_conflict_from_wc_description2_t): Implement.
  (svn_client_conflict_get_kind,
   svn_client_conflict_get_local_abspath,
   svn_client_conflict_get_operation,
   svn_client_conflict_get_incoming_change,
   svn_client_conflict_get_local_change,
   svn_client_conflict_get_repos_info,
   svn_client_conflict_get_incoming_old_repos_location,
   svn_client_conflict_get_incoming_new_repos_location,
   svn_client_conflict_tree_get_victim_node_kind,
   svn_client_conflict_prop_get_propname,
   svn_client_conflict_text_get_mime_type,
   svn_client_conflict_text_get_contents): Use svn_client_conflict_t.

* subversion/svn/cl-conflicts.h
  (svn_cl__get_human_readable_prop_conflict_description,
   svn_cl__get_human_readable_tree_conflict_description,
   svn_cl__append_conflict_info_xml): Expect svn_client_conflict_t.

* subversion/svn/cl-conflicts.c
  (svn_cl__get_human_readable_prop_conflict_description,
   svn_cl__get_human_readable_tree_conflict_description,
   append_tree_conflict_info_xml,
   svn_cl__append_conflict_info_xml): Expect svn_client_conflict_t.

* subversion/svn/conflict-callbacks.c
  (show_diff, show_conflicts, handle_text_conflict, handle_prop_conflict,
   handle_tree_conflict, conflict_func_interactive): Use svn_client_conflict_t.
 (svn_cl__conflict_func_interactive): Convert svn_wc_conflict_description2_t
  to svn_client_conflict_t and use that.

* subversion/svn/info-cmd.c
  (print_info_xml, print_info): Convert svn_wc_conflict_description2_t to
  svn_client_conflict_t and use that.
   
* subversion/svn/status.c
  (print_status): Convert svn_wc_conflict_description2_t to
   svn_client_conflict_t and use that.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/resolved.c
    subversion/trunk/subversion/svn/cl-conflicts.c
    subversion/trunk/subversion/svn/cl-conflicts.h
    subversion/trunk/subversion/svn/conflict-callbacks.c
    subversion/trunk/subversion/svn/info-cmd.c
    subversion/trunk/subversion/svn/status.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Thu Jun 25 12:19:09 2015
@@ -4361,6 +4361,29 @@ svn_client_revert(const apr_array_header
  * @{
  */
 
+typedef struct svn_client_conflict_t svn_client_conflict_t;
+
+/**
+ * Return a conflict for the conflicted path @a local_abspath.
+ *
+ * @since New in 1.10.
+ */
+svn_client_conflict_t *
+svn_client_conflict_get(const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Return a conflict corresponding to conflict description @a desc.
+ *
+ * ### temporary API -- remove before releasing 1.10!
+ */
+svn_client_conflict_t *
+svn_client_conflict_from_wc_description2_t(
+ const svn_wc_conflict_description2_t *desc,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
 /**
  * Return the kind of conflict (text conflict, property conflict,
  * or tree conflict) represented by @a conflict.
@@ -4368,7 +4391,7 @@ svn_client_revert(const apr_array_header
  * New in 1.10.
  */
 svn_wc_conflict_kind_t
-svn_client_conflict_get_kind(const svn_wc_conflict_description2_t *conflict);
+svn_client_conflict_get_kind(const svn_client_conflict_t *conflict);
 
 /**
  * Return the absolute path to the conflicted working copy node described
@@ -4378,7 +4401,7 @@ svn_client_conflict_get_kind(const svn_w
  */
 const char *
 svn_client_conflict_get_local_abspath(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return the operation during which the conflict described by @a
@@ -4388,7 +4411,7 @@ svn_client_conflict_get_local_abspath(
  */
 svn_wc_operation_t
 svn_client_conflict_get_operation(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return the action an update, switch, or merge operation attempted to
@@ -4398,7 +4421,7 @@ svn_client_conflict_get_operation(
  */
 svn_wc_conflict_action_t
 svn_client_conflict_get_incoming_change(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return the reason why the attempted action performed by an update, switch,
@@ -4413,7 +4436,7 @@ svn_client_conflict_get_incoming_change(
  */
 svn_wc_conflict_reason_t
 svn_client_conflict_get_local_change(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return information about the repository associated with @a conflict.
@@ -4426,7 +4449,7 @@ svn_error_t *
 svn_client_conflict_get_repos_info(
   const char **repos_root_url,
   const char **repos_uuid,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);
 
@@ -4461,7 +4484,7 @@ svn_client_conflict_get_incoming_old_rep
   const char **incoming_old_repos_relpath,
   svn_revnum_t *incoming_old_regrev,
   svn_node_kind_t *incoming_old_node_kind,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);
 
@@ -4478,7 +4501,7 @@ svn_client_conflict_get_incoming_new_rep
   const char **incoming_new_repos_relpath,
   svn_revnum_t *incoming_new_regrev,
   svn_node_kind_t *incoming_new_node_kind,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);
 
@@ -4491,7 +4514,7 @@ svn_client_conflict_get_incoming_new_rep
  */
 svn_node_kind_t
 svn_client_conflict_tree_get_victim_node_kind(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return the name of the conflicted property represented by @a conflict.
@@ -4500,7 +4523,7 @@ svn_client_conflict_tree_get_victim_node
  */
 const char *
 svn_client_conflict_prop_get_propname(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return the set of property values involved in the property conflict
@@ -4519,7 +4542,7 @@ svn_client_conflict_prop_get_propvals(
   const svn_string_t **working_propval,
   const svn_string_t **incoming_old_propval,
   const svn_string_t **incoming_new_propval,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool);
 
 /**
@@ -4531,7 +4554,7 @@ svn_client_conflict_prop_get_propvals(
  */
 const char *
 svn_client_conflict_text_get_mime_type(
- const svn_wc_conflict_description2_t *conflict);
+ const svn_client_conflict_t *conflict);
 
 /**
  * Return absolute paths to the versions of the text-conflicted file
@@ -4548,7 +4571,7 @@ svn_client_conflict_text_get_contents(
   const char **working_abspath,
   const char **incoming_old_abspath,
   const char **incoming_new_abspath,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolved.c?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/resolved.c (original)
+++ subversion/trunk/subversion/libsvn_client/resolved.c Thu Jun 25 12:19:09 2015
@@ -148,64 +148,99 @@ svn_client_resolve(const char *path,
  
 /*** Dealing with conflicts. ***/
 
+struct svn_client_conflict_t
+{
+ const char *local_abspath;
+
+ const svn_wc_conflict_description2_t *desc2; /* ### temporary */
+};
+
+svn_client_conflict_t *
+svn_client_conflict_get(const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_client_conflict_t *conflict;
+
+ conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+ conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+
+ return conflict;
+}
+
+svn_client_conflict_t *
+svn_client_conflict_from_wc_description2_t(
+ const svn_wc_conflict_description2_t *desc,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_client_conflict_t *conflict;
+
+ conflict = svn_client_conflict_get(desc->local_abspath,
+ result_pool, scratch_pool);
+ conflict->desc2 = desc;
+
+ return conflict;
+}
+
 svn_wc_conflict_kind_t
-svn_client_conflict_get_kind(const svn_wc_conflict_description2_t *conflict)
+svn_client_conflict_get_kind(const svn_client_conflict_t *conflict)
 {
- return conflict->kind;
+ return conflict->desc2->kind;
 }
 
 const char *
 svn_client_conflict_get_local_abspath(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
   return conflict->local_abspath;
 }
 
 svn_wc_operation_t
 svn_client_conflict_get_operation(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
- return conflict->operation;
+ return conflict->desc2->operation;
 }
 
 svn_wc_conflict_action_t
 svn_client_conflict_get_incoming_change(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
- return conflict->action;
+ return conflict->desc2->action;
 }
 
 svn_wc_conflict_reason_t
 svn_client_conflict_get_local_change(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
- return conflict->reason;
+ return conflict->desc2->reason;
 }
 
 svn_error_t *
 svn_client_conflict_get_repos_info(
   const char **repos_root_url,
   const char **repos_uuid,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool)
 {
   if (repos_root_url)
     {
- if (conflict->src_left_version)
- *repos_root_url = conflict->src_left_version->repos_url;
- else if (conflict->src_right_version)
- *repos_root_url = conflict->src_right_version->repos_url;
+ if (conflict->desc2->src_left_version)
+ *repos_root_url = conflict->desc2->src_left_version->repos_url;
+ else if (conflict->desc2->src_right_version)
+ *repos_root_url = conflict->desc2->src_right_version->repos_url;
       else
         *repos_root_url = NULL;
     }
 
   if (repos_uuid)
     {
- if (conflict->src_left_version)
- *repos_uuid = conflict->src_left_version->repos_uuid;
- else if (conflict->src_right_version)
- *repos_uuid = conflict->src_right_version->repos_uuid;
+ if (conflict->desc2->src_left_version)
+ *repos_uuid = conflict->desc2->src_left_version->repos_uuid;
+ else if (conflict->desc2->src_right_version)
+ *repos_uuid = conflict->desc2->src_right_version->repos_uuid;
       else
         *repos_uuid = NULL;
     }
@@ -218,30 +253,31 @@ svn_client_conflict_get_incoming_old_rep
   const char **incoming_old_repos_relpath,
   svn_revnum_t *incoming_old_pegrev,
   svn_node_kind_t *incoming_old_node_kind,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool)
 {
   if (incoming_old_repos_relpath)
     {
- if (conflict->src_left_version)
- *incoming_old_repos_relpath = conflict->src_left_version->path_in_repos;
+ if (conflict->desc2->src_left_version)
+ *incoming_old_repos_relpath =
+ conflict->desc2->src_left_version->path_in_repos;
       else
         *incoming_old_repos_relpath = NULL;
     }
 
   if (incoming_old_pegrev)
     {
- if (conflict->src_left_version)
- *incoming_old_pegrev = conflict->src_left_version->peg_rev;
+ if (conflict->desc2->src_left_version)
+ *incoming_old_pegrev = conflict->desc2->src_left_version->peg_rev;
       else
         *incoming_old_pegrev = SVN_INVALID_REVNUM;
     }
 
   if (incoming_old_node_kind)
     {
- if (conflict->src_left_version)
- *incoming_old_node_kind = conflict->src_left_version->node_kind;
+ if (conflict->desc2->src_left_version)
+ *incoming_old_node_kind = conflict->desc2->src_left_version->node_kind;
       else
         *incoming_old_node_kind = svn_node_none;
     }
@@ -254,31 +290,31 @@ svn_client_conflict_get_incoming_new_rep
   const char **incoming_new_repos_relpath,
   svn_revnum_t *incoming_new_pegrev,
   svn_node_kind_t *incoming_new_node_kind,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool)
 {
   if (incoming_new_repos_relpath)
     {
- if (conflict->src_right_version)
+ if (conflict->desc2->src_right_version)
         *incoming_new_repos_relpath =
- conflict->src_right_version->path_in_repos;
+ conflict->desc2->src_right_version->path_in_repos;
       else
         *incoming_new_repos_relpath = NULL;
     }
 
   if (incoming_new_pegrev)
     {
- if (conflict->src_right_version)
- *incoming_new_pegrev = conflict->src_right_version->peg_rev;
+ if (conflict->desc2->src_right_version)
+ *incoming_new_pegrev = conflict->desc2->src_right_version->peg_rev;
       else
         *incoming_new_pegrev = SVN_INVALID_REVNUM;
     }
 
   if (incoming_new_node_kind)
     {
- if (conflict->src_right_version)
- *incoming_new_node_kind = conflict->src_right_version->node_kind;
+ if (conflict->desc2->src_right_version)
+ *incoming_new_node_kind = conflict->desc2->src_right_version->node_kind;
       else
         *incoming_new_node_kind = svn_node_none;
     }
@@ -288,22 +324,22 @@ svn_client_conflict_get_incoming_new_rep
 
 svn_node_kind_t
 svn_client_conflict_tree_get_victim_node_kind(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
   SVN_ERR_ASSERT_NO_RETURN(svn_client_conflict_get_kind(conflict)
       == svn_wc_conflict_kind_tree);
 
- return conflict->node_kind;
+ return conflict->desc2->node_kind;
 }
 
 const char *
 svn_client_conflict_prop_get_propname(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
   SVN_ERR_ASSERT_NO_RETURN(svn_client_conflict_get_kind(conflict)
       == svn_wc_conflict_kind_property);
 
- return conflict->property_name;
+ return conflict->desc2->property_name;
 }
 
 svn_error_t *
@@ -312,38 +348,39 @@ svn_client_conflict_prop_get_propvals(
   const svn_string_t **working_propval,
   const svn_string_t **incoming_old_propval,
   const svn_string_t **incoming_new_propval,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool)
 {
   SVN_ERR_ASSERT(svn_client_conflict_get_kind(conflict) ==
                  svn_wc_conflict_kind_property);
 
   if (base_propval)
- *base_propval = svn_string_dup(conflict->prop_value_base, result_pool);
+ *base_propval = svn_string_dup(conflict->desc2->prop_value_base,
+ result_pool);
 
   if (working_propval)
- *working_propval = svn_string_dup(conflict->prop_value_working,
+ *working_propval = svn_string_dup(conflict->desc2->prop_value_working,
                                       result_pool);
 
   if (incoming_old_propval)
- *incoming_old_propval = svn_string_dup(conflict->prop_value_incoming_old,
- result_pool);
+ *incoming_old_propval =
+ svn_string_dup(conflict->desc2->prop_value_incoming_old, result_pool);
 
   if (incoming_new_propval)
- *incoming_new_propval = svn_string_dup(conflict->prop_value_incoming_new,
- result_pool);
+ *incoming_new_propval =
+ svn_string_dup(conflict->desc2->prop_value_incoming_new, result_pool);
 
   return SVN_NO_ERROR;
 }
 
 const char *
 svn_client_conflict_text_get_mime_type(
- const svn_wc_conflict_description2_t *conflict)
+ const svn_client_conflict_t *conflict)
 {
   SVN_ERR_ASSERT_NO_RETURN(svn_client_conflict_get_kind(conflict)
       == svn_wc_conflict_kind_text);
 
- return conflict->mime_type;
+ return conflict->desc2->mime_type;
 }
 
 svn_error_t *
@@ -352,7 +389,7 @@ svn_client_conflict_text_get_contents(
   const char **working_abspath,
   const char **incoming_old_abspath,
   const char **incoming_new_abspath,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool)
 {
@@ -365,17 +402,17 @@ svn_client_conflict_text_get_contents(
           svn_wc_operation_merge)
         *base_abspath = NULL; /* ### WC base contents not available yet */
       else /* update/switch */
- *base_abspath = conflict->base_abspath;
+ *base_abspath = conflict->desc2->base_abspath;
     }
 
   if (working_abspath)
- *working_abspath = conflict->my_abspath;
+ *working_abspath = conflict->desc2->my_abspath;
 
   if (incoming_old_abspath)
- *incoming_old_abspath = conflict->base_abspath;
+ *incoming_old_abspath = conflict->desc2->base_abspath;
 
   if (incoming_new_abspath)
- *incoming_new_abspath = conflict->their_abspath;
+ *incoming_new_abspath = conflict->desc2->their_abspath;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svn/cl-conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/cl-conflicts.c?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/cl-conflicts.c (original)
+++ subversion/trunk/subversion/svn/cl-conflicts.c Thu Jun 25 12:19:09 2015
@@ -229,7 +229,7 @@ operation_str(svn_wc_operation_t operati
 svn_error_t *
 svn_cl__get_human_readable_prop_conflict_description(
   const char **desc,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *pool)
 {
   const char *reason_str, *action_str;
@@ -288,7 +288,7 @@ svn_cl__get_human_readable_prop_conflict
 svn_error_t *
 svn_cl__get_human_readable_tree_conflict_description(
   const char **desc,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *pool)
 {
   const char *action, *reason, *operation;
@@ -411,7 +411,7 @@ add_conflict_version_xml(svn_stringbuf_t
 
 static svn_error_t *
 append_tree_conflict_info_xml(svn_stringbuf_t *str,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
                               apr_pool_t *pool)
 {
   apr_hash_t *att_hash = apr_hash_make(pool);
@@ -479,7 +479,7 @@ append_tree_conflict_info_xml(svn_string
 
 svn_error_t *
 svn_cl__append_conflict_info_xml(svn_stringbuf_t *str,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
                                  apr_pool_t *scratch_pool)
 {
   apr_hash_t *att_hash;

Modified: subversion/trunk/subversion/svn/cl-conflicts.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/cl-conflicts.h?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/cl-conflicts.h (original)
+++ subversion/trunk/subversion/svn/cl-conflicts.h Thu Jun 25 12:19:09 2015
@@ -31,6 +31,7 @@
 
 #include "svn_types.h"
 #include "svn_string.h"
+#include "svn_client.h"
 #include "svn_wc.h"
 
 #ifdef __cplusplus
@@ -48,7 +49,7 @@ extern "C" {
 svn_error_t *
 svn_cl__get_human_readable_prop_conflict_description(
   const char **desc,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *pool);
 
 /**
@@ -60,7 +61,7 @@ svn_cl__get_human_readable_prop_conflict
 svn_error_t *
 svn_cl__get_human_readable_tree_conflict_description(
   const char **desc,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *pool);
 
 /* Like svn_cl__get_human_readable_tree_conflict_description but
@@ -80,7 +81,7 @@ svn_cl__get_human_readable_action_descri
 svn_error_t *
 svn_cl__append_conflict_info_xml(
   svn_stringbuf_t *str,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_client_conflict_t *conflict,
   apr_pool_t *pool);
 
 #ifdef __cplusplus

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Thu Jun 25 12:19:09 2015
@@ -128,9 +128,9 @@ svn_cl__accept_from_word(const char *wor
 
 
 /* Print on stdout a diff that shows incoming conflicting changes
- * corresponding to the conflict described in DESC. */
+ * corresponding to the conflict described in CONFLICT. */
 static svn_error_t *
-show_diff(const svn_wc_conflict_description2_t *desc,
+show_diff(const svn_client_conflict_t *conflict,
           const char *merged_abspath,
           const char *path_prefix,
           svn_cancel_func_t cancel_func,
@@ -147,7 +147,7 @@ show_diff(const svn_wc_conflict_descript
 
   SVN_ERR(svn_client_conflict_text_get_contents(NULL, &my_abspath, NULL,
                                                 &their_abspath,
- desc, pool, pool));
+ conflict, pool, pool));
   if (merged_abspath)
     {
       /* For conflicts recorded by the 'merge' operation, show a diff between
@@ -162,7 +162,7 @@ show_diff(const svn_wc_conflict_descript
        *
        * This way, the diff is always minimal and clearly identifies changes
        * brought into the working copy by the update/switch/merge operation. */
- if (svn_client_conflict_get_operation(desc) == svn_wc_operation_merge)
+ if (svn_client_conflict_get_operation(conflict) == svn_wc_operation_merge)
         {
           path1 = my_abspath;
           label1 = _("MINE");
@@ -210,9 +210,9 @@ show_diff(const svn_wc_conflict_descript
 
 
 /* Print on stdout just the conflict hunks of a diff among the 'base', 'their'
- * and 'my' files of DESC. */
+ * and 'my' files of CONFLICT. */
 static svn_error_t *
-show_conflicts(const svn_wc_conflict_description2_t *desc,
+show_conflicts(const svn_client_conflict_t *conflict,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
                apr_pool_t *pool)
@@ -226,7 +226,7 @@ show_conflicts(const svn_wc_conflict_des
 
   SVN_ERR(svn_client_conflict_text_get_contents(NULL, &my_abspath,
                                                 &base_abspath, &their_abspath,
- desc, pool, pool));
+ conflict, pool, pool));
   options = svn_diff_file_options_create(pool);
   options->ignore_eol_style = TRUE;
   SVN_ERR(svn_stream_for_stdout(&output, pool));
@@ -702,13 +702,13 @@ prompt_user(const resolver_option_t **op
   return SVN_NO_ERROR;
 }
 
-/* Ask the user what to do about the text conflict described by DESC.
+/* Ask the user what to do about the text conflict described by CONFLICT.
  * Return the answer in RESULT. B is the conflict baton for this
  * conflict resolution session.
  * SCRATCH_POOL is used for temporary allocations. */
 static svn_error_t *
 handle_text_conflict(svn_wc_conflict_result_t *result,
- const svn_wc_conflict_description2_t *desc,
+ const svn_client_conflict_t *conflict,
                      svn_cl__interactive_conflict_baton_t *b,
                      apr_pool_t *scratch_pool)
 {
@@ -722,18 +722,18 @@ handle_text_conflict(svn_wc_conflict_res
      give them a rational basis for choosing (r)esolved? */
   svn_boolean_t knows_something = FALSE;
   const char *local_relpath;
- const char *local_abspath = svn_client_conflict_get_local_abspath(desc);
- const char *mime_type = svn_client_conflict_text_get_mime_type(desc);
+ const char *local_abspath = svn_client_conflict_get_local_abspath(conflict);
+ const char *mime_type = svn_client_conflict_text_get_mime_type(conflict);
   svn_boolean_t is_binary = mime_type ? svn_mime_type_is_binary(mime_type)
                                       : FALSE;
   const char *base_abspath;
   const char *my_abspath;
   const char *their_abspath;
- const char *merged_abspath = svn_client_conflict_get_local_abspath(desc);
+ const char *merged_abspath = svn_client_conflict_get_local_abspath(conflict);
 
   SVN_ERR(svn_client_conflict_text_get_contents(NULL, &my_abspath,
                                                 &base_abspath, &their_abspath,
- desc, scratch_pool,
+ conflict, scratch_pool,
                                                 scratch_pool));
 
   local_relpath = svn_cl__local_style_skip_ancestor(b->path_prefix,
@@ -844,7 +844,7 @@ handle_text_conflict(svn_wc_conflict_res
                                             "files not available.\n\n")));
               continue;
             }
- SVN_ERR(show_conflicts(desc,
+ SVN_ERR(show_conflicts(conflict,
                                  b->pb->cancel_func,
                                  b->pb->cancel_baton,
                                  iterpool));
@@ -861,7 +861,7 @@ handle_text_conflict(svn_wc_conflict_res
               continue;
             }
 
- SVN_ERR(show_diff(desc, merged_abspath, b->path_prefix,
+ SVN_ERR(show_diff(conflict, merged_abspath, b->path_prefix,
                             b->pb->cancel_func, b->pb->cancel_baton,
                             iterpool));
           knows_something = TRUE;
@@ -1033,13 +1033,13 @@ handle_text_conflict(svn_wc_conflict_res
   return SVN_NO_ERROR;
 }
 
-/* Ask the user what to do about the property conflict described by DESC.
+/* Ask the user what to do about the property conflict described by CONFLICT.
  * Return the answer in RESULT. B is the conflict baton for this
  * conflict resolution session.
  * SCRATCH_POOL is used for temporary allocations. */
 static svn_error_t *
 handle_prop_conflict(svn_wc_conflict_result_t *result,
- const svn_wc_conflict_description2_t *desc,
+ const svn_client_conflict_t *conflict,
                      svn_cl__interactive_conflict_baton_t *b,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
@@ -1054,18 +1054,19 @@ handle_prop_conflict(svn_wc_conflict_res
 
   SVN_ERR(svn_client_conflict_prop_get_propvals(NULL, &my_propval,
                                                 &base_propval, &their_propval,
- desc, scratch_pool));
+ conflict, scratch_pool));
 
   SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
                               _("Conflict for property '%s' discovered"
                                 " on '%s'.\n"),
- svn_client_conflict_prop_get_propname(desc),
+ svn_client_conflict_prop_get_propname(conflict),
                               svn_cl__local_style_skip_ancestor(
                                 b->path_prefix,
- svn_client_conflict_get_local_abspath(desc),
+ svn_client_conflict_get_local_abspath(conflict),
                                 scratch_pool)));
 
- SVN_ERR(svn_cl__get_human_readable_prop_conflict_description(&message, desc,
+ SVN_ERR(svn_cl__get_human_readable_prop_conflict_description(&message,
+ conflict,
                                                                scratch_pool));
   SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n", message));
 
@@ -1140,13 +1141,13 @@ handle_prop_conflict(svn_wc_conflict_res
   return SVN_NO_ERROR;
 }
 
-/* Ask the user what to do about the tree conflict described by DESC.
+/* Ask the user what to do about the tree conflict described by CONFLICT.
  * Return the answer in RESULT. B is the conflict baton for this
  * conflict resolution session.
  * SCRATCH_POOL is used for temporary allocations. */
 static svn_error_t *
 handle_tree_conflict(svn_wc_conflict_result_t *result,
- const svn_wc_conflict_description2_t *desc,
+ const svn_client_conflict_t *conflict,
                      svn_cl__interactive_conflict_baton_t *b,
                      apr_pool_t *scratch_pool)
 {
@@ -1158,22 +1159,22 @@ handle_tree_conflict(svn_wc_conflict_res
   svn_revnum_t peg_rev;
   svn_node_kind_t node_kind;
   apr_pool_t *iterpool;
-
+
   SVN_ERR(svn_cl__get_human_readable_tree_conflict_description(
- &readable_desc, desc, scratch_pool));
+ &readable_desc, conflict, scratch_pool));
   SVN_ERR(svn_cmdline_fprintf(
                stderr, scratch_pool,
                _("Tree conflict on '%s'\n > %s\n"),
                svn_cl__local_style_skip_ancestor(b->path_prefix,
- svn_client_conflict_get_local_abspath(desc), scratch_pool),
+ svn_client_conflict_get_local_abspath(conflict), scratch_pool),
                readable_desc));
 
- SVN_ERR(svn_client_conflict_get_repos_info(&repos_root_url, NULL,
- desc, scratch_pool, scratch_pool));
+ SVN_ERR(svn_client_conflict_get_repos_info(&repos_root_url, NULL, conflict,
+ scratch_pool, scratch_pool));
   SVN_ERR(svn_client_conflict_get_incoming_old_repos_location(&repos_relpath,
                                                               &peg_rev,
                                                               &node_kind,
- desc,
+ conflict,
                                                               scratch_pool,
                                                               scratch_pool));
   src_left_version =
@@ -1186,7 +1187,7 @@ handle_tree_conflict(svn_wc_conflict_res
   SVN_ERR(svn_client_conflict_get_incoming_new_repos_location(&repos_relpath,
                                                               &peg_rev,
                                                               &node_kind,
- desc,
+ conflict,
                                                               scratch_pool,
                                                               scratch_pool));
   src_right_version =
@@ -1206,12 +1207,14 @@ handle_tree_conflict(svn_wc_conflict_res
 
       tc_opts = tree_conflict_options;
 
- if (svn_client_conflict_get_operation(desc) == svn_wc_operation_update ||
- svn_client_conflict_get_operation(desc) == svn_wc_operation_switch)
+ if (svn_client_conflict_get_operation(conflict) ==
+ svn_wc_operation_update ||
+ svn_client_conflict_get_operation(conflict) ==
+ svn_wc_operation_switch)
         {
           svn_wc_conflict_reason_t reason;
 
- reason = svn_client_conflict_get_local_change(desc);
+ reason = svn_client_conflict_get_local_change(conflict);
           if (reason == svn_wc_conflict_reason_moved_away)
             {
               tc_opts = tree_conflict_options_update_moved_away;
@@ -1219,9 +1222,9 @@ handle_tree_conflict(svn_wc_conflict_res
           else if (reason == svn_wc_conflict_reason_deleted ||
                    reason == svn_wc_conflict_reason_replaced)
             {
- if (svn_client_conflict_get_incoming_change(desc) ==
+ if (svn_client_conflict_get_incoming_change(conflict) ==
                   svn_wc_conflict_action_edit &&
- svn_client_conflict_tree_get_victim_node_kind(desc) ==
+ svn_client_conflict_tree_get_victim_node_kind(conflict) ==
                   svn_node_dir)
                 tc_opts = tree_conflict_options_update_edit_deleted_dir;
             }
@@ -1252,7 +1255,7 @@ handle_tree_conflict(svn_wc_conflict_res
 /* The body of svn_cl__conflict_func_interactive(). */
 static svn_error_t *
 conflict_func_interactive(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description2_t *desc,
+ const svn_client_conflict_t *conflict,
                           void *baton,
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool)
@@ -1262,13 +1265,13 @@ conflict_func_interactive(svn_wc_conflic
   const char *base_abspath = NULL;
   const char *my_abspath = NULL;
   const char *their_abspath = NULL;
- const char *merged_abspath = svn_client_conflict_get_local_abspath(desc);
+ const char *merged_abspath = svn_client_conflict_get_local_abspath(conflict);
 
- if (svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_text)
+ if (svn_client_conflict_get_kind(conflict) == svn_wc_conflict_kind_text)
     SVN_ERR(svn_client_conflict_text_get_contents(NULL, &my_abspath,
                                                   &base_abspath,
                                                   &their_abspath,
- desc, scratch_pool,
+ conflict, scratch_pool,
                                                   scratch_pool));
 
   /* Start out assuming we're going to postpone the conflict. */
@@ -1345,7 +1348,7 @@ conflict_func_interactive(svn_wc_conflic
               return SVN_NO_ERROR;
             }
 
- local_abspath = svn_client_conflict_get_local_abspath(desc);
+ local_abspath = svn_client_conflict_get_local_abspath(conflict);
           err = svn_cl__merge_file_externally(base_abspath,
                                               their_abspath,
                                               my_abspath,
@@ -1394,16 +1397,18 @@ conflict_func_interactive(svn_wc_conflic
      Conflicting edits on a file's text, or
      Conflicting edits on a property.
   */
- if (((svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_text)
- && (svn_client_conflict_get_incoming_change(desc) ==
+ if (((svn_client_conflict_get_kind(conflict) == svn_wc_conflict_kind_text)
+ && (svn_client_conflict_get_incoming_change(conflict) ==
            svn_wc_conflict_action_edit)
- && (svn_client_conflict_get_local_change(desc) ==
+ && (svn_client_conflict_get_local_change(conflict) ==
            svn_wc_conflict_reason_edited)))
- SVN_ERR(handle_text_conflict(*result, desc, b, scratch_pool));
- else if (svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_property)
- SVN_ERR(handle_prop_conflict(*result, desc, b, result_pool, scratch_pool));
- else if (svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_tree)
- SVN_ERR(handle_tree_conflict(*result, desc, b, scratch_pool));
+ SVN_ERR(handle_text_conflict(*result, conflict, b, scratch_pool));
+ else if (svn_client_conflict_get_kind(conflict) ==
+ svn_wc_conflict_kind_property)
+ SVN_ERR(handle_prop_conflict(*result, conflict, b, result_pool,
+ scratch_pool));
+ else if (svn_client_conflict_get_kind(conflict) == svn_wc_conflict_kind_tree)
+ SVN_ERR(handle_tree_conflict(*result, conflict, b, scratch_pool));
 
   else /* other types of conflicts -- do nothing about them. */
     {
@@ -1421,8 +1426,11 @@ svn_cl__conflict_func_interactive(svn_wc
                                   apr_pool_t *scratch_pool)
 {
   svn_cl__interactive_conflict_baton_t *b = baton;
+ svn_client_conflict_t *conflict;
 
- SVN_ERR(conflict_func_interactive(result, desc, baton,
+ conflict = svn_client_conflict_from_wc_description2_t(desc, scratch_pool,
+ scratch_pool);
+ SVN_ERR(conflict_func_interactive(result, conflict, baton,
                                     result_pool, scratch_pool));
 
   /* If we are resolving a conflict, adjust the summary of conflicts. */
@@ -1430,11 +1438,11 @@ svn_cl__conflict_func_interactive(svn_wc
     {
       const char *local_path
         = svn_cl__local_style_skip_ancestor(
- b->path_prefix, svn_client_conflict_get_local_abspath(desc),
+ b->path_prefix, svn_client_conflict_get_local_abspath(conflict),
             scratch_pool);
 
       svn_cl__conflict_stats_resolved(b->conflict_stats, local_path,
- svn_client_conflict_get_kind(desc));
+ svn_client_conflict_get_kind(conflict));
     }
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/info-cmd.c?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/info-cmd.c (original)
+++ subversion/trunk/subversion/svn/info-cmd.c Thu Jun 25 12:19:09 2015
@@ -391,15 +391,23 @@ print_info_xml(void *baton,
   if (info->wc_info && info->wc_info->conflicts)
     {
       int i;
+ apr_pool_t *iterpool;
 
+ iterpool = svn_pool_create(pool);
       for (i = 0; i < info->wc_info->conflicts->nelts; i++)
         {
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description2_t *desc =
                       APR_ARRAY_IDX(info->wc_info->conflicts, i,
                                     const svn_wc_conflict_description2_t *);
+ svn_client_conflict_t *conflict;
 
- SVN_ERR(svn_cl__append_conflict_info_xml(sb, conflict, pool));
+ svn_pool_clear(iterpool);
+
+ conflict = svn_client_conflict_from_wc_description2_t(desc, iterpool,
+ iterpool);
+ SVN_ERR(svn_cl__append_conflict_info_xml(sb, conflict, iterpool));
         }
+ svn_pool_destroy(iterpool);
     }
 
   if (info->lock)
@@ -584,17 +592,25 @@ print_info(void *baton,
           svn_boolean_t printed_tc = FALSE;
           svn_stringbuf_t *conflicted_props = NULL;
           int i;
+ apr_pool_t *iterpool;
 
+ iterpool = svn_pool_create(pool);
           for (i = 0; i < info->wc_info->conflicts->nelts; i++)
             {
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description2_t *desc2 =
                     APR_ARRAY_IDX(info->wc_info->conflicts, i,
                                   const svn_wc_conflict_description2_t *);
               const char *desc;
               const char *base_abspath = NULL;
               const char *my_abspath = NULL;
               const char *their_abspath = NULL;
+ svn_client_conflict_t *conflict;
+
+ svn_pool_clear(iterpool);
 
+ conflict = svn_client_conflict_from_wc_description2_t(desc2,
+ iterpool,
+ iterpool);
               switch (svn_client_conflict_get_kind(conflict))
                 {
                   case svn_wc_conflict_kind_text:
@@ -654,6 +670,7 @@ print_info(void *baton,
                   break;
                 }
             }
+ svn_pool_destroy(iterpool);
 
           if (conflicted_props)
             SVN_ERR(svn_cmdline_printf(pool, _("Conflicted Properties: %s\n"),
@@ -670,10 +687,14 @@ print_info(void *baton,
             const char *repos_relpath;
             svn_revnum_t peg_rev;
             svn_node_kind_t node_kind;
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description2_t *desc =
                   APR_ARRAY_IDX(info->wc_info->conflicts, 0,
                                 const svn_wc_conflict_description2_t *);
 
+ svn_client_conflict_t *conflict;
+
+ conflict = svn_client_conflict_from_wc_description2_t(desc,
+ pool, pool);
             if (!printed_tc)
               {
                 const char *desc;

Modified: subversion/trunk/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/status.c?rev=1687489&r1=1687488&r2=1687489&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/status.c (original)
+++ subversion/trunk/subversion/svn/status.c Thu Jun 25 12:19:09 2015
@@ -282,11 +282,16 @@ print_status(const char *target_abspath,
 
       if (tree_conflicted)
         {
- const svn_wc_conflict_description2_t *tree_conflict;
- SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, ctx->wc_ctx,
+ const svn_wc_conflict_description2_t *desc;
+ svn_client_conflict_t *tree_conflict;
+
+ SVN_ERR(svn_wc__get_tree_conflict(&desc, ctx->wc_ctx,
                                             local_abspath, pool, pool));
- SVN_ERR_ASSERT(tree_conflict != NULL);
+ SVN_ERR_ASSERT(desc != NULL);
 
+ tree_conflict = svn_client_conflict_from_wc_description2_t(desc,
+ pool,
+ pool);
           tree_status_code = 'C';
           SVN_ERR(svn_cl__get_human_readable_tree_conflict_description(
                             &desc, tree_conflict, pool));
Received on 2015-06-25 15:07:36 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.