Mark E. Hamilton
2008-05-20 16:15:11 UTC
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.
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
----------------
Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.
505-844-7666