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

How to test for a no-op commit.

From: Arild Fines <arild.fines_at_broadpark.no>
Date: 2004-07-31 04:48:22 CEST

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));

(http://svn.collab.net/repos/svn/trunk/subversion/clients/cmdline/commit-cmd
.c)

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
commit_info as NULL.

In any case, the doc string seems to be wrong.

--
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
Received on Sat Jul 31 04:48:38 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.