On the 1.6.x-issue3700 branch:

Prevent svn_wc_process_committed_queue() from trying to lock working copy
paths which are beyond the depth of the commit operation.
Fixes the working copy corruption bug tracked by issue #3700.

* subversion/libsvn_client/commit.c
  (post_commit_baton): Remember the commit depth here.
  (post_process_commit_item): Do not tell svn_wc_queue_committed2 to recurse
   if doing so will exceed the depth of the commit operation.
  (svn_client_commit4): Store depth of the commit in the post_commit_baton.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.6.x-issue3700@991973 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/libsvn_client/commit.c b/subversion/libsvn_client/commit.c
index a6adebf..ff2eef8 100644
--- a/subversion/libsvn_client/commit.c
+++ b/subversion/libsvn_client/commit.c
@@ -1140,6 +1140,7 @@
   svn_boolean_t keep_changelists;
   svn_boolean_t keep_locks;
   apr_hash_t *checksums;
+  svn_depth_t depth;
 };
 
 static svn_error_t *
@@ -1183,7 +1184,8 @@
 
   if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
       && (item->kind == svn_node_dir)
-      && (item->copyfrom_url))
+      && (item->copyfrom_url)
+      && btn->depth >= svn_depth_immediates)
     loop_recurse = TRUE;
 
   remove_lock = (! btn->keep_locks && (item->state_flags
@@ -1683,6 +1685,7 @@
       btn.keep_changelists = keep_changelists;
       btn.keep_locks = keep_locks;
       btn.checksums = checksums;
+      btn.depth = depth;
 
       /* Make a note that our commit is finished. */
       commit_in_progress = FALSE;