Example #1
0
 /**
  * @param string Path to repository
  * @param int Number of revision (0 = no limit)
  * @return array  Key are revision number example:
  *        array(
  *            1 => array("author" => "duponc_j", "msg" => "Test", date=> 1265413),
  *            2 => array("revision" => "crivis_s", "msg" => "Test2", date=>4565654)
  *        )
  *
  * Date are unix timestamp
  */
 public static function log($repository, $limit = 25, $start = 0, $end = 0)
 {
     $repository = SVNUtils::getRepositoryPath($repository);
     if ($limit) {
         $limit = escapeshellarg($limit);
         $limit = "--limit {$limit}";
     } else {
         $limit = "";
     }
     if ($start) {
         $revision = "-r {$start}";
         if ($end) {
             $revision .= ":{$end}";
         }
     } else {
         $revision = "";
     }
     $message = ConsoleUtils::runCmdCaptureMessageUnsafe(SVNUtils::svnCommand("log --xml {$revision} {$limit} {$repository}"), $return);
     if ($return) {
         throw new Exception("Can't get subversion repository logs: " . $message);
     }
     return SVNLog::parseOutput($message);
 }