[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1100169 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 06 May 2011 12:50:35 +0100

rhuijben_at_apache.org writes:

> 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));

I suppose that is sort of how the checking worked in 1.6, but is it
right for 1.7? Perhaps 1.7 should be checking for the write lock inside
the SQLite transaction?

There is the question about depth as well, a recursive revert needs a
recursive lock.

-- 
Philip
Received on 2011-05-06 13:51:11 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.