You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Eduardo Gonçalves <in...@gmail.com> on 2008/05/23 23:59:48 UTC

Help a Brazilian Student...

Hi guys!

My name is Eduardo.

I am a student of bachelor's degree course in computer science.

I am doing my completion of course work and am having problems with SVN.

I need to run the SVN through a PHP script.

I am working on a Windows XP operating system and the IIS web server.

The problem occurs when running the excerpt from source illustrated below:

"
*echo "".exec("svn commit file:///D:/tcc/repository/project/")."";
echo "".exec("svn update file:///D:/tcc/repository/project/")."";*
"
There is absolutely nothing in return. I do not know where I am committing
errors. Did you know tell me?

Other information: running these commands in the command line, I get message
that the version of SVN installed on my computer is outdated to run such
commands and it is requested that I update the version of SVN, but the
version I have now is the most updated.

I count on the help of you ...

Sincerely ...

Eduardo.

-- 
**********************************************************
** Eduardo Gonçalves *************************************
**********************************************************
** Desenvolvimento de Páginas e Sistemas Web**************
**********************************************************
** GnuPG Fingerprint: ************************************
***** 8C9E D41C 57E2 75A1 AE24 6831 CBAF C49A D6F9 2B16 **
**********************************************************

Re: Help a Brazilian Student...

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 24, 2008, at 12:42, Kevin Grover wrote:

> On Fri, May 23, 2008 at 4:59 PM, Eduardo Gonçalves wrote:
>
>> I need to run the SVN through a PHP script.
>>
>> I am working on a Windows XP operating system and the IIS web server.
>>
>> The problem occurs when running the excerpt from source  
>> illustrated below:
>>
>> "
>> echo "".exec("svn commit file:///D:/tcc/repository/project/")."";
>> echo "".exec("svn update file:///D:/tcc/repository/project/")."";
>> "
>> There is absolutely nothing in return. I do not know where I am  
>> committing
>> errors. Did you know tell me?
>>
>> Other information: running these commands in the command line, I  
>> get message
>> that the version of SVN installed on my computer is outdated to  
>> run such
>> commands and it is requested that I update the version of SVN, but  
>> the
>> version I have now is the most updated.
>
> First, you will be more likely to get responses if you use an
> applicable Subject line.
>
> Second, 'svn commit' and 'svn update' both apply to working copies,
> e.g. a local working directory created when you run 'svn checkout'.
> Your example makes it look like you're trying to apply them to a
> repository.  Once checked out, the working copy knows the URL from
> which it was checked out: you don't specify it on the command line.
>
> You should run all your commands from the command line and verify that
> they really do what you want.

Right. You also need to be in the working copy for the commit or  
update to work, or supply the working copy path as the argument to  
the command. And the reason you're not seeing any output in PHP is  
that you're not requesting to get the stderr output, which is where  
errors will be printed. Also, exec only returns the last line of  
output; you probably want all the output. Considering all these  
things, I recommend something like:

<?php

$wcpath = '/path/to/workingcopy';
$cmd = 'svn update ' . escapeshellarg($wcpath) . ' 2>&1';
$output = array();
exec($cmd, $output, $error);
#if ($error != 0) {
	echo implode("\n", $output) . "\n";
#}

?>

Usually you would only need to look at the output in the case when  
the return code is nonzero, but in the case of "svn update" with an  
invalid path, it will say "Skipped '/path/to/workingcopy'" and will  
still return 0. So I wanted to make sure you see such output.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Help a Brazilian Student...

Posted by Kevin Grover <ke...@kevingrover.net>.
On Fri, May 23, 2008 at 4:59 PM, Eduardo Gonçalves
<in...@gmail.com> wrote:
> Hi guys!
>
> My name is Eduardo.
>
> I am a student of bachelor's degree course in computer science.
>
> I am doing my completion of course work and am having problems with SVN.
>
> I need to run the SVN through a PHP script.
>
> I am working on a Windows XP operating system and the IIS web server.
>
> The problem occurs when running the excerpt from source illustrated below:
>
> "
> echo "".exec("svn commit file:///D:/tcc/repository/project/")."";
> echo "".exec("svn update file:///D:/tcc/repository/project/")."";
> "
> There is absolutely nothing in return. I do not know where I am committing
> errors. Did you know tell me?
>
> Other information: running these commands in the command line, I get message
> that the version of SVN installed on my computer is outdated to run such
> commands and it is requested that I update the version of SVN, but the
> version I have now is the most updated.
>
> I count on the help of you ...
>
> Sincerely ...
>
> Eduardo.
>


First, you will be more likely to get responses if you use an
applicable Subject line.

Second, 'svn commit' and 'svn update' both apply to working copies,
e.g. a local working directory created when you run 'svn checkout'.
Your example makes it look like you're trying to apply them to a
repository.  Once checked out, the working copy knows the URL from
which it was checked out: you don't specify it on the command line.

You should run all your commands from the command line and verify that
they really do what you want.

- Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org