subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1618599 - in /subversion/trunk/subversion: include/svn_diff.h libsvn_diff/deprecated.c libsvn_diff/diff_memory.c libsvn_wc/conflicts.c libsvn_wc/props.c libsvn_wc/props.h libsvn_wc/workqueue.c
Date Mon, 18 Aug 2014 13:18:30 GMT
Author: breser
Date: Mon Aug 18 13:18:30 2014
New Revision: 1618599

URL: http://svn.apache.org/r1618599
Log:
Add svn_diff_mem_string_output_merge3() with cancel support.

* subversion/include/svn_diff.h
  (svn_diff_mem_string_output_merge3): New function.
  (svn_diff_mem_string_output_merge2): Deprecate.

* subversion/libsvn_diff/diff_memory.c
  (svn_diff_mem_string_output_merge2): Convert into ...
  (svn_diff_mem_string_output_merge3): New function with cancel support.

* subversion/libsvn_diff/deprecated.c
  (svn_diff_mem_string_output_merge2): New implementation that calls
    svn_diff_mem_string_output_merge3().

* subversion/libsvn_wc/conflicts.c
  (generate_propconflict): Add cancel support and use *_merge3().
  (svn_wc__conflict_invoke_resolver): Update to pass cancel args to
    generate_propconflict.

* subversion/libsvn_wc/props.c
  (prop_conflict_from_skel, append_prop_conflict, svn_wc__create_prejfile):
    Add cancel support.

* subversion/libsvn_wc/props.h
  (svn_wc__create_prejfile): Add cancel support.

* subversion/libsvn_wc/workqueue.c
  (run_prej_install): Pass cancel func/baton to svn_wc__create_prejfile.


Modified:
    subversion/trunk/subversion/include/svn_diff.h
    subversion/trunk/subversion/libsvn_diff/deprecated.c
    subversion/trunk/subversion/libsvn_diff/diff_memory.c
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.h
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_diff.h?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_diff.h (original)
+++ subversion/trunk/subversion/include/svn_diff.h Mon Aug 18 13:18:30 2014
@@ -871,8 +871,30 @@ svn_diff_mem_string_output_unified(svn_s
  *
  * @a conflict_style dictates how conflicts are displayed.
  *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_diff_mem_string_output_merge3(svn_stream_t *output_stream,
+                                  svn_diff_t *diff,
+                                  const svn_string_t *original,
+                                  const svn_string_t *modified,
+                                  const svn_string_t *latest,
+                                  const char *conflict_original,
+                                  const char *conflict_modified,
+                                  const char *conflict_latest,
+                                  const char *conflict_separator,
+                                  svn_diff_conflict_display_style_t style,
+                                  svn_cancel_func_t cancel_func,
+                                  void *cancel_baton,
+                                  apr_pool_t *pool);
+
+/** Similar to svn_diff_mem_string_output_merge2(), but without cancel support.
+ *
  * @since New in 1.6.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_diff_mem_string_output_merge2(svn_stream_t *output_stream,
                                   svn_diff_t *diff,

Modified: subversion/trunk/subversion/libsvn_diff/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/deprecated.c?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_diff/deprecated.c Mon Aug 18 13:18:30 2014
@@ -326,3 +326,26 @@ svn_diff_output(svn_diff_t *diff,
                                           NULL, NULL /* cancel */));
 }
 
+/*** From diff_memory.c ***/
+svn_error_t *
+svn_diff_mem_string_output_merge2(svn_stream_t *output_stream,
+                                  svn_diff_t *diff,
+                                  const svn_string_t *original,
+                                  const svn_string_t *modified,
+                                  const svn_string_t *latest,
+                                  const char *conflict_original,
+                                  const char *conflict_modified,
+                                  const char *conflict_latest,
+                                  const char *conflict_separator,
+                                  svn_diff_conflict_display_style_t style,
+                                  apr_pool_t *pool)
+{
+  return svn_diff_mem_string_output_merge3(output_stream, diff, original,
+                                           modified, latest,
+                                           conflict_original,
+                                           conflict_modified,
+                                           conflict_latest,
+                                           conflict_separator, style,
+                                           NULL, NULL, /* no cancelation */
+                                           pool);
+}

Modified: subversion/trunk/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/diff_memory.c?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/trunk/subversion/libsvn_diff/diff_memory.c Mon Aug 18 13:18:30 2014
@@ -1066,7 +1066,7 @@ detect_eol(svn_string_t *token)
 }
 
 svn_error_t *
-svn_diff_mem_string_output_merge2(svn_stream_t *output_stream,
+svn_diff_mem_string_output_merge3(svn_stream_t *output_stream,
                                   svn_diff_t *diff,
                                   const svn_string_t *original,
                                   const svn_string_t *modified,
@@ -1076,6 +1076,8 @@ svn_diff_mem_string_output_merge2(svn_st
                                   const char *conflict_latest,
                                   const char *conflict_separator,
                                   svn_diff_conflict_display_style_t style,
+                                  svn_cancel_func_t cancel_func,
+                                  void *cancel_baton,
                                   apr_pool_t *pool)
 {
   merge_output_baton_t btn;
@@ -1135,7 +1137,7 @@ svn_diff_mem_string_output_merge2(svn_st
                                     : ">>>>>>> (latest)",
                                     pool));
 
-  SVN_ERR(svn_diff_output(diff, &btn, vtable));
+  SVN_ERR(svn_diff_output2(diff, &btn, vtable, cancel_func, cancel_baton));
   if (conflicts_only)
     svn_pool_destroy(btn.pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Mon Aug 18 13:18:30 2014
@@ -1273,6 +1273,8 @@ generate_propconflict(svn_boolean_t *con
                       const svn_string_t *incoming_new_val,
                       svn_wc_conflict_resolver_func2_t conflict_func,
                       void *conflict_baton,
+                      svn_cancel_func_t cancel_func,
+                      void *cancel_baton,
                       apr_pool_t *scratch_pool)
 {
   svn_wc_conflict_result_t *result = NULL;
@@ -1402,10 +1404,11 @@ generate_propconflict(svn_boolean_t *con
           SVN_ERR(svn_diff_mem_string_diff3(&diff, conflict_base_val,
                                             working_val,
                                             incoming_new_val, options, scratch_pool));
-          SVN_ERR(svn_diff_mem_string_output_merge2(mergestream, diff,
+          SVN_ERR(svn_diff_mem_string_output_merge3(mergestream, diff,
                    conflict_base_val, working_val,
                    incoming_new_val, NULL, NULL, NULL, NULL,
-                   svn_diff_conflict_display_modified_latest, scratch_pool));
+                   svn_diff_conflict_display_modified_latest,
+                   cancel_func, cancel_baton, scratch_pool));
           SVN_ERR(svn_stream_close(mergestream));
         }
     }
@@ -2020,6 +2023,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
                                           ? svn_hash_gets(their_props, propname)
                                           : NULL,
                                         resolver_func, resolver_baton,
+                                        cancel_func, cancel_baton,
                                         iterpool));
 
           if (conflict_remains)

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Mon Aug 18 13:18:30 2014
@@ -66,6 +66,8 @@
 static svn_error_t *
 prop_conflict_from_skel(const svn_string_t **conflict_desc,
                         const svn_skel_t *skel,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 
@@ -76,13 +78,16 @@ prop_conflict_from_skel(const svn_string
 static svn_error_t *
 append_prop_conflict(svn_stream_t *stream,
                      const svn_skel_t *prop_skel,
+                     svn_cancel_func_t cancel_func,
+                     void *cancel_baton,
                      apr_pool_t *pool)
 {
   /* TODO:  someday, perhaps prefix each conflict_description with a
      timestamp or something? */
   const svn_string_t *conflict_desc;
 
-  SVN_ERR(prop_conflict_from_skel(&conflict_desc, prop_skel, pool, pool));
+  SVN_ERR(prop_conflict_from_skel(&conflict_desc, prop_skel,
+                                  cancel_func, cancel_baton, pool, pool));
 
   return svn_stream_puts(stream, conflict_desc->data);
 }
@@ -544,6 +549,8 @@ maybe_prop_value(const svn_skel_t *skel,
 static svn_error_t *
 prop_conflict_from_skel(const svn_string_t **conflict_desc,
                         const svn_skel_t *skel,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
@@ -653,13 +660,15 @@ prop_conflict_from_skel(const svn_string
           style = svn_diff_conflict_display_modified_original_latest;
           stream = svn_stream_from_stringbuf(buf, scratch_pool);
           SVN_ERR(svn_stream_skip(stream, buf->len));
-          SVN_ERR(svn_diff_mem_string_output_merge2(stream, diff,
+          SVN_ERR(svn_diff_mem_string_output_merge3(stream, diff,
                                                     incoming_base_ascii,
                                                     mine_ascii,
                                                     incoming_ascii,
                                                     incoming_base_marker, mine_marker,
                                                     incoming_marker, separator,
-                                                    style, scratch_pool));
+                                                    style,
+                                                    cancel_func, cancel_baton,
+                                                    scratch_pool));
           SVN_ERR(svn_stream_close(stream));
 
           *conflict_desc = svn_string_create_from_buf(buf, result_pool);
@@ -702,6 +711,8 @@ svn_wc__create_prejfile(const char **tmp
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
@@ -723,7 +734,8 @@ svn_wc__create_prejfile(const char **tmp
     {
       svn_pool_clear(iterpool);
 
-      SVN_ERR(append_prop_conflict(stream, scan, iterpool));
+      SVN_ERR(append_prop_conflict(stream, scan, cancel_func, cancel_baton,
+                                   iterpool));
     }
 
   SVN_ERR(svn_stream_close(stream));

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Mon Aug 18 13:18:30 2014
@@ -144,6 +144,8 @@ svn_wc__create_prejfile(const char **tmp
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1618599&r1=1618598&r2=1618599&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Mon Aug 18 13:18:30 2014
@@ -1124,6 +1124,7 @@ run_prej_install(work_item_baton_t *wqb,
   SVN_ERR(svn_wc__create_prejfile(&tmp_prejfile_abspath,
                                   db, local_abspath,
                                   prop_conflict_skel,
+                                  cancel_func, cancel_baton,
                                   scratch_pool, scratch_pool));
 
   /* ... and atomically move it into place.  */



Mime
View raw message