subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r882209 - in /subversion/trunk/subversion: libsvn_client/add.c libsvn_wc/lock.c
Date Thu, 19 Nov 2009 17:25:48 GMT
Author: hwright
Date: Thu Nov 19 17:25:48 2009
New Revision: 882209

URL: http://svn.apache.org/viewvc?rev=882209&view=rev
Log:
When acquiring and releasing wc write locks, use the parent path for unknown
kinds in the working copy.  Update 'add --parents' to ensure we release working
copy locks on error.

* subversion/libsvn_wc/lock.c
  (svn_wc__acquire_write_lock, svn_wc__release_write_lock): Look at the parent
    path if the kind is anything but a directory, rather than only for files.
 
* subversion/libsvn_client/add.c
  (svn_client_add4): Make sure we release the lock if we encounter an error
    while adding parents.

Modified:
    subversion/trunk/subversion/libsvn_client/add.c
    subversion/trunk/subversion/libsvn_wc/lock.c

Modified: subversion/trunk/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/add.c?rev=882209&r1=882208&r2=882209&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/add.c (original)
+++ subversion/trunk/subversion/libsvn_client/add.c Thu Nov 19 17:25:48 2009
@@ -602,7 +602,17 @@
       apr_pool_t *subpool;
 
       subpool = svn_pool_create(pool);
-      SVN_ERR(add_parent_dirs(ctx, parent_abspath, subpool));
+      err = add_parent_dirs(ctx, parent_abspath, subpool);
+
+      /* We need to be sure we release our working copy locks if we bump
+         into a situation where we couldn't add the parents. */
+      if (err)
+        return svn_error_return(
+                    svn_error_compose_create(
+                      err,
+                      svn_wc__release_write_lock(ctx->wc_ctx, parent_abspath,
+                                                 pool)));
+
       svn_pool_destroy(subpool);
     }
 

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=882209&r1=882208&r2=882209&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Thu Nov 19 17:25:48 2009
@@ -1757,7 +1757,7 @@
 
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, TRUE,
                                scratch_pool));
-  if (kind == svn_wc__db_kind_file)
+  if (kind != svn_wc__db_kind_dir)
     local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   /* The current lock paradigm is that each directory holds a lock for itself,
@@ -1804,7 +1804,7 @@
 
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, TRUE,
                                scratch_pool));
-  if (kind == svn_wc__db_kind_file)
+  if (kind != svn_wc__db_kind_dir)
     local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   /* We need to recursively remove locks (see comment in



Mime
View raw message