So basically I want to be able to do this:
/*
Runs command and checks return code of last command run. Throws SVN exception if non-zero status code is returned. The output of the command otherwise.
*/
public static function runCommand($cmd)
{
//Redirect error to stdout
$cmd .= " 2>&1";
$output = array();
exec($cmd, $output, $status);
$output = implode("
", $output);
if($status != 0)
{
//custom exception class - nonimportant
throw new SvnException($output);
}
return $output;
}
The issue is that svn add
considers it an error when you try to add a directory that is already under version control so it returns an error status code. Is there anyway to fix this issue without putting in a hack to look for svn add
commands and ignore the error if is the "directory already exists one"?
Specifically, is there some SVN commands I can use to tell if the folder is under version controlt, or arguments that I can use so that svn add
does not return an error if the directory is already under version control.