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

Re: svn exit/return/status codes

From: Peter Valdemar Mørch <swp5jhu02_at_sneakemail.com>
Date: 2004-08-25 20:39:07 CEST

bruce bedouglas-at-earthlink.net |Lists| wrote:
> foo = exec('svn ls svn://foo.com/repos/trunk')

You mention both perl and php and the answer differs between them. These
answers aren't really specific to svn either. Here you go:

In perl, if you run exec(), no more lines in your script will ever be
run. Use system() or `` (backticks) instead. The return code will be
found in the $? variable, such as:

my $output = `svn ls svn://foo.com/repos/trunk 2>&1`;
die "svn failed with errorcode $?"
  if $?;

In php, you'll want to run the command as
exec('svn ls svn://foo.com/repos/trunk', $output, $errorcode);
if ($errorcode)
        yadaYadaYada();

Peter

-- 
Peter Valdemar Mørch
http://www.morch.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 25 20:39:47 2004

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