You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Glasser <gl...@davidglasser.net> on 2008/06/06 16:32:22 UTC

Re: svn commit: r31605 - in trunk/subversion: include libsvn_repos

Doesn't this require a bump?

Otherwise, I could go to the 'latest version' doxygen, read it, think
"ah, it's legal to pass NULL to svn_repos_get_commit_editor5", and
then write a program that only works if you have 1.6+.

--dave

On Thu, Jun 5, 2008 at 2:49 PM,  <kf...@tigris.org> wrote:
> Author: kfogel
> Date: Thu Jun  5 14:49:04 2008
> New Revision: 31605
>
> Log:
> Improve an API by allowing a callback to be null.
>
> Suggested by: Neels Janosch Hofmeyr <ne...@elego.de>
>
> * subversion/include/svn_repos.h
>  (svn_repos_get_commit_editor5): Document that callback can be null.
>    Also, fix up some obsolete documentation: the modern callback type
>    takes a struct instead of separate parameters.
>
> * subversion/libsvn_repos/commit.c
>  (close_edit): Test callback before calling.
>
> Modified:
>   trunk/subversion/include/svn_repos.h
>   trunk/subversion/libsvn_repos/commit.c
>
> Modified: trunk/subversion/include/svn_repos.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_repos.h?pathrev=31605&r1=31604&r2=31605
> ==============================================================================
> --- trunk/subversion/include/svn_repos.h        Thu Jun  5 14:03:39 2008        (r31604)
> +++ trunk/subversion/include/svn_repos.h        Thu Jun  5 14:49:04 2008        (r31605)
> @@ -938,14 +938,15 @@ svn_repos_replay(svn_fs_root_t *root,
>  * due to authz will return SVN_ERR_AUTHZ_UNREADABLE or
>  * SVN_ERR_AUTHZ_UNWRITABLE.
>  *
> - * Calling @a (*editor)->close_edit completes the commit.  Before
> - * @c close_edit returns, but after the commit has succeeded, it will
> - * invoke @a callback with the new revision number, the commit date (as a
> - * <tt>const char *</tt>), commit author (as a <tt>const char *</tt>), and
> - * @a callback_baton as arguments.  If @a callback returns an error, that
> - * error will be returned from @c close_edit, otherwise if there was a
> - * post-commit hook failure, then that error will be returned and will
> - * have code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
> + * Calling @a (*editor)->close_edit completes the commit.
> + *
> + * If @a callback is non-NULL, then before @c close_edit returns (but
> + * after the commit has succeeded) @c close_edit will invoke
> + * @a callback with a filled-in @c svn_commit_info_t *, @a callback_baton,
> + * and @a pool or some subpool thereof as arguments.  If @a callback
> + * returns an error, that error will be returned from @c close_edit,
> + * otherwise if there was a post-commit hook failure, then that error
> + * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
>  *
>  * Calling @a (*editor)->abort_edit aborts the commit, and will also
>  * abort the commit transaction unless @a txn was supplied (not @c
>
> Modified: trunk/subversion/libsvn_repos/commit.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_repos/commit.c?pathrev=31605&r1=31604&r2=31605
> ==============================================================================
> --- trunk/subversion/libsvn_repos/commit.c      Thu Jun  5 14:03:39 2008        (r31604)
> +++ trunk/subversion/libsvn_repos/commit.c      Thu Jun  5 14:49:04 2008        (r31605)
> @@ -715,7 +715,7 @@ close_edit(void *edit_baton,
>                                     pool);
>       }
>
> -    if (! err)
> +    if ((! err) && eb->commit_callback)
>       {
>         commit_info = svn_create_commit_info(pool);
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>



-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r31605 - in trunk/subversion: include libsvn_repos

Posted by Karl Fogel <kf...@red-bean.com>.
"David Glasser" <gl...@davidglasser.net> writes:
> On Fri, Jun 6, 2008 at 11:25 AM, Karl Fogel <kf...@red-bean.com> wrote:
>> When we loosen an API to accept inputs it formerly didn't accept, should
>> we bump, or just document that "as of 1.6" it accepts the new stuff too?
>> I think the latter would be enough in this case...
>
> Ah, sure, that would be fine too.

r31615


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r31605 - in trunk/subversion: include libsvn_repos

Posted by David Glasser <gl...@davidglasser.net>.
On Fri, Jun 6, 2008 at 11:25 AM, Karl Fogel <kf...@red-bean.com> wrote:
> "David Glasser" <gl...@davidglasser.net> writes:
>> Doesn't this require a bump?
>>
>> Otherwise, I could go to the 'latest version' doxygen, read it, think
>> "ah, it's legal to pass NULL to svn_repos_get_commit_editor5", and
>> then write a program that only works if you have 1.6+.
>
> When we loosen an API to accept inputs it formerly didn't accept, should
> we bump, or just document that "as of 1.6" it accepts the new stuff too?
> I think the latter would be enough in this case...

Ah, sure, that would be fine too.

--dave


-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r31605 - in trunk/subversion: include libsvn_repos

Posted by Karl Fogel <kf...@red-bean.com>.
"David Glasser" <gl...@davidglasser.net> writes:
> Doesn't this require a bump?
>
> Otherwise, I could go to the 'latest version' doxygen, read it, think
> "ah, it's legal to pass NULL to svn_repos_get_commit_editor5", and
> then write a program that only works if you have 1.6+.

When we loosen an API to accept inputs it formerly didn't accept, should
we bump, or just document that "as of 1.6" it accepts the new stuff too?
I think the latter would be enough in this case...

-Karl

> On Thu, Jun 5, 2008 at 2:49 PM,  <kf...@tigris.org> wrote:
>> Author: kfogel
>> Date: Thu Jun  5 14:49:04 2008
>> New Revision: 31605
>>
>> Log:
>> Improve an API by allowing a callback to be null.
>>
>> Suggested by: Neels Janosch Hofmeyr <ne...@elego.de>
>>
>> * subversion/include/svn_repos.h
>>  (svn_repos_get_commit_editor5): Document that callback can be null.
>>    Also, fix up some obsolete documentation: the modern callback type
>>    takes a struct instead of separate parameters.
>>
>> * subversion/libsvn_repos/commit.c
>>  (close_edit): Test callback before calling.
>>
>> Modified:
>>   trunk/subversion/include/svn_repos.h
>>   trunk/subversion/libsvn_repos/commit.c
>>
>> Modified: trunk/subversion/include/svn_repos.h
>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_repos.h?pathrev=31605&r1=31604&r2=31605
>> ==============================================================================
>> --- trunk/subversion/include/svn_repos.h        Thu Jun  5 14:03:39 2008        (r31604)
>> +++ trunk/subversion/include/svn_repos.h        Thu Jun  5 14:49:04 2008        (r31605)
>> @@ -938,14 +938,15 @@ svn_repos_replay(svn_fs_root_t *root,
>>  * due to authz will return SVN_ERR_AUTHZ_UNREADABLE or
>>  * SVN_ERR_AUTHZ_UNWRITABLE.
>>  *
>> - * Calling @a (*editor)->close_edit completes the commit.  Before
>> - * @c close_edit returns, but after the commit has succeeded, it will
>> - * invoke @a callback with the new revision number, the commit date (as a
>> - * <tt>const char *</tt>), commit author (as a <tt>const char *</tt>), and
>> - * @a callback_baton as arguments.  If @a callback returns an error, that
>> - * error will be returned from @c close_edit, otherwise if there was a
>> - * post-commit hook failure, then that error will be returned and will
>> - * have code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
>> + * Calling @a (*editor)->close_edit completes the commit.
>> + *
>> + * If @a callback is non-NULL, then before @c close_edit returns (but
>> + * after the commit has succeeded) @c close_edit will invoke
>> + * @a callback with a filled-in @c svn_commit_info_t *, @a callback_baton,
>> + * and @a pool or some subpool thereof as arguments.  If @a callback
>> + * returns an error, that error will be returned from @c close_edit,
>> + * otherwise if there was a post-commit hook failure, then that error
>> + * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
>>  *
>>  * Calling @a (*editor)->abort_edit aborts the commit, and will also
>>  * abort the commit transaction unless @a txn was supplied (not @c
>>
>> Modified: trunk/subversion/libsvn_repos/commit.c
>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_repos/commit.c?pathrev=31605&r1=31604&r2=31605
>> ==============================================================================
>> --- trunk/subversion/libsvn_repos/commit.c      Thu Jun  5 14:03:39 2008        (r31604)
>> +++ trunk/subversion/libsvn_repos/commit.c      Thu Jun  5 14:49:04 2008        (r31605)
>> @@ -715,7 +715,7 @@ close_edit(void *edit_baton,
>>                                     pool);
>>       }
>>
>> -    if (! err)
>> +    if ((! err) && eb->commit_callback)
>>       {
>>         commit_info = svn_create_commit_info(pool);
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: svn-help@subversion.tigris.org
>>
>>
>
>
>
> -- 
> David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org