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

Re: svn info not setting exit status.

From: Mark E. Hamilton <mhamilt_at_sandia.gov>
Date: Tue, 20 May 2008 13:22:34 -0600

Karl Fogel wrote:
> We definitely should continue the loop even in case of error, so we try
> every target. But when we do exit, should it be a non-zero exit code if
> any target received an error? Currently, we exit with zero.
> There may be precedents for this sort of situation, and if there are,
> Subversion should follow them. But I don't know what they are. Does
> anyone else?

I can't really speak to precedent, only what I think. If I ask svn to do
something, I want to be able to decide easily if I should continue based
on whether or not it was able to do what I asked. In the case of
executing 'svn info' on the command it is reasonable for a user to do
'svn info A B C' and not care about the exit status, because they can
see any errors on the screen.

However, when scripting some process I would never do more than one at a
time, because there is no easy way to tell which one failed. You should,
IMO, always do

svn info A || handle error
svn info B || handle error
svn info C || handle error

Also, for 'svn info' it is reasonable for it to continue to run if it
encounters an error since it is a read-only operation. What I have done
in the past in similar code is to return the exit status of the last
failed operation after the end of the loop. Knowing that one (or more)
failed is better than not knowing at all.

Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-05-20 21:23:07 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.