SCMPlugin () ; $this->name = 'scmsvn'; $this->text = 'SVN'; require_once $gfconfig.'plugins/scmsvn/config.php' ; $this->default_svn_server = $default_svn_server ; $this->enabled_by_default = $enabled_by_default ; $this->use_ssh = $use_ssh; $this->use_dav = $use_dav; $this->use_ssl = $use_ssl; $this->svn_root = $svn_root; $this->register () ; } function getDefaultServer() { return $this->default_svn_server ; } function echoShortStats ($params) { $project = $this->checkParams ($params) ; if (!$project) { return false ; } if ($project->usesPlugin ($this->name)) { list($commit_num, $add_num) = $this->getTotalStats($project->getID()); echo ' (SVN: '.sprintf(_('%1$s updates, %2$s adds'), number_format($commit_num, 0), number_format($add_num, 0)).')'; } } function getBlurb () { return _('
Documentation for Subversion (sometimes referred to as "SVN") is available here.
') ; } function getInstructionsForAnon ($project) { $b = _('Anonymous Subversion Access
This project\'s SVN repository can be checked out through anonymous access with the following command(s).
'); $b .= '' ;
if ($this->use_ssh) {
$b .= 'svn checkout svn://'.$project->getSCMBox().'/'.$this->svn_root.'/'.$project->getUnixName().'
';
}
if ($this->use_dav) {
$b .= 'svn checkout --username anonsvn http'.(($this->use_ssl) ? 's' : '').'://' . $project->getSCMBox(). '/' . $this->svn_root .'/'. $project->getUnixName() .'
';
$b .= _('The password is \'anonsvn\'').'
';
}
$b .= '
Developer Subversion Access via SSH
Only project developers can access the SVN tree via this method. SSH must be installed on your client machine. Substitute developername with the proper values. Enter your site password when prompted.
'); $b .= 'svn checkout svn+ssh://'._('developername').'@' . $project->getSCMBox() . '/'. $this->svn_root .'/'. $project->getUnixName().'
' ; } if ($this->use_dav) { $b .= _('Developer Subversion Access via DAV
Only project developers can access the SVN tree via this method. Substitute developername with the proper values. Enter your site password when prompted.
'); $b .= 'svn checkout --username '._('developername').' http'.(($this->use_ssl) ? 's' : '').'://'. $project->getSCMBox() .'/'. $this->svn_root .'/'.$project->getUnixName().'
' ; } return $b ; } function getSnapshotPara ($project) { return ; } function getBrowserBlock ($project) { global $HTML ; $b = $HTML->boxMiddle(_('Subversion Repository Browser')); $b = _('Browsing the Subversion tree gives you a view into the current status of this project\'s code. You may also view the complete histories of any file in the repository.
'); $b .= '[' ; $b .= util_make_link ("/scm/viewvc.php/?root=".$project->getUnixName(), _('Browse Subversion Repository') ) ; $b .= ']
' ; return $b ; } function getStatsBlock ($project) { global $HTML ; $b = $HTML->boxMiddle(_('Repository Statistics')); $result = db_query_params('SELECT u.realname, u.user_name, u.user_id, sum(commits) as commits, sum(adds) as adds, sum(adds+commits) as combined FROM stats_cvs_user s, users u WHERE group_id=$1 AND s.user_id=u.user_id AND (commits>0 OR adds >0) GROUP BY u.user_id, realname, user_name, u.user_id ORDER BY combined DESC, realname', array ($project->getID())); if (db_numrows($result) > 0) { $tableHeaders = array( _('Name'), _('Adds'), _('Updates') ); $b .= $HTML->listTableTop($tableHeaders); $i = 0; $total = array('adds' => 0, 'commits' => 0); while($data = db_fetch_array($result)) { $b .= '