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

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

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2004-08-01 16:31:53 CEST

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
Received on Sun Aug 1 16:37:10 2004

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.