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

Re: how to get exit codes of svn commands

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-03-22 16:49:15 CET

Please don't "borrow" threads? Thanks.

On Tue, 2005-22-03 at 17:33 +0800, velocity wrote:
> To do this, I would like to issue the following command
>
> svnlook uuid <path>
>
> >From this, I wanted to get the exit code of svnlook to be able to tell
> if the given path is a valid repository or not. Given a valid path and
> a bogus path (but exists in the directory), the exit codes are both
> '0' {zero}.
>
> What is the right way of doing this?

Seemed like a sound use of the return code and sane to me so I tried it:

[nesscg@heidrun subversion]$ svnlook uuid ~/subversion/test/
d3c769be-e8f2-0310-8b1f-f7cd6d7c08ff
[nesscg@heidrun subversion]$ echo $?
0
[nesscg@heidrun subversion]$ svnlook uuid /
svn: Can't open file '/format': No such file or directory
[nesscg@heidrun subversion]$ echo $?
1
[nesscg@heidrun subversion]$ svn --version
svn, version 1.1.2 (r12471)
   compiled Jan 10 2005, 07:01:51

So it seems you could try and upgrade, or perhaps talk to the windows
packager to see if this problem exists in his source base.

Cheers,
Chris

-- 
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
10:43:28 up 14 min, 3 users, load average: 0.00, 0.12, 0.17 
http://www.gnu.org/philosophy/no-word-attachments.html

Received on Tue Mar 22 16:49:57 2005

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.