Author: rhuijben
Date: Fri May  6 11:21:15 2011
New Revision: 1100169

URL: http://svn.apache.org/viewvc?rev=1100169&view=rev
Log:
Following up on r1100163, add a write lock check to the revert handling.

* subversion/libsvn_wc/adm_ops.c
  (new_revert_internal): Expect a write lock on the directory containing
    this node, which might be the directory itself for the wcroot.

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=1100169&r1=1100168&r2=1100169&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Fri May  6 11:21:15 2011
@@ -1590,6 +1590,20 @@ new_revert_internal(svn_wc__db_t *db,
 {
   SVN_ERR_ASSERT(depth == svn_depth_empty || depth == svn_depth_infinity);
 
+  /* We should have a write lock on the parent of local_abspath, except
+     when local_abspath is the working copy root. */
+  {
+    const char *dir_abspath;
+
+    SVN_ERR(svn_wc__db_get_wcroot(&dir_abspath, db, local_abspath,
+                                  scratch_pool, scratch_pool));
+
+    if (svn_dirent_is_child(dir_abspath, local_abspath, NULL))
+      dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+
+    SVN_ERR(svn_wc__write_check(db, dir_abspath, scratch_pool));
+  }
+
   SVN_ERR(svn_wc__db_op_revert(db, local_abspath, depth,
                                scratch_pool, scratch_pool));
 


Reply via email to