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

svn info not setting exit status.

From: Mark E. Hamilton <mhamilt_at_sandia.gov>
Date: Tue, 20 May 2008 10:15:11 -0600

I'm trying to check to see if a path exists in my repository or not.
However, when I use 'svn info' on an invalid URL it does not set the
exit status to a non-zero value as I expected. It also prints what seems
to be an extra blank line to stderr, as shown below.

$ svn info file:///svnroot/test_repos/boogers >/dev/null ; echo $?
file:///svnroot/test_repos/boogers: (Not a valid URL)

0
$

When I use 'svn checkout' on the same URL is reports that it doesn't
exist and sets the exit status to '1'.

$ svn checkout file:///svnroot/test_repos/boogers >/dev/null ; echo $?
svn: URL 'file:///svnroot/test_repos/boogers' doesn't exist
1
$

I'm using 1.5.0rc4.

Am I incorrect in expecting 'svn info' to set the exit status if the URL
doesn't exist? If so, what is the correct way to (silently) check to see
if something exists in the repository? I don't want to have to parse
stderr (or stdout, for that matter, which is why I'm redirecting it to
/dev/null.) All I want is a simple True/False (0/1 in the shell)
response as to whether the URL exists.

-- 
----------------
Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.
505-844-7666
---------------------------------------------------------------------
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 18:15:51 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.