[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: Robert Hunter <robert.hunter_at_gen-i.co.nz>
Date: 2005-03-22 23:03:18 CET

Christopher Ness wrote:
>
> 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}.
> 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.

The return codes are working for me on an old Windows build.
Perhaps, velocity, your JScript is not waiting for the process
to finish?

C:\temp\svn> svnlook uuid repos
5e4f9bff-2f23-6141-8991-54da6642e5b4

C:\temp\svn> echo %ERRORLEVEL%
0

C:\temp\svn> svnlook uuid \temp
svn: Can't open file '/temp/format': The system cannot find the file
specified.

C:\temp\svn> echo %ERRORLEVEL%
1

C:\temp\svn>svnlook --version
svnlook, version 1.0.6 (r10360)
   compiled Jul 24 2004, 00:01:41

-- 
Robert Hunter
*****************************************************************************
This communication, including any attachments, is confidential.
If you are not the intended recipient, you should not read it
- please contact me immediately, destroy it, and do not copy
or use any part of this communication or disclose anything about it,
Thank you.
Please note that this communication does not designate an information system
for the purposes of the Electronic Transactions Act 2002
******************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 22 23:06:53 2005

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