Checking that we have a write lock, in libsvn_wc
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 15 Nov 2012 22:24:47 +0000 (GMT)
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().
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?
-- Subversion Live 2012 - 2 Days: training, networking, demos & more! http://bit.ly/NgUaRi Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/downloadReceived on 2012-11-15 23:25:21 CET
This is an archived mail posted to the Subversion Dev mailing list.