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

Re: Checking that we have a write lock, in libsvn_wc

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 15 Nov 2012 22:35:47 +0000 (GMT)

I (Julian Foad) wrote:

> I noticed that svn_wc_copy3() and svn_wc__move2() didn't check that they
> have been called with the write lock(s) required by their doc strings.  Some
> other WC functions do -- e.g. svn_wc_delete4() for example.
>
> So I added corresponding checks in svn_wc_copy3() and svn_wc__move2(), and fixed
> the ensuing test failures where we weren't acquiring a lock, in r1410044. 
> Something like:
>
>   SVN_ERR(svn_wc__write_check(db, parent_path, pool));
>
> Then I noticed there are still more WC APIs that say they require a lock but
> don't check.  For example, svn_wc__internal_remove_from_revision_control(). 
> And this one has a "real" caller that's broken:
> svn_client_copy6().

(Oops, svn_client_copy6() isn't broken, I noticed a failure because I implemented the test wrongly.  svn_wc_remove_from_revision_control2()'s doc string just said "must hold a write lock" and I checked for a lock on the parent, but in fact it should check for a lock on LOCAL_ABSPATH itself if it's a WC root, else on the parent.)

> Can we do something more rigorous to ensure that we check for having a write
> lock in the functions where it is logically required?  Any ideas?

This question still holds.

- Julian
Received on 2012-11-15 23:36:23 CET

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.