I would like the svn command-line program to exit with a non-zero status
when it failed to do what I told it to do, like other UNIX and even DOS
programs. At the moment SVN 1.3.0 does this in some error conditions but
not in others, and I can't make sense out of the behaviour I see - it
looks incorrect to me. I can't find anything at all in The Book about the
exit status of the command-line 'svn' client program.
For example, is it the intended behaviour that 'svn update' exit with
status 0 when I told it to update the working copy, and a conflict
occurred as a result of that update? I would like this case to return an
error so we can detect this in build scripts, instead of doing ugly things
like 'svn update | grep '^C'. Or maybe make this user-selectable using
'--strict' or something if the silent-fail behaviour is also desired in
Similarly, 'svn update foo' where foo does not exist exits with status
0. In what possible sense has the requested operation (to update something
that does not exist) been successful? Surely this is a bug.
Similarly, attempting a 'resolved' operation on a WC to which I don't have
write access results in both an error message *and* a successful exit
status, which is a bit schizophrenic of Subversion.
But contrarily, attempting to checkout from a server name or a repository
location which does not exist does cause svn to exit with non-zero status.
Some experiments to show not tell what I mean:
1. Tell SVN to update something that does exist, but cannot be updated
because it is not a working copy.
# svn update /tmp ; echo $?
Ok, /tmp is not a WC but that is not an error. I can live with this,
especially as I can see how others could need this behavour. But giving me
a switch with which to request an error status in this case would be nice.
2. Tell SVN to update something which does not exist.
# svn update no.such.file ; echo $?
Wtf? It didn't skip that file - there was no such file present in order to
be skipped. What is the sound of one hand clapping?
3. Tell SVN to check out from a nonexistent host.
# svn co https://no.such.host/ ; echo $?
svn: PROPFIND request failed on '/'
svn: PROPFIND of '/': Could not resolve hostname `no.such.host': Host
not found (https://no.such.host)
4. Tell SVN to check out from a nonexistent path on a present host.
# svn co https://svn/repos/no.such.path ; echo $?
svn: URL 'https://svn/repos/no.such.path' doesn't exist
5. Tell SVN to mark a working copy as resolved which is not in conflict
and which is not writable by my current user (because I chowned it to
another user specifically to break SVN).
# svn resolved . ; echo $?
svn: warning: Can't open file '.svn/lock': Permission denied
# This case at least is clearly incorrect.
Senior Programmer (UNIX)
TCG Information Systems Pty Ltd
+61 (02) 8303 2407
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Mon Mar 20 08:14:33 2006