Ben Reser <b...@reser.org> writes: > Index: subversion/libsvn_client/locking_commands.c > =================================================================== > --- subversion/libsvn_client/locking_commands.c (revision 1579078) > +++ subversion/libsvn_client/locking_commands.c (working copy) > @@ -294,6 +294,12 @@ organize_lock_targets(const char **common_parent_u > _("No common parent found, unable to operate > " > "on disjoint arguments")); > > + /* Make sure the working copy is writable before modifying the > + * repository otherwise we'll have a lock token with no place to put it > + * or won't be able to remove the local lock token. */ > + SVN_ERR(svn_wc__acquire_write_lock(NULL, wc_ctx, common_dirent, FALSE, > + result_pool, scratch_pool)); > + > /* Get the URL for each target (which also serves to verify that > the dirent targets are sane). */ > target_urls = apr_array_make(scratch_pool, rel_targets->nelts, > @@ -504,6 +510,9 @@ svn_client_lock(const apr_array_header_t *targets, > SVN_ERR(svn_ra_lock(ra_session, path_revs, comment, > steal_lock, store_locks_callback, &cb, pool)); > > + if (base_dir) > + SVN_ERR(svn_wc__release_write_lock(ctx->wc_ctx, base_dir, pool)); > + > return SVN_NO_ERROR; > } > > @@ -549,6 +558,9 @@ svn_client_unlock(const apr_array_header_t *target > SVN_ERR(svn_ra_unlock(ra_session, path_tokens, break_lock, > store_locks_callback, &cb, pool)); > > + if (base_dir) > + SVN_ERR(svn_wc__release_write_lock(ctx->wc_ctx, base_dir, pool)); > + > return SVN_NO_ERROR; > } >
Is that is going to leave locks behind if an error occurs? We have svn_wc__call_with_write_lock and SVN_WC__CALL_WITH_WRITE_LOCK that might avoid that problem. However multiple working copy support, something 1.6 didn't have, makes it all more tricky. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*