You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/03/27 21:25:42 UTC

svn commit: r1582460 - in /subversion/trunk/subversion/svn: cl.h conflict-callbacks.c file-merge.c

Author: rhuijben
Date: Thu Mar 27 20:25:42 2014
New Revision: 1582460

URL: http://svn.apache.org/r1582460
Log:
Implement cancellation in a bit of libsvn_client diff/merge handling to avoid
using deprecated functions... and to allow cancelling.

* subversion/svn/cl.h
  (svn_cl__merge_file): Add cancel arguments and move single output argument
    to the start of the argument list.

* subversion/svn/conflict-callbacks.c
  (show_diff): Add cancel arguments. Update caller.
  (handle_text_conflict): Update caller.

* subversion/svn/file-merge.c
  (svn_cl__merge_file): Add cancel arguments. Move output argument.
    Update caller.

Modified:
    subversion/trunk/subversion/svn/cl.h
    subversion/trunk/subversion/svn/conflict-callbacks.c
    subversion/trunk/subversion/svn/file-merge.c

Modified: subversion/trunk/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/cl.h?rev=1582460&r1=1582459&r2=1582460&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/cl.h (original)
+++ subversion/trunk/subversion/svn/cl.h Thu Mar 27 20:25:42 2014
@@ -534,7 +534,8 @@ svn_cl__merge_file_externally(const char
 /* Like svn_cl__merge_file_externally, but using a built-in merge tool
  * with help from an external editor specified by EDITOR_CMD. */
 svn_error_t *
-svn_cl__merge_file(const char *base_path,
+svn_cl__merge_file(svn_boolean_t *remains_in_conflict,
+                   const char *base_path,
                    const char *their_path,
                    const char *my_path,
                    const char *merged_path,
@@ -542,7 +543,8 @@ svn_cl__merge_file(const char *base_path
                    const char *path_prefix,
                    const char *editor_cmd,
                    apr_hash_t *config,
-                   svn_boolean_t *remains_in_conflict,
+                   svn_cancel_func_t cancel_func,
+                   void *cancel_baton,
                    apr_pool_t *scratch_pool);
 
 

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1582460&r1=1582459&r2=1582460&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Thu Mar 27 20:25:42 2014
@@ -129,6 +129,8 @@ svn_cl__accept_from_word(const char *wor
 static svn_error_t *
 show_diff(const svn_wc_conflict_description2_t *desc,
           const char *path_prefix,
+          svn_cancel_func_t cancel_func,
+          void *cancel_baton,
           apr_pool_t *pool)
 {
   const char *path1, *path2;
@@ -186,11 +188,12 @@ show_diff(const svn_wc_conflict_descript
   SVN_ERR(svn_stream_for_stdout(&output, pool));
   SVN_ERR(svn_diff_file_diff_2(&diff, path1, path2,
                                options, pool));
-  return svn_diff_file_output_unified3(output, diff,
+  return svn_diff_file_output_unified4(output, diff,
                                        path1, path2,
                                        label1, label2,
                                        APR_LOCALE_CHARSET,
                                        NULL, FALSE,
+                                       cancel_func, cancel_baton,
                                        pool);
 }
 
@@ -796,7 +799,9 @@ handle_text_conflict(svn_wc_conflict_res
               continue;
             }
 
-          SVN_ERR(show_diff(desc, b->path_prefix, iterpool));
+          SVN_ERR(show_diff(desc, b->path_prefix,
+                            b->pb->cancel_func, b->pb->cancel_baton,
+                            iterpool));
           knows_something = TRUE;
         }
       else if (strcmp(opt->code, "e") == 0 || strcmp(opt->code, ":-E") == 0)
@@ -850,7 +855,8 @@ handle_text_conflict(svn_wc_conflict_res
                   continue;
                 }
 
-              SVN_ERR(svn_cl__merge_file(desc->base_abspath,
+              SVN_ERR(svn_cl__merge_file(&remains_in_conflict,
+                                         desc->base_abspath,
                                          desc->their_abspath,
                                          desc->my_abspath,
                                          desc->merged_file,
@@ -858,7 +864,8 @@ handle_text_conflict(svn_wc_conflict_res
                                          b->path_prefix,
                                          b->editor_cmd,
                                          b->config,
-                                         &remains_in_conflict,
+                                         b->pb->cancel_func,
+                                         b->pb->cancel_baton,
                                          iterpool));
             }
           else

Modified: subversion/trunk/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/file-merge.c?rev=1582460&r1=1582459&r2=1582460&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/file-merge.c (original)
+++ subversion/trunk/subversion/svn/file-merge.c Thu Mar 27 20:25:42 2014
@@ -853,7 +853,8 @@ static svn_diff_output_fns_t file_merge_
 };
 
 svn_error_t *
-svn_cl__merge_file(const char *base_path,
+svn_cl__merge_file(svn_boolean_t *remains_in_conflict,
+                   const char *base_path,
                    const char *their_path,
                    const char *my_path,
                    const char *merged_path,
@@ -861,7 +862,8 @@ svn_cl__merge_file(const char *base_path
                    const char *path_prefix,
                    const char *editor_cmd,
                    apr_hash_t *config,
-                   svn_boolean_t *remains_in_conflict,
+                   svn_cancel_func_t cancel_func,
+                   void *cancel_baton,
                    apr_pool_t *scratch_pool)
 {
   svn_diff_t *diff;
@@ -918,7 +920,8 @@ svn_cl__merge_file(const char *base_path
   fmb.abort_merge = FALSE;
   fmb.scratch_pool = scratch_pool;
 
-  SVN_ERR(svn_diff_output(diff, &fmb, &file_merge_diff_output_fns));
+  SVN_ERR(svn_diff_output2(diff, &fmb, &file_merge_diff_output_fns,
+                           cancel_func, cancel_baton));
 
   SVN_ERR(svn_io_file_close(original_file, scratch_pool));
   SVN_ERR(svn_io_file_close(modified_file, scratch_pool));