You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/07/23 15:12:30 UTC

svn commit: r967086 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

Author: philip
Date: Fri Jul 23 13:12:29 2010
New Revision: 967086

URL: http://svn.apache.org/viewvc?rev=967086&view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): For single-db, only acquire lock on added dir if
   not already locked.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=967086&r1=967085&r2=967086&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Fri Jul 23 13:12:29 2010
@@ -1249,11 +1249,20 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
       SVN_ERR(svn_wc__db_op_add_directory(db, local_abspath, NULL,
                                           scratch_pool));
 #ifdef SVN_WC__SINGLE_DB
-      /* ### Perhaps the lock should be created in the same
-         transaction that adds the node? */
       if (!exists)
-        SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE,
-                                         scratch_pool));
+        {
+          /* If using the legacy 1.6 interface the parent lock may not
+             be recursive and add is expected to lock the new dir.
+
+             ### Perhaps the lock should be created in the same
+             transaction that adds the node? */
+          svn_boolean_t locked;
+          SVN_ERR(svn_wc_locked2(&locked, NULL, wc_ctx, local_abspath,
+                                 scratch_pool));
+          if (!locked)
+            SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE,
+                                             scratch_pool));
+        }
 #endif
     }
   else if (!is_wc_root)