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

Re: svn commit: r1577280 [1/3] - in /subversion/trunk: ./ notes/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subversion/libsvn_r...

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 26 Mar 2014 13:00:36 +0000 (GMT)

Hi Philip...

> URL: http://svn.apache.org/r1577280
> Log:
> Merge the fsfs-lock-many branch to trunk.  [...]

> * subversion/include/svn_fs.h
>   (svn_fs_lock_target_t, svn_fs_lock_result_t,
>    svn_fs_lock2, svn_fs_unlock2): new.
>
> * subversion/include/svn_repos.h
>   (svn_repos_fs_lock2, svn_repos_fs_unlock2): new.

Do we intend to deprecate the old versions? If not, then it would be better to name the new functions something like ...lock_many() instead of ...lock2().

And...

> Modified: subversion/trunk/subversion/include/svn_repos.h
> ==============================================================================
> -/** Like svn_fs_lock(), but invoke the @a repos's pre- and
> +/** Like svn_fs_lock2(), but invoke the @a repos's pre- and
>   * post-lock hooks before and after the locking action.  Use @a pool
>   * for any necessary allocations.
>   *
> - * If the pre-lock hook or svn_fs_lock() fails, throw the original
> - * error to caller.  If an error occurs when running the post-lock
> - * hook, return the original error wrapped with
> + * The pre-lock is run for every path in @a targets. Those entries in
> + * @a targets for which the pre-lock is successful are passed to
> + * svn_fs_lock2 and the post-lock is run for those that are
> + * successfully locked.
> + *
> + * @a results contains the result of running the pre-lock and
> + * svn_fs_lock2 if the pre-lock was successful.  If an error occurs
> + * when running the post-lock hook the error is returned wrapped with
>   * SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED.  If the caller sees this
> - * error, it knows that the lock succeeded anyway.
> + * error, it knows that the some locks succeeded.  In all cases the
> + * caller must handle all errors in @a results to avoid leaks.
>   *
>   * The pre-lock hook may cause a different token to be used for the
>   * lock, instead of @a token; see the pre-lock-hook documentation for
>   * more.
>   *
> + * @since New in 1.9.
> + */
> +svn_error_t *
> +svn_repos_fs_lock2(apr_hash_t **results,
> +                   svn_repos_t *repos,
> +                   apr_hash_t *targets,
> +                   const char *comment,
> +                   svn_boolean_t is_dav_comment,
> +                   apr_time_t expiration_date,
> +                   svn_boolean_t steal_lock,
> +                   apr_pool_t *result_pool,
> +                   apr_pool_t *scratch_pool);
> +
> +/** Similar to svn_repos_fs_lock2() but locks only a single path.
> + *
>   * @since New in 1.2.
>   */
> svn_error_t *
> @@ -2226,6 +2247,14 @@ svn_repos_fs_lock(svn_lock_t **lock,
>   * @since New in 1.2.
>   */

The doc strings for the old and new unlock functions need updating here.

> svn_error_t *
> +svn_repos_fs_unlock2(apr_hash_t **results,
> +                     svn_repos_t *repos,
> +                     apr_hash_t *targets,
> +                     svn_boolean_t break_lock,
> +                     apr_pool_t *result_pool,
> +                     apr_pool_t *scratch_pool);
> +
> +svn_error_t *
> svn_repos_fs_unlock(svn_repos_t *repos,
>                      const char *path,
>                      const char *token,
Received on 2014-03-26 14:01:15 CET

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