subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1480669 - /subversion/trunk/subversion/svn/conflict-callbacks.c
Date Thu, 09 May 2013 14:51:35 GMT
Author: stsp
Date: Thu May  9 14:51:35 2013
New Revision: 1480669

URL: http://svn.apache.org/r1480669
Log:
If a merged property value exists, make the 'dc' conflict prompt option use
the merged value as 'mine' for display. Else, users might get confused if
they edit a property, run 'dc', and see the value from before the edit.

* subversion/svn/conflict-callbacks.c
  (show_prop_conflict, merge_prop_conflict): Add merged_abspath parameter.
   Use it as 'my' version if non-NULL.
  (edit_prop_conflict): For now, pass NULL for the merged file to
   merge_prop_conflict(), so that repeated edits always start with
   the same original values. This behaviour can be reconsidered later.
  (handle_prop_conflict): Pass the path to the merged file, which might be
   NULL, to show_prop_conflict().

Modified:
    subversion/trunk/subversion/svn/conflict-callbacks.c

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1480669&r1=1480668&r2=1480669&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Thu May  9 14:51:35 2013
@@ -230,11 +230,15 @@ show_conflicts(const svn_wc_conflict_des
 /* Perform a 3-way merge of the conflicting values of a property,
  * and write the result to the OUTPUT stream.
  *
+ * If MERGED_ABSPATH is non-NULL, use it as 'my' version instead of
+ * DESC->MY_ABSPATH.
+ *
  * Assume the values are printable UTF-8 text.
  */
 static svn_error_t *
 merge_prop_conflict(svn_stream_t *output,
                     const svn_wc_conflict_description2_t *desc,
+                    const char *merged_abspath,
                     apr_pool_t *pool)
 {
   const char *base_abspath = desc->base_abspath;
@@ -262,11 +266,14 @@ merge_prop_conflict(svn_stream_t *output
 
   options->ignore_eol_style = TRUE;
   SVN_ERR(svn_diff_file_diff3_2(&diff,
-                                base_abspath, my_abspath, their_abspath,
+                                base_abspath,
+                                merged_abspath ? merged_abspath : my_abspath,
+                                their_abspath,
                                 options, pool));
   SVN_ERR(svn_diff_file_output_merge2(output, diff,
                                       base_abspath,
-                                      my_abspath,
+                                      merged_abspath ? merged_abspath
+                                                     : my_abspath,
                                       their_abspath,
                                       _("||||||| ORIGINAL"),
                                       _("<<<<<<< MINE"),
@@ -280,16 +287,20 @@ merge_prop_conflict(svn_stream_t *output
 
 /* Display the conflicting values of a property as a 3-way diff.
  *
+ * If MERGED_ABSPATH is non-NULL, show it as 'my' version instead of
+ * DESC->MY_ABSPATH.
+ *
  * Assume the values are printable UTF-8 text.
  */
 static svn_error_t *
 show_prop_conflict(const svn_wc_conflict_description2_t *desc,
+                   const char *merged_abspath,
                    apr_pool_t *pool)
 {
   svn_stream_t *output;
 
   SVN_ERR(svn_stream_for_stdout(&output, pool));
-  SVN_ERR(merge_prop_conflict(output, desc, pool));
+  SVN_ERR(merge_prop_conflict(output, desc, merged_abspath, pool));
 
   return SVN_NO_ERROR;
 }
@@ -366,7 +377,7 @@ edit_prop_conflict(const char **merged_f
                                    result_pool, scratch_pool));
   merged_prop = svn_stream_from_aprfile2(file, TRUE /* disown */,
                                          scratch_pool);
-  SVN_ERR(merge_prop_conflict(merged_prop, desc, scratch_pool));
+  SVN_ERR(merge_prop_conflict(merged_prop, desc, NULL, scratch_pool));
   SVN_ERR(svn_stream_close(merged_prop));
   SVN_ERR(svn_io_file_flush_to_disk(file, scratch_pool));
   SVN_ERR(open_editor(&performed_edit, file_path, b, scratch_pool));
@@ -1001,7 +1012,7 @@ handle_prop_conflict(svn_wc_conflict_res
         }
       else if (strcmp(opt->code, "dc") == 0)
         {
-          SVN_ERR(show_prop_conflict(desc, scratch_pool));
+          SVN_ERR(show_prop_conflict(desc, merged_file_path, scratch_pool));
         }
       else if (strcmp(opt->code, "e") == 0)
         {



Mime
View raw message