On Thu, Nov 19, 2009 at 9:25 AM,  <hwri...@apache.org> wrote:
> 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
>
>
>


Hi Hyrum,

This commit started the Ruby bindings failing.  I think I can
reproduce with the command line (edited transcript):

$svnadmin create repo

$md wc

$svn co file:///repo wc
Checked out revision 0.

$svn mkdir --parents wc\parent\child
A         wc\parent
A         wc\parent\child

$svn ci wc -m"XX"
svn: Working copy 'wc' locked
svn: constraint failed
svn: columns wc_id, local_dir_relpath are not unique
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)



That is the same error that the bindings are getting, and it seems
like something that ought to work.  Please let me know if I'm
mistaken.

Thanks
--
Joe

Reply via email to