subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1563361 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/add.c libsvn_client/copy_foreign.c libsvn_client/merge.c libsvn_client/patch.c libsvn_wc/adm_ops.c libsvn_wc/deprecated.c tests/libsvn_wc/utils.c
Date Sat, 01 Feb 2014 01:25:15 GMT
Author: breser
Date: Sat Feb  1 01:25:15 2014
New Revision: 1563361

URL: http://svn.apache.org/r1563361
Log:
Don't canonicalize properties when doing a foreign copy.

Presumably if you're doing a foreign property you don't have control over the
remote repo and you need to pull in whatever it has so as to be useful.

* subversion/include/svn_wc.h
  (svn_wc_add_from_disk2): deprecate in favor of ...
  (svn_wc_add_from_disk3): which lets you skip property canonicalization

* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add_from_disk2): Replace with ...
  (svn_wc_add_from_disk3): new version of function with skip_checks arg.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_add_from_disk2): Deprecated function moved here.

* subversion/libsvn_client/copy_foreign.c
  (ensure_added, file_close, svn_client__copy_foreign): Update
    svn_wc_add_from_disk2() call to svn_wc_add_from_disk3() with TRUE
    for skip_checks arg
  (dir_change_prop, file_change_prop): Update comments to match new function

* subversion/libsvn_client/add.c
  (add_file, add_dir_recursive, add): Update svn_wc_add_from_disk2() call to
    svn_wc_add_from_disk3() with FALSE for the skip_checks arg
* subversion/libsvn/client/merge.c
  (merge_dir_opened): ...
* subversion/libsvn/client/patch.c
  (create_missing_parents, install_patched_target,
   install_patched_prop_targets): ...
* subversion/tests/libsvn_wc/utils.c
  (sbox_wc_add): ...

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/add.c
    subversion/trunk/subversion/libsvn_client/copy_foreign.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/deprecated.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Sat Feb  1 01:25:15 2014
@@ -4730,10 +4730,9 @@ svn_wc_delete(const char *path,
  * addition to the working copy.  The added node will have the properties
  * provided in @a props, or none if that is NULL.
  *
- * Check and canonicalize the properties in the same way as
- * svn_wc_prop_set4().  Return an error and don't add the node if the
- * properties are not valid on this node.  Unlike svn_wc_prop_set4()
- * there is no option to skip some of the checks and canonicalizations.
+ * Unless @a skip_checks is TRUE, check and canonicalize the properties in the
+ * same way as svn_wc_prop_set4().  Return an error and don't add the node if
+ * the properties are not valid on this node.
  *
  * ### The error code on validity check failure should be specified, and
  *     preferably should be a single code.
@@ -4747,8 +4746,25 @@ svn_wc_delete(const char *path,
  *
  * ### TODO: Split into add_dir, add_file, add_symlink?
  *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_wc_add_from_disk3(svn_wc_context_t *wc_ctx,
+                      const char *local_abspath,
+                      const apr_hash_t *props,
+                      svn_boolean_t skip_checks,
+                      svn_wc_notify_func2_t notify_func,
+                      void *notify_baton,
+                      apr_pool_t *scratch_pool);
+
+/**
+ * Similar to svn_wc_add_from_disk3(), but always passes FALSE for
+ * @a skip_som_prop_canon
+ *
  * @since New in 1.8.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
                       const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/add.c?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/add.c (original)
+++ subversion/trunk/subversion/libsvn_client/add.c Sat Feb  1 01:25:15 2014
@@ -316,7 +316,8 @@ add_file(const char *local_abspath,
     }
 
   /* Add the file */
-  SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, local_abspath, properties,
+  SVN_ERR(svn_wc_add_from_disk3(ctx->wc_ctx, local_abspath, properties,
+                                FALSE /* skip checks */,
                                 ctx->notify_func2, ctx->notify_baton2, pool));
 
   return SVN_NO_ERROR;
@@ -378,7 +379,8 @@ add_dir_recursive(const char *dir_abspat
   iterpool = svn_pool_create(scratch_pool);
 
   /* Add this directory to revision control. */
-  err = svn_wc_add_from_disk2(ctx->wc_ctx, dir_abspath, NULL /*props*/,
+  err = svn_wc_add_from_disk3(ctx->wc_ctx, dir_abspath, NULL /*props*/,
+                              FALSE /* skip checks */,
                               ctx->notify_func2, ctx->notify_baton2,
                               iterpool);
   if (err)
@@ -873,8 +875,9 @@ add(const char *local_abspath,
                                      parent_abspath, local_abspath);
 
           SVN_ERR(svn_io_make_dir_recursively(parent_abspath, scratch_pool));
-          SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, parent_abspath,
+          SVN_ERR(svn_wc_add_from_disk3(ctx->wc_ctx, parent_abspath,
                                         NULL /*props*/,
+                                        FALSE /* skip checks */,
                                         ctx->notify_func2, ctx->notify_baton2,
                                         scratch_pool));
         }

Modified: subversion/trunk/subversion/libsvn_client/copy_foreign.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy_foreign.c?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy_foreign.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy_foreign.c Sat Feb  1 01:25:15 2014
@@ -161,7 +161,7 @@ dir_change_prop(void *dir_baton,
   if (! db->created)
     {
       /* We can still store them in the hash for immediate addition
-         with the svn_wc_add_from_disk2() call */
+         with the svn_wc_add_from_disk3() call */
       if (! db->properties)
         db->properties = apr_hash_make(db->pool);
 
@@ -214,9 +214,10 @@ ensure_added(struct dir_baton_t *db,
   db->created = TRUE;
 
   /* Add the directory with all the already collected properties */
-  SVN_ERR(svn_wc_add_from_disk2(db->eb->wc_ctx,
+  SVN_ERR(svn_wc_add_from_disk3(db->eb->wc_ctx,
                                 db->local_abspath,
                                 db->properties,
+                                TRUE /* skip checks */,
                                 db->eb->notify_func,
                                 db->eb->notify_baton,
                                 scratch_pool));
@@ -307,7 +308,7 @@ file_change_prop(void *file_baton,
     }
 
   /* We store all properties in the hash for immediate addition
-      with the svn_wc_add_from_disk2() call */
+      with the svn_wc_add_from_disk3() call */
   if (! fb->properties)
     fb->properties = apr_hash_make(fb->pool);
 
@@ -376,7 +377,8 @@ file_close(void *file_baton,
                                                     fb->pool)));
     }
 
-  SVN_ERR(svn_wc_add_from_disk2(eb->wc_ctx, fb->local_abspath, fb->properties,
+  SVN_ERR(svn_wc_add_from_disk3(eb->wc_ctx, fb->local_abspath, fb->properties,
+                                TRUE /* skip checks */,
                                 eb->notify_func, eb->notify_baton,
                                 fb->pool));
 
@@ -539,12 +541,14 @@ svn_client__copy_foreign(const char *url
 
       if (!already_locked)
         SVN_WC__CALL_WITH_WRITE_LOCK(
-              svn_wc_add_from_disk2(ctx->wc_ctx, dst_abspath, props,
+              svn_wc_add_from_disk3(ctx->wc_ctx, dst_abspath, props,
+                                    TRUE /* skip checks */,
                                     ctx->notify_func2, ctx->notify_baton2,
                                     scratch_pool),
               ctx->wc_ctx, dir_abspath, FALSE, scratch_pool);
       else
-        SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, dst_abspath, props,
+        SVN_ERR(svn_wc_add_from_disk3(ctx->wc_ctx, dst_abspath, props,
+                                      TRUE /* skip checks */,
                                       ctx->notify_func2, ctx->notify_baton2,
                                       scratch_pool));
     }

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Sat Feb  1 01:25:15 2014
@@ -2724,7 +2724,7 @@ merge_dir_opened(void **new_dir_baton,
 
           if (old_tc)
             {
-              /* svn_wc_add4 and svn_wc_add_from_disk2 can't add a node
+              /* svn_wc_add4 and svn_wc_add_from_disk3 can't add a node
                  over an existing tree conflict */
 
               /* ### These functions should take some tree conflict argument
@@ -2762,8 +2762,9 @@ merge_dir_opened(void **new_dir_baton,
             }
           else
             {
-              SVN_ERR(svn_wc_add_from_disk2(merge_b->ctx->wc_ctx, local_abspath,
+              SVN_ERR(svn_wc_add_from_disk3(merge_b->ctx->wc_ctx, local_abspath,
                                             apr_hash_make(scratch_pool),
+                                            FALSE /* skip checks */,
                                             NULL, NULL /* no notify! */,
                                             scratch_pool));
             }

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Sat Feb  1 01:25:15 2014
@@ -2455,8 +2455,9 @@ create_missing_parents(patch_target_t *t
               if (ctx->cancel_func)
                 SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
-              SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, local_abspath,
+              SVN_ERR(svn_wc_add_from_disk3(ctx->wc_ctx, local_abspath,
                                             NULL /*props*/,
+                                            FALSE /* skip checks */,
                                             ctx->notify_func2, ctx->notify_baton2,
                                             iterpool));
             }
@@ -2586,8 +2587,9 @@ install_patched_target(patch_target_t *t
                * Suppress notification, we'll do that later (and also
                * during dry-run). Don't allow cancellation because
                * we'd rather notify about what we did before aborting. */
-              SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, target->local_abspath,
+              SVN_ERR(svn_wc_add_from_disk3(ctx->wc_ctx, target->local_abspath,
                                             NULL /*props*/,
+                                            FALSE /* skip checks */,
                                             NULL, NULL, pool));
             }
 
@@ -2679,8 +2681,9 @@ install_patched_prop_targets(patch_targe
             {
               SVN_ERR(svn_io_file_create_empty(target->local_abspath,
                                                scratch_pool));
-              SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, target->local_abspath,
+              SVN_ERR(svn_wc_add_from_disk3(ctx->wc_ctx, target->local_abspath,
                                             NULL /*props*/,
+                                            FALSE /* skip checks */,
                                             /* 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=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Sat Feb  1 01:25:15 2014
@@ -997,9 +997,10 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 
 
 svn_error_t *
-svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
+svn_wc_add_from_disk3(svn_wc_context_t *wc_ctx,
                       const char *local_abspath,
                       const apr_hash_t *props,
+                      svn_boolean_t skip_checks,
                       svn_wc_notify_func2_t notify_func,
                       void *notify_baton,
                       apr_pool_t *scratch_pool)
@@ -1018,7 +1019,7 @@ svn_wc_add_from_disk2(svn_wc_context_t *
 
       SVN_ERR(svn_wc__canonicalize_props(
                 &new_props,
-                local_abspath, kind, props, FALSE /* skip_some_checks */,
+                local_abspath, kind, props, skip_checks,
                 scratch_pool, scratch_pool));
       props = new_props;
     }

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Sat Feb  1 01:25:15 2014
@@ -924,6 +924,19 @@ svn_wc_delete(const char *path,
 }
 
 svn_error_t *
+svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
+                     const char *local_abspath,
+                      const apr_hash_t *props,
+                     svn_wc_notify_func2_t notify_func,
+                     void *notify_baton,
+                     apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_wc_add_from_disk3(wc_ctx, local_abspath, NULL, FALSE,
+                                 notify_func, notify_baton, scratch_pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_wc_add_from_disk(svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
                      svn_wc_notify_func2_t notify_func,

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.c?rev=1563361&r1=1563360&r2=1563361&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.c Sat Feb  1 01:25:15 2014
@@ -172,7 +172,8 @@ sbox_wc_add(svn_test__sandbox_t *b, cons
   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_disk2(b->wc_ctx, path, NULL /*props*/,
+  SVN_ERR(svn_wc_add_from_disk3(b->wc_ctx, path, NULL /*props*/,
+                                FALSE /* skip checks */,
                                 NULL, NULL, b->pool));
   SVN_ERR(svn_wc__release_write_lock(b->wc_ctx, parent_abspath, b->pool));
   return SVN_NO_ERROR;



Mime
View raw message