* @return string the description
*/
function getPluginDescription() {
- return _('Use Mercuial as Source Code Management tool. Offer DAV or SSH access.');
+ return _('Use Mercurial as Source Code Management tool. Offer DAV or SSH access.');
}
function getDefaultServer() {
}
function getBlurb() {
- return '<p>' . _('Documentation for Mercurial is available at <a href="http://hgbook.red-bean.com/">http://hgbook.red-bean.com/</a> . ')._(' Another short Introduction can be found at <a href="http://hginit.com/">http://hginit.com/</a>').'</p>';
+ return '<p>'
+ . sprintf(_('Documentation for %1$s is available at <a href="%2$s">%2$s</a>.'),
+ 'Mercurial',
+ 'http://hgbook.red-bean.com/')
+ . '</p>'
+ . '<p>'
+ . _('Another short Introduction can be found at <a href="http://hginit.com/">http://hginit.com/</a>')
+ . '</p>';
}
function getInstructionsForAnon($project) {
if (forge_get_config('use_dav', 'scmhg')) {
$protocol = forge_get_config('use_ssl', 'scmhg')? 'https' : 'http';
$b .= '<p>';
- $b .= 'This project\'s Mercurial repository can be checked out through anonymous access with the following command.';
+ $b .= _("This project's Mercurial repository can be checked out through anonymous access with the following command:");
$b .= '</p>';
$b .= '<p>';
$b .= '<tt>hg clone '.$protocol.'://'.forge_get_config('anonhg_login', 'scmhg').'@' . $this->getBoxForProject($project) . '/'. 'hg' .'/'. $project->getUnixName() .'/'.'</tt><br />';
- $b .= _('The password is ').forge_get_config('anonhg_password', 'scmhg').'<br/>';
+ $b .= _('The password is ').forge_get_config('anonhg_password', 'scmhg').'<br/>';
} else {
$b .= '<p class="warning">'._('Please contact forge administrator, scmhg plugin is not correctly configured');
$b = '';
if (forge_get_config('use_ssh', 'scmhg')) {
$b .= '<h2>';
- $b .= _('Developer Mercurial Access via SSH');
+ $b .= sprintf(_('Developer %s Access via SSH'), 'Mercurial');
$b .= '</h2>';
$b .= '<p>';
- $b .= _('Only project developers can access the Mercurial tree via this method. SSH must be installed on your client machine. Enter your site password when prompted.');
+ $b .= _('Read/write access to Mercurial tree is allowed for authenticated users.');
+ $b .= ' ';
+ $b .= _('SSH must be installed on your client machine.');
+ $b .= ' ';
+ $b .= _('Enter your site password when prompted.');
$b .= '</p>';
// Warning : the ssh uri MUST be this form : ssh://username@scmbox//path/reponame
// HAVE YOU SEEN THE // starting the path ? Keep in mind the double /
$b .= _('Developer Mercurial Access via HTTP');
$b .= '</h2>';
$b .= '<p>';
- $b .= _('Only project developers can access the Mercurial tree via this method. Enter your site password when prompted.');
+ $b .= _('Only project developers can access the Mercurial tree via this method.');
+ $b .= ' ';
+ $b .= _('Enter your site password when prompted.');
$b .= '</p>';
$b .= '<p><tt>hg clone '.$protocol.'://<i>'. $d .'</i>@' . $this->getBoxForProject($project) .'/hg/'. $project->getUnixName() . '</tt></p>';
}
} else {
if (forge_get_config('use_ssh', 'scmhg')) {
- $d = '<i>developername</i>';
+ $d = '<em>developername</em>';
$b = '<h2>';
- $b .= _('Developer Mercurial Access via SSH');
+ $b .= sprintf(_('Developer %s Access via SSH'), 'Mercurial');
$b .= '</h2>';
$b .= '<p>';
- $b .= _('Only project developers can access the Mercurial tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper value. Enter your site password when prompted.');
+ $b .= sprintf(_('Only project developers can access the %s tree via this method.'), 'Mercurial');
+ $b .= ' ';
+ $b .= _('SSH must be installed on your client machine.');
+ $b .= ' ';
+ $b .= _('Substitute <em>developername</em> with the proper value.');
+ $b .= ' ';
+ $b .= _('Enter your site password when prompted.');
$b .= '</p>';
// Warning : the ssh uri MUST be this form : ssh://username@scmbox//path/reponame
// HAVE YOU SEEN THE // starting the path ? Keep in mind the double /
$b .= _('Developer Mercurial Access via HTTP');
$b .= '</h2>';
$b .= '<p>';
- $b .= _('Only project developers can access the Mercurial tree via this method. Enter your site password when prompted.');
+ $b .= _('Only project developers can access the Mercurial tree via this method.');
+ $b .= ' ';
+ $b .= _('Enter your site password when prompted.');
$b .= '</p>';
$b .= '<p><tt>hg clone '.$protocol.'://<i>'. _('developername') .'</i>@' . $this->getBoxForProject($project) .'/hg/'. $project->getUnixName() . '</tt></p>';
}
}
function getSnapshotPara($project) {
- return ;
+ return;
}
function getBrowserLinkBlock($project) {
if (!$project) {
return false;
}
+
if (!$project->usesPlugin($this->name)) {
return false;
}
$unix_group = 'scm_' . $project->getUnixName();
}
if (forge_get_config('use_dav', 'scmhg')) {
- $unix_group = forge_get_config('apache_group');
+ $unix_group = forge_get_config('apache_group');
$unix_user = forge_get_config('apache_user');
}
-
+
system("mkdir -p $repo");
/** per project configuration for http **/
if (forge_get_config('use_dav', 'scmhg')) {
$conf .= "\ndescription = ".$project->getUnixName();
$conf .= "\nstyle = paper";
$conf .= "\nallow_push = *"; //every user ( see apache configuration) is allowed to push
- $conf .= "\nallow_read = *"; // every user is allowed to clone and pull
+ $conf .= "\nallow_read = *"; // every user is allowed to clone and pull
fwrite($f, $conf);
fclose($f);
system("chgrp -R $unix_group $repo");
if (!$project) {
return false;
}
+
if (! $project->usesPlugin ($this->name)) {
return false;
}
if (! $project->usesPlugin($this->name)) {
return false;
}
-
+
if ($params['mode'] == 'day') {
db_begin();
$year = $params['year'];
break;
}
} else {
- $last_user = $this->getUser($line);
+ $last_user = $this->getUser($line);
}
}
pclose($pipe);
-
+
// inserting group results in stats_cvs_groups
if ($updates > 0 || $adds > 0) {
if (!db_query_params('INSERT INTO stats_cvs_group (month, day, group_id, checkouts, commits, adds) VALUES ($1, $2, $3, $4, $5, $6)',
}
$result = db_query_params('SELECT count(*) AS count FROM plugin_scmhg_repos WHERE group_id=$1 AND repo_name = $2',
- array ($params['group_id'], $params['repo_name']));
+ array($params['group_id'], $params['repo_name']));
if (! $result) {
$params['error_msg'] = db_error();
return false;
$description = $params['description'];
}
- $result = db_query_params ('INSERT INTO plugin_scmhg_repos (group_id, repo_name, description, clone) VALUES ($1, $2, $3, $4)',
- array ($params['group_id'], $params['repo_name'], $description, $clone));
+ $result = db_query_params('INSERT INTO plugin_scmhg_repos (group_id, repo_name, description, clone) VALUES ($1, $2, $3, $4)',
+ array($params['group_id'], $params['repo_name'], $description, $clone));
if (! $result) {
$params['error_msg'] = db_error();
return false;
}
- plugin_hook ("scm_admin_update", $params);
+ plugin_hook("scm_admin_update", $params);
return true;
}
if (! $project->usesPlugin ($this->name)) {
return false;
}
-
+
$project_name = $project->getUnixName();
-
+
$select_repo = '<select name="frontpage">' . "\n";//array($project->getPublicName());
$result = db_query_params('SELECT repo_name FROM plugin_scmhg_repos WHERE group_id=$1',
array ($params['group_id']));
$select_repo .= '<option value="'.$data['repo_name'].'">'.$data['repo_name'].'</option>' . "\n";
}
$select_repo .= '</select>' . "\n";
-
+
session_require_perm('project_admin', $params['group_id']);
- $adminheadertitle = sprintf(_('Create SCM repository for project %1$s'), $project_name);
+ $adminheadertitle = sprintf(_('Create SCM repository for project %s'), $project_name);
project_admin_header(array('title'=>$adminheadertitle, 'group'=>$params['group_id']));
?>
action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
<input type="hidden" name="group_id" value="<?php echo $params['group_id'] ?>" />
<input type="hidden" name="create_repository" value="1" />
-<p><strong><?php echo _('Repository name:') ?></strong><?php echo utils_requiredField(); ?><br />
+<p><strong><?php echo _('Repository name')._(': ') ?></strong><?php echo utils_requiredField(); ?><br />
<input type="text" required="required" size="20" name="repo_name" value="" /></p>
<p><strong><?php echo _('Description')._(':'); ?></strong><br />
<input type="text" size="60" name="description" value="" /></p>
project_admin_footer(array());
}
-
}
// Local Variables: