/**
* svn list
*
* @param $repository string
* @return boolean
*
*/
public static function ls($repository) {
$command = "sudo svn ls " . $repository;
$output = self::runCmd ( $command );
$output = implode ( "<br />", $output );
if (strpos ( $output, 'non-existent in that revision' )) {
return false;
}
return "<br />" . $command . "<br />" . $output;
}
/**
* svn copy
*
* @param $src string
* @param $dst string
* @param $comment string
* @return boolean
*
*/
public static function copy($src, $dst, $comment) {
$command = "sudo svn cp $src $dst -m '$comment'";
$output = self::runCmd ( $command );
$output = implode ( "<br />", $output );
if (strpos ( $output, 'Committed revision' )) {
return true;
}
return "<br />" . $command . "<br />" . $output;
}
/**
* svn delete
*
* @param $url string
* @param $comment string
* @return boolean
*
*/
public static function delete($url, $comment) {
$command = "sudo svn del $url -m '$comment'";
$output = self::runCmd ( $command );
$output = implode ( '<br />', $output );
if (strpos ( $output, 'Committed revision' )) {
return true;
}
return "<br />" . $command . "<br />" . $output;
}
/**
* svn move
*
* @param $src string
* @param $dst string
* @param $comment string
* @return boolean
*/
public static function move($src, $dst, $comment) {
$command = "sudo svn mv $src $dst -m '$comment'";
$output = self::runCmd ( $command );
$output = implode ( '<br />', $output );
if (strpos ( $output, 'Committed revision' )) {
return true;
}
return "<br />" . $command . "<br />" . $output;
}
/**
* svn mkdir
*
* @param $url string
* @param $comment string
* @return boolean
*/
public static function mkdir($url, $comment) {
$command = "sudo svn mkdir $url -m '$comment'";
$output = self::runCmd ( $command );
$output = implode ( '<br />', $output );
if (strpos ( $output, 'Committed revision' )) {
return true;
}
return "<br />" . $command . "<br />" . $output;
}
/**
* svn diff
* @param $pathA string
* @param $pathB string
* @return string
*/
public static function diff($pathA, $pathB) {
$output = self::runCmd ( "sudo svn diff $pathA $pathB" );
return implode ( '<br />', $output );
}
/**
* svn checkout
* @param $url string
* @param $dir string
* @return boolean
*/
public static function checkout($url, $dir) {
$command = "cd $dir && sudo svn co $url";
$output = self::runCmd ( $command );
$output = implode ( '<br />', $output );
if (strstr ( $output, 'Checked out revision' )) {
return true;
}
&nbs