SCMPlugin () ; $this->name = 'scmbzr'; $this->text = 'Bazaar'; require_once $gfconfig.'plugins/scmbzr/config.php' ; $this->default_bzr_server = $default_bzr_server ; $this->enabled_by_default = $enabled_by_default ; $this->bzr_root = $bzr_root; $this->register () ; } function getDefaultServer() { return $this->default_bzr_server ; } function getBlurb () { return _('
Documentation for Bazaar (sometimes referred to as "bzr") is available here.
') ; } function getInstructionsForAnon ($project) { $b = _('Anonymous Bazaar Access
This project\'s Bazaar repository can be checked out through anonymous access with the following command(s).
'); $b .= '' ;
$b .= 'bzr checkout http://'.$project->getSCMBox().$this->bzr_root.'/'.$project->getUnixName().'/'._('branchname').'
';
$b .= '
Developer Bazaar Access via SSH
Only project developers can access the Bazaar branches via this method. SSH must be installed on your client machine. Substitute developername with the proper values. Enter your site password when prompted.
'); $b .= 'bzr checkout bzr+ssh://'._('developername').'@' . $project->getSCMBox() . '/'. $this->bzr_root .'/'. $project->getUnixName().'/'._('branchname').'
' ; return $b ; } function getStats ($params) { $project = $this->checkParams ($params) ; if (!$project) { return false ; } if ($project->usesPlugin ($this->name)) { echo ' (Bazaar)'; } } function getDetailedStats ($params) { return ; } function createOrUpdateRepo ($params) { $project = $this->checkParams ($params) ; if (!$project) { return false ; } if (! $project->usesPlugin ($this->name)) { return false; } $repo = $this->bzr_root . '/' . $project->getUnixName() ; $unix_group = 'scm_' . $project->getUnixName() ; $repo_exists = false ; if (is_dir ($repo)) { $pipe = popen ("bzr info $repo 2>/dev/null", "r") ; $line = fgets ($pipe) ; fclose ($pipe) ; if (preg_match ("/^Shared repository/", $line) != 0) { $repo_exists = true ; } } if (!$repo_exists) { system ("bzr init-repo --no-trees $repo") ; } system ("chgrp -R $unix_group $repo") ; if ($project->enableAnonSCM()) { system ("chmod -R g+wXs,o+rX-w $repo") ; } else { system ("chmod -R g+wXs,o-rwx $repo") ; } } } // Local Variables: // mode: php // c-file-style: "bsd" // End: ?>