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

Re: svn commit: r1050216 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/util.c svnrdump/load_editor.c svnsync/main.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 18 Dec 2010 23:29:40 +0200

cmpilato_at_apache.org wrote on Thu, Dec 16, 2010 at 23:10:10 -0000:
> Author: cmpilato
> Date: Thu Dec 16 23:10:10 2010
> New Revision: 1050216
>
> URL: http://svn.apache.org/viewvc?rev=1050216&view=rev
> Log:
> Finish issue #3766 ("Unify svnsync and svnrdump repos-locking logic").
>
> * subversion/include/private/svn_ra_private.h
> (svn_ra__lock_retry_func_t): New callback type.
> (svn_ra__get_operational_lock, svn_ra__release_operational_lock):
> New semi-private functions.
>
> * subversion/libsvn_ra/util.c
> (is_atomicity_error): Moved here from svnsync/main.c.
> (svn_ra__release_operational_lock): New, abstracted from
> svnsync/main.c:maybe_unlock().
> (svn_ra__get_operational_lock): New, abstracted from
> svnsync/main.c:get_lock().
>

Not exactly the same as svnsync's versions, since you added the
'stolen_lock_p' parameter. (and the log message doesn't mention that)

> +svn_error_t *
> +svn_ra__release_operational_lock(svn_ra_session_t *session,
> + const char *lock_revprop_name,
> + const svn_string_t *mylocktoken,
> + apr_pool_t *scratch_pool)
> +{
> + svn_string_t *reposlocktoken;
> + svn_boolean_t be_atomic;
> +
> + SVN_ERR(svn_ra_has_capability(session, &be_atomic,
> + SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
> + scratch_pool));
> + SVN_ERR(svn_ra_rev_prop(session, 0, lock_revprop_name,
> + &reposlocktoken, scratch_pool));
> + if (reposlocktoken && svn_string_compare(reposlocktoken, mylocktoken))
> + {
> + svn_error_t *err;
> +
> + err = svn_ra_change_rev_prop2(session, 0, lock_revprop_name,
> + be_atomic ? &mylocktoken : NULL, NULL,
> + scratch_pool);
> + if (is_atomicity_error(err))
> + return svn_error_quick_wrap(err,
> + _("Lock was stolen; unable to remove it"));

s/was stolen/was stolen by '%s'/ ?

> + }
> +
> + return SVN_NO_ERROR;
> +}
> +
> +svn_error_t *
> +svn_ra__get_operational_lock(const svn_string_t **lock_string_p,
> + const svn_string_t **stolen_lock_p,
> + svn_ra_session_t *session,
> + const char *lock_revprop_name,
> + svn_boolean_t steal_lock,
> + int num_retries,
> + svn_ra__lock_retry_func_t retry_func,
> + void *retry_baton,
> + svn_cancel_func_t cancel_func,
> + void *cancel_baton,
> + apr_pool_t *pool)
> +{
...
> +}

+1
Received on 2010-12-18 22:32:35 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.