You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/25 01:48:47 UTC

svn commit: r937724 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/deprecated.c libsvn_wc/diff.c libsvn_wc/merge.c libsvn_wc/translate.c libsvn_wc/translate.h libsvn_wc/update_editor.c libsvn_wc/workqueue.c

Author: gstein
Date: Sat Apr 24 23:48:47 2010
New Revision: 937724

URL: http://svn.apache.org/viewvc?rev=937724&view=rev
Log:
Add cancellation to svn_wc__internal_translated_file() and propagate that
to svn_wc_translated_file3(), too.

* subversion/libsvn_wc/translate.h:
  (svn_wc__internal_translated_file): add CANCEL_FUNC/BATON params

* subversion/include/svn_wc.h:
  (svn_wc_translated_file3): add CANCEL_FUNC/BATON params, and note the
    change in the docstring for svn_wc_translated_file2.

* subversion/libsvn_wc/translate.c:
  (svn_wc__inernal_translated_file): add CANCEL_FUNC/BATON params and pass
    them to svn_subst_copy_and_translate4.
  (svn_wc_translated_file3): add CANCEL_FUNC/BATON params and pass them to
    internal_translated_file.

* subversion/libsvn_wc/deprecated.c:
  (svn_wc_translated_file2): pass NULLs for CANCEL_FUNC/BATON

* subversion/libsvn_wc/diff.c:
  (file_diff, report_wc_file_as_added, close_file): pass CANCEL_FUNC/BATON
    to svn_wc__internal_translated_file, from the edit_baton

* subversion/libsvn_wc/merge.c:
  (preserve_pre_merge_files): add CANCEL_FUNC/BATON params and pass them
    to svn_wc__internal_translated_file.
  (maybe_resolve_conflicts): add CANCEL_FUNC/BATON params and pass them to
    preserve_pre_merge_files.
  (merge_text_file): add CANCEL_FUNC/BATON params and pass them to
    maybe_resolve_conflicts
  (svn_wc__internal_merge): pass CANCEL_FUNC/BATON to merge_text_file

* subversion/libsvn_wc/update_editor.c:
  (merge_file): pass CANCEL_FUNC/BATON to svn_wc__internal_translated_file
    from the edit_baton

* subversion/libsvn_wc/workqueue.c:
  (install_committed_file): add CANCEL_FUNC/BATON params and pass them to
    svn_wc__internal_translated_file
  (log_do_committed): add CANCEL_FUNC/BATON params and pass them to
    install_committed_file.
  (run_postcommit): pass CANCEL_FUNC/BATON to log_do_committed

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/deprecated.c
    subversion/trunk/subversion/libsvn_wc/diff.c
    subversion/trunk/subversion/libsvn_wc/merge.c
    subversion/trunk/subversion/libsvn_wc/translate.c
    subversion/trunk/subversion/libsvn_wc/translate.h
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Sat Apr 24 23:48:47 2010
@@ -7020,6 +7020,9 @@ svn_wc_create_tmp_file(apr_file_t **fp,
  * whose newlines and keywords are converted using the translation
  * as requested by @a flags.
  *
+ * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
+ * if the client has cancelled the operation.
+ *
  * When translating to the normal form, inconsistent eol styles will be
  * repaired when appropriate for the given setting.  When translating
  * from normal form, no EOL repair is performed (consistency is assumed).
@@ -7050,13 +7053,15 @@ svn_wc_translated_file3(const char **xla
                         svn_wc_context_t *wc_ctx,
                         const char *versioned_abspath,
                         apr_uint32_t flags,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 
 
 /** Similar to svn_wc_translated_file3(), but with an adm_access baton
- * and relative paths instead of a wc_context and absolute paths, and
- * with a single pool.
+ * and relative paths instead of a wc_context and absolute paths, with
+ * a single pool, and no cancellation func/baton.
  *
  * @since New in 1.4.
  * @deprecated Provided for compatibility with the 1.6 API

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Sat Apr 24 23:48:47 2010
@@ -3201,7 +3201,7 @@ svn_wc_translated_file2(const char **xla
                                          pool));
 
   SVN_ERR(svn_wc_translated_file3(xlated_path, src, wc_ctx, versioned_abspath,
-                                  flags, pool, pool));
+                                  flags, NULL, NULL, pool, pool));
   if (! svn_dirent_is_absolute(versioned_file))
     {
       SVN_ERR(svn_io_temp_dir(&tmp_root, pool));

Modified: subversion/trunk/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff.c?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff.c Sat Apr 24 23:48:47 2010
@@ -707,6 +707,7 @@ file_diff(struct dir_baton *db,
       SVN_ERR(svn_wc__internal_translated_file(
               &translated, local_abspath, eb->db, local_abspath,
               SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
+              eb->cancel_func, eb->cancel_baton,
               pool, pool));
 
       SVN_ERR(eb->callbacks->file_added(NULL, NULL, NULL, NULL, path,
@@ -745,6 +746,7 @@ file_diff(struct dir_baton *db,
           SVN_ERR(svn_wc__internal_translated_file(
                     &translated, local_abspath, eb->db, local_abspath,
                     SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
+                    eb->cancel_func, eb->cancel_baton,
                     pool, pool));
         }
 
@@ -1035,6 +1037,7 @@ report_wc_file_as_added(struct dir_baton
   SVN_ERR(svn_wc__internal_translated_file(
            &translated_file, source_file, eb->db, local_abspath,
            SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
+           eb->cancel_func, eb->cancel_baton,
            pool, pool));
 
   SVN_ERR(eb->callbacks->file_added(db->local_abspath,
@@ -1695,6 +1698,7 @@ close_file(void *file_baton,
         SVN_ERR(svn_wc__internal_translated_file(
                  &localfile, fb->local_abspath, eb->db, fb->local_abspath,
                  SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
+                 eb->cancel_func, eb->cancel_baton,
                  pool, pool));
     }
   else

Modified: subversion/trunk/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/merge.c (original)
+++ subversion/trunk/subversion/libsvn_wc/merge.c Sat Apr 24 23:48:47 2010
@@ -596,6 +596,8 @@ preserve_pre_merge_files(svn_wc__db_t *d
                          const char *left_label,
                          const char *right_label,
                          const char *target_label,
+                         svn_cancel_func_t cancel_func,
+                         void *cancel_baton,
                          apr_pool_t *pool)
 {
   const char *left_copy, *right_copy, *target_copy;
@@ -695,6 +697,7 @@ preserve_pre_merge_files(svn_wc__db_t *d
   SVN_ERR(svn_wc__internal_translated_file(
            &detranslated_target_copy, target_abspath, db, target_abspath,
            SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
+           cancel_func, cancel_baton,
            pool, pool));
   SVN_ERR(svn_wc__loggy_translated_file(db, dir_abspath,
                                         target_copy, detranslated_target_copy,
@@ -765,6 +768,8 @@ maybe_resolve_conflicts(svn_wc__db_t *db
                         svn_diff_file_options_t *options,
                         svn_wc_conflict_resolver_func_t conflict_func,
                         void *conflict_baton,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *pool)
 {
   svn_wc_conflict_result_t *result = NULL;
@@ -839,6 +844,7 @@ maybe_resolve_conflicts(svn_wc__db_t *db
                                    left_label,
                                    right_label,
                                    target_label,
+                                   cancel_func, cancel_baton,
                                    pool));
 
   *merge_outcome = svn_wc_merge_conflict;
@@ -866,6 +872,8 @@ merge_text_file(enum svn_wc_merge_outcom
                 const svn_prop_t *mimeprop,
                 svn_wc_conflict_resolver_func_t conflict_func,
                 void *conflict_baton,
+                svn_cancel_func_t cancel_func,
+                void *cancel_baton,
                 apr_pool_t *pool)
 {
   svn_diff_file_options_t *options;
@@ -938,6 +946,7 @@ merge_text_file(enum svn_wc_merge_outcom
                                       mimeprop,
                                       options,
                                       conflict_func, conflict_baton,
+                                      cancel_func, cancel_baton,
                                       pool));
 
       if (*merge_outcome == svn_wc_merge_merged)
@@ -1287,8 +1296,8 @@ svn_wc__internal_merge(enum svn_wc_merge
                             copyfrom_abspath,
                             detranslated_target_abspath,
                             mimeprop,
-                            conflict_func,
-                            conflict_baton,
+                            conflict_func, conflict_baton,
+                            cancel_func, cancel_baton,
                             pool));
 
   /* Merging is complete.  Regardless of text or binariness, we might

Modified: subversion/trunk/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.c?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Sat Apr 24 23:48:47 2010
@@ -176,6 +176,8 @@ svn_wc__internal_translated_file(const c
                                  svn_wc__db_t *db,
                                  const char *versioned_abspath,
                                  apr_uint32_t flags,
+                                 svn_cancel_func_t cancel_func,
+                                 void *cancel_baton,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool)
 {
@@ -247,7 +249,7 @@ svn_wc__internal_translated_file(const c
                                             keywords,
                                             expand,
                                             special,
-                                            NULL, NULL,  /* ### cancel  */
+                                            cancel_func, cancel_baton,
                                             result_pool));
 
       xlated_path = tmp_vfile;
@@ -263,12 +265,15 @@ svn_wc_translated_file3(const char **xla
                         svn_wc_context_t *wc_ctx,
                         const char *versioned_abspath,
                         apr_uint32_t flags,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
   return svn_wc__internal_translated_file(xlated_abspath, src, wc_ctx->db,
                                           versioned_abspath, flags,
-                                          result_pool,scratch_pool);
+                                          cancel_func, cancel_baton,
+                                          result_pool, scratch_pool);
 }
 
 

Modified: subversion/trunk/subversion/libsvn_wc/translate.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.h?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.h (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.h Sat Apr 24 23:48:47 2010
@@ -142,6 +142,8 @@ svn_wc__internal_translated_file(const c
                                  svn_wc__db_t *db,
                                  const char *versioned_abspath,
                                  apr_uint32_t flags,
+                                 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/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sat Apr 24 23:48:47 2010
@@ -4582,7 +4582,9 @@ merge_file(svn_boolean_t *install_pristi
              Note that detranslation is done according to the old props. */
           SVN_ERR(svn_wc__internal_translated_file(
                     &tmptext, fb->local_abspath, eb->db, fb->local_abspath,
-                    SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
+                    SVN_WC_TRANSLATE_TO_NF
+                      | SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
+                    eb->cancel_func, eb->cancel_baton,
                     pool, pool));
 
           /* We always want to reinstall the working file if the magic

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=937724&r1=937723&r2=937724&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Sat Apr 24 23:48:47 2010
@@ -1158,6 +1158,8 @@ install_committed_file(svn_boolean_t *ov
                        const char *tmp_text_base_abspath,
                        svn_boolean_t remove_executable,
                        svn_boolean_t remove_read_only,
+                       svn_cancel_func_t cancel_func,
+                       void *cancel_baton,
                        apr_pool_t *scratch_pool)
 {
   svn_boolean_t same, did_set;
@@ -1204,6 +1206,7 @@ install_committed_file(svn_boolean_t *ov
     SVN_ERR(svn_wc__internal_translated_file(&tmp_wfile, tmp, db,
                                              file_abspath,
                                              SVN_WC_TRANSLATE_FROM_NF,
+                                             cancel_func, cancel_baton,
                                              scratch_pool, scratch_pool));
 
     /* If the translation is a no-op, the text base and the working copy
@@ -1300,6 +1303,8 @@ log_do_committed(svn_wc__db_t *db,
                  const svn_checksum_t *new_checksum,
                  apr_hash_t *new_dav_cache,
                  svn_boolean_t keep_changelist,
+                 svn_cancel_func_t cancel_func,
+                 void *cancel_baton,
                  apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
@@ -1454,6 +1459,7 @@ log_do_committed(svn_wc__db_t *db,
       if ((err = install_committed_file(&overwrote_working, db,
                                         local_abspath, tmp_text_base_abspath,
                                         remove_executable, set_read_write,
+                                        cancel_func, cancel_baton,
                                         pool)))
         return svn_error_createf
           (SVN_ERR_WC_BAD_ADM_LOG, err,
@@ -1642,6 +1648,7 @@ run_postcommit(svn_wc__db_t *db,
                            new_revision, new_date,
                            new_author, new_checksum, new_dav_cache,
                            keep_changelist,
+                           cancel_func, cancel_baton,
                            scratch_pool));
 
   return SVN_NO_ERROR;