You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Peter N. Lundblad" <pe...@famlundblad.se> on 2004/08/01 14:31:53 UTC

Re: How to test for a no-op commit.

On Sat, 31 Jul 2004, Arild Fines wrote:

> According to the docstring for svn_client_commit, you should test for
> commit_info->revision being SVN_INVALID_REVNUM:
>
>  * If no error is returned and @a (*commit_info)->revision is set to
>  * @c SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to
>  * be committed.
>
> However, the Subversion client itself does not seem to do that, instead
> checking for commit_info being NULL:
>
>   if (commit_info && ! opt_state->quiet)
>     SVN_ERR (svn_cl__print_commit_info (commit_info, pool));
>

Check svn_cl__print_commit_info in util.c. It checks for commit_info being
non-NULL and commit_Info->revision being valid.

> The reason I'm asking is that I am seeing commit_info being non-null and
> pointing to junk for an svn_client_commit call on a WC without
> modifications. This only happens in Release builds - Debug builds leave

svn_cl__commit initializes commit_info to NULL before calling
svn_client_commit, so it remains NULL if that function doesn't touch it.

> In any case, the doc string seems to be wrong.
>
The doc string says that svn_client_commit returns immediately, without
error, if targets has zero length. I haven't read the implementation, but
to me, the docstring seems correct in this regard.

//Peter

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

RE: How to test for a no-op commit.

Posted by Arild Fines <ar...@broadpark.no>.
Peter N. Lundblad wrote:
>> The reason I'm asking is that I am seeing commit_info being non-null
>> and pointing to junk for an svn_client_commit call on a WC without
>> modifications. This only happens in Release builds - Debug builds
>> leave 
> 
> svn_cl__commit initializes commit_info to NULL before calling
> svn_client_commit, so it remains NULL if that function doesn't touch
> it. 

D'oh! I'll just, uhm, be over... here, doing... stuff.

-- 
Arild

AnkhSVN: http://ankhsvn.tigris.org
Blog: http://ankhsvn.com/blog
IRC: irc://irc.freenode.net/ankhsvn

"Weaseling out of things is good. It's what separates us from the other
animals....except weasels." -- Homer Simpson 

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