You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/11/01 18:41:41 UTC

svn commit: r1029760 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/add.c libsvn_client/patch.c libsvn_wc/adm_ops.c tests/libsvn_wc/op-depth-test.c tests/libsvn_wc/pristine-store-test.c

Author: julianfoad
Date: Mon Nov  1 17:41:41 2010
New Revision: 1029760

URL: http://svn.apache.org/viewvc?rev=1029760&view=rev
Log:
Remove cancellation parameters from the new svn_wc_add_from_disk() API.  It
was not yet implemented and since the API only operates on a single node,
not recursively, there is no advantage to checking for cancellation here
rather than in the callers that want it.

* subversion/include/svn_wc.h,
  subversion/libsvn_wc/adm_ops.c
  (svn_wc_add_from_disk): Remove the cancellation callback parameters and
    the TODO note about implementing it.

* subversion/libsvn_client/add.c
  (add_file, add_dir_recursive): Remove cancellation arguments here, since
    cancellation is already checked for at this level.
  (add_parent_dirs): Remove cancellation arguments here, and add an explicit
    cancellation check, since this function is recursive.

* subversion/libsvn_client/patch.c
  (install_patched_target): Remove null cancellation arguments.
  (create_missing_parents, install_patched_prop_targets): Remove
    cancellation arguments here, and add an explicit cancellation check.

* subversion/tests/libsvn_wc/op-depth-test.c
  (wc_add): Remove null cancellation arguments.

* subversion/tests/libsvn_wc/pristine-store-test.c
  (pristine_get_translated): Remove null cancellation arguments.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/add.c
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1029760&r1=1029759&r2=1029760&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Mon Nov  1 17:41:41 2010
@@ -4224,8 +4224,6 @@ svn_wc_delete(const char *path,
  *
  * This is equivalent to svn_wc_add4() case 2a.
  *
- * ### TODO: Cancellation isn't implemented yet.
- *
  * ### TODO: Allow the caller to provide the node's properties?
  *
  * ### TODO: Split into add_dir, add_file, add_symlink?
@@ -4233,8 +4231,6 @@ svn_wc_delete(const char *path,
 svn_error_t *
 svn_wc_add_from_disk(svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
-                     svn_cancel_func_t cancel_func,
-                     void *cancel_baton,
                      svn_wc_notify_func2_t notify_func,
                      void *notify_baton,
                      apr_pool_t *scratch_pool);

Modified: subversion/trunk/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/add.c?rev=1029760&r1=1029759&r2=1029760&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/add.c (original)
+++ subversion/trunk/subversion/libsvn_client/add.c Mon Nov  1 17:41:41 2010
@@ -300,7 +300,6 @@ add_file(const char *local_abspath,
 
   /* Add the file */
   SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, local_abspath,
-                               ctx->cancel_func, ctx->cancel_baton,
                                NULL, NULL, pool));
 
   if (is_special)
@@ -387,7 +386,6 @@ add_dir_recursive(const char *dir_abspat
 
   /* Add this directory to revision control. */
   err = svn_wc_add_from_disk(ctx->wc_ctx, dir_abspath,
-                             ctx->cancel_func, ctx->cancel_baton,
                              ctx->notify_func2, ctx->notify_baton2,
                              iterpool);
   if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)
@@ -548,8 +546,10 @@ add_parent_dirs(svn_client_ctx_t *ctx,
     SVN_ERR(svn_wc__acquire_write_lock(NULL, wc_ctx, parent_abspath, FALSE,
                                        scratch_pool, scratch_pool));
 
+  if (ctx->cancel_func)
+    SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+
   SVN_ERR(svn_wc_add_from_disk(wc_ctx, local_abspath,
-                               ctx->cancel_func, ctx->cancel_baton,
                                ctx->notify_func2, ctx->notify_baton2,
                                scratch_pool));
   /* ### New dir gets added with its own per-directory lock which we

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1029760&r1=1029759&r2=1029760&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Mon Nov  1 17:41:41 2010
@@ -2042,8 +2042,11 @@ create_missing_parents(patch_target_t *t
                * to version control. Allow cancellation since we
                * have not modified the working copy yet for this
                * target. */
+
+              if (ctx->cancel_func)
+                SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+
               SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, local_abspath,
-                                           ctx->cancel_func, ctx->cancel_baton,
                                            ctx->notify_func2, ctx->notify_baton2,
                                            iterpool));
             }
@@ -2123,10 +2126,10 @@ install_patched_target(patch_target_t *t
               /* The target file didn't exist previously,
                * so add it to version control.
                * Suppress notification, we'll do that later (and also
-               * during dry-run). Also suppress cancellation because
+               * during dry-run). Don't allow cancellation because
                * we'd rather notify about what we did before aborting. */
               SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, target->local_abspath,
-                                           NULL, NULL, NULL, NULL, pool));
+                                           NULL, NULL, pool));
             }
 
           /* Restore the target's executable bit if necessary. */
@@ -2247,8 +2250,9 @@ install_patched_prop_targets(patch_targe
             {
               SVN_ERR(svn_io_file_create(target->local_abspath, "",
                                          scratch_pool));
+              if (ctx->cancel_func)
+                SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
               SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, target->local_abspath,
-                                           ctx->cancel_func, ctx->cancel_baton,
                                            /* suppress notification */
                                            NULL, NULL,
                                            iterpool));

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1029760&r1=1029759&r2=1029760&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Nov  1 17:41:41 2010
@@ -1142,8 +1142,6 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 svn_error_t *
 svn_wc_add_from_disk(svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
-                     svn_cancel_func_t cancel_func,
-                     void *cancel_baton,
                      svn_wc_notify_func2_t notify_func,
                      void *notify_baton,
                      apr_pool_t *scratch_pool)

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1029760&r1=1029759&r2=1029760&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Mon Nov  1 17:41:41 2010
@@ -116,8 +116,7 @@ wc_add(wc_baton_t *b, const char *path)
   parent_abspath = svn_dirent_dirname(path, b->pool);
   SVN_ERR(svn_wc__acquire_write_lock(NULL, b->wc_ctx, parent_abspath, FALSE,
                                      b->pool, b->pool));
-  SVN_ERR(svn_wc_add_from_disk(b->wc_ctx, path,
-                               NULL, NULL, NULL, NULL, b->pool));
+  SVN_ERR(svn_wc_add_from_disk(b->wc_ctx, path, NULL, NULL, b->pool));
   SVN_ERR(svn_wc__release_write_lock(b->wc_ctx, parent_abspath, b->pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1029760&r1=1029759&r2=1029760&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c Mon Nov  1 17:41:41 2010
@@ -216,8 +216,7 @@ pristine_get_translated(const svn_test_o
 
     SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, dirname, 0, FALSE, pool));
 
-    SVN_ERR(svn_wc_add_from_disk(wc_ctx, versioned_abspath,
-                                 NULL, NULL, NULL, NULL, pool));
+    SVN_ERR(svn_wc_add_from_disk(wc_ctx, versioned_abspath, NULL, NULL, pool));
     SVN_ERR(svn_wc_prop_set4(wc_ctx, versioned_abspath,
                              "svn:keywords", svn_string_create("Rev", pool),
                              FALSE, NULL, NULL, pool));