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 2011/05/04 23:49:08 UTC

svn commit: r1099616 - /subversion/trunk/subversion/svn/commit-cmd.c

Author: rhuijben
Date: Wed May  4 21:49:08 2011
New Revision: 1099616

URL: http://svn.apache.org/viewvc?rev=1099616&view=rev
Log:
Following up on r1099429, revert r1079563 "Warn about committing copied
directory at depth 'empty'" and r1002094 " In an attempt to prevent
surprises due to issue #3699"

We don't have to warn for this problem any more, because we can now
commit the copy without changing its descendants.

* subversion/svn/commit-cmd.c
  (copy_warning_notify_baton): Remove struct.
  (copy_warning_notify_func): Remove function.
  (svn_cl__commit): Update caller.

Modified:
    subversion/trunk/subversion/svn/commit-cmd.c

Modified: subversion/trunk/subversion/svn/commit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/commit-cmd.c?rev=1099616&r1=1099615&r2=1099616&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/commit-cmd.c (original)
+++ subversion/trunk/subversion/svn/commit-cmd.c Wed May  4 21:49:08 2011
@@ -41,60 +41,6 @@
 
 #include "svn_private_config.h"
 
-
-
-/* Wrapper notify_func2 function and baton for warning about
-   reduced-depth commits of copied directories.  */
-struct copy_warning_notify_baton
-{
-  svn_wc_notify_func2_t wrapped_func;
-  void *wrapped_baton;
-  svn_depth_t depth;
-  svn_boolean_t warned;
-};
-
-static void
-copy_warning_notify_func(void *baton,
-                         const svn_wc_notify_t *notify,
-                         apr_pool_t *pool)
-{
-  struct copy_warning_notify_baton *b = baton;
-
-  /* Call the wrapped notification system (if any). */
-  if (b->wrapped_func)
-    b->wrapped_func(b->wrapped_baton, notify, pool);
-
-  /* If we're being notified about a copy of a directory when our
-     commit depth is less-than-infinite, and we've not already warned
-     about this situation, then warn about it (and remember that we
-     now have.)  */
-  if ((! b->warned)
-      && (b->depth < svn_depth_infinity)
-      && (notify->kind == svn_node_dir)
-      && ((notify->action == svn_wc_notify_commit_copied) ||
-          (notify->action == svn_wc_notify_commit_copied_replaced)))
-    {
-      svn_error_t *err;
-      err = svn_cmdline_printf(pool,
-                               _("svn: warning: The depth of this commit "
-                                 "is '%s', but copied directories will "
-                                 "regardless be committed with depth '%s'.  "
-                                 "You must remove unwanted children of those "
-                                 "directories in a separate commit.  "
-                                 "(Suppressing additional instances of this "
-                                 "warning.)\n"),
-                               svn_depth_to_word(b->depth),
-                               svn_depth_to_word(svn_depth_infinity));
-      /* ### FIXME: Try to return this error showhow? */
-      svn_error_clear(err);
-
-      /* We'll only warn once. */
-      b->warned = TRUE;
-    }
-}
-
-
-
 
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
@@ -110,7 +56,6 @@ svn_cl__commit(apr_getopt_t *os,
   const char *base_dir;
   svn_config_t *cfg;
   svn_boolean_t no_unlock = FALSE;
-  struct copy_warning_notify_baton cwnb;
   int i;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
@@ -165,20 +110,6 @@ svn_cl__commit(apr_getopt_t *os,
                                      opt_state, base_dir,
                                      ctx->config, pool));
 
-  /* Copies are done server-side, and cheaply, which means they're
-     effectively always done with infinite depth.  This is a potential
-     cause of confusion for users trying to commit copied subtrees in
-     part by restricting the commit's depth.  See issues #3699 and #3752. */
-  if (opt_state->depth < svn_depth_infinity)
-    {
-      cwnb.wrapped_func = ctx->notify_func2;
-      cwnb.wrapped_baton = ctx->notify_baton2;
-      cwnb.depth = opt_state->depth;
-      cwnb.warned = FALSE;
-      ctx->notify_func2 = copy_warning_notify_func;
-      ctx->notify_baton2 = &cwnb;
-    }
-
   /* Commit. */
   err = svn_client_commit5(targets,
                            opt_state->depth,



Re: svn commit: r1099616 - /subversion/trunk/subversion/svn/commit-cmd.c

Posted by Stefan Sperling <st...@elego.de>.
On Wed, May 04, 2011 at 09:49:08PM -0000, rhuijben@apache.org wrote:
> Author: rhuijben
> Date: Wed May  4 21:49:08 2011
> New Revision: 1099616
> 
> URL: http://svn.apache.org/viewvc?rev=1099616&view=rev
> Log:
> Following up on r1099429, revert r1079563 "Warn about committing copied
> directory at depth 'empty'" and r1002094 " In an attempt to prevent
> surprises due to issue #3699"
> 
> We don't have to warn for this problem any more, because we can now
> commit the copy without changing its descendants.

Bert, I think you misunderstood what this warning was about.

In my testing, a copied tree is still coped recursively on the server
side with a --depth=empty commit. The warning is there to avoid the
misunderstanding that only the parent node of the copied tree will show
up in the repository with its children pruned from the copy.
However a copy is always made with depth=infinity.

You've fixed a different problem, where *additional* changes made within
the copied tree remain in the working copy. But that's not what the
warning is trying to address.

I think this change should be reverted.