cvs diff: Diffing modules/cvslog
Index: modules/cvslog/README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cvslog/README.txt,v
retrieving revision 1.3.2.1
diff -u -F^f -r1.3.2.1 README.txt
--- modules/cvslog/README.txt 21 Jun 2006 22:57:07 -0000 1.3.2.1
+++ modules/cvslog/README.txt 8 Oct 2006 03:52:09 -0000
@@ -16,5 +16,10 @@
* Each commit message can be modified in a theme_cvs_entry($cvs) function,
the parameter is an object containing user, timestamp, and message.
+Site-specific customization:
+ * Parts of this code are very specific to how this module is used
+ on drupal.org. I'm trying to isolate as many of these
+ site-specific hacks as possible into the cvs_local.inc file.
+
Note that you must customize the xcvs/xcvs-config.php file if you wish
to use those scripts on your site. See xcvs/README.txt for details.
Index: modules/cvslog/cvs.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cvslog/cvs.module,v
retrieving revision 1.106.2.19
diff -u -F^f -r1.106.2.19 cvs.module
--- modules/cvslog/cvs.module 18 Sep 2006 10:37:43 -0000 1.106.2.19
+++ modules/cvslog/cvs.module 8 Oct 2006 03:52:10 -0000
@@ -17,6 +17,11 @@
define('CVS_MESSAGE_ANON', 'The Concurrent Versioning System (CVS) is a software development tool available to volunteers with experience in software development, translation, themeing, or documentation who wish to participate in the Drupal project. To request access to the Drupal CVS repository you must create an account and login. Come back to this page after you have logged on.');
define('CVS_MESSAGE_AUTH', 'The Concurrent Versioning System (CVS) is a software development tool used to manage programs and files for the Drupal project. It is available to volunteers with experience in software development, translation, themeing, or documentation who wish to participate in the project. If you are an Open Source software developer, themer, translator, or documentation writer, you can use the form below to request access to Drupal\'s CVS repository. Note that there are two repositories, core and contributions. Access to the Drupal core repository is only available to a handful of people, and CVS access is not required to contribute patches to core. For that, you should submit an issue into the issue queue for Drupal core. You are also not allowed to commit patches to modules maintained by other people without obtaining permission from them to do so. Please do not duplicate modules that overlap with a significant portion of functionality with what you are proposing to write.');
+$path = drupal_get_path('module', 'cvs');
+if (file_exists("$path/cvs_local.inc")) {
+ require_once "$path/cvs_local.inc";
+}
+
/**
* Implementation of hook_help().
*/
@@ -384,38 +389,258 @@ function cvs_nodeapi(&$node, $op, $arg =
*/
function cvs_form_alter($form_id, &$form) {
if ($form_id == 'project_project_node_form') {
- $node = $form['#node'];
- $result = db_query("SELECT rid, name FROM {cvs_repositories}");
- while ($repository = db_fetch_object($result)) {
- $repositories[$repository->rid] = $repository->name;
- }
- $form['cvs_nodeapi'] = array(
- '#type' => 'fieldset',
- '#title' => t('CVS integration'),
- '#collapsible' => TRUE,
- '#collapsed' => $node->cvs_directory ? TRUE : FALSE,
- );
- $projects_allowing_repo = explode(',', strtolower(variable_get('cvs_allow_repo_selection', '')));
- $allow_repo = in_array(strtolower($node->title), $projects_allowing_repo);
- $default_repo = $node->cvs_repository ? $node->cvs_repository : variable_get('cvs_default_repo', '');
- if (!empty($repositories)) {
- $form['cvs_nodeapi']['cvs_repository'] = array(
- '#type' => 'select',
- '#title' => t('Repository'),
- '#default_value' => $default_repo,
- '#options' => $allow_repo ? $repositories : array($default_repo => $repositories[$default_repo]),
- '#description' => t("Specify the project's CVS repository."),
- );
- }
- $form['cvs_nodeapi']['cvs_directory'] = array(
- '#type' => 'textfield',
- '#title' => t('CVS directory'),
- '#default_value' => $node->cvs_directory,
- '#size' => 40,
- '#maxlength' => 255,
- '#description' => t("Specify the project's directory within the specified CVS repository. Directory names should start with a leading slash and end with a trailing slash, and must be unique for each project. For example: /modules/foo/
, /themes/foo/
or /translations/foo/
."),
+ return cvs_alter_project_project_form($form);
+ }
+ if ($form_id == 'project_release_node_form') {
+ return cvs_alter_project_release_form($form);
+ }
+}
+
+/**
+ * Alters the project_project node form to add CVS integration
+ * @see cvs_form_alter
+ */
+function cvs_alter_project_project_form(&$form) {
+ $node = $form['#node'];
+ $result = db_query("SELECT rid, name FROM {cvs_repositories}");
+ while ($repository = db_fetch_object($result)) {
+ $repositories[$repository->rid] = $repository->name;
+ }
+ $form['cvs_nodeapi'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('CVS integration'),
+ '#collapsible' => TRUE,
+ '#collapsed' => $node->cvs_directory ? TRUE : FALSE,
+ );
+ $projects_allowing_repo = explode(',', strtolower(variable_get('cvs_allow_repo_selection', '')));
+ $allow_repo = in_array(strtolower($node->title), $projects_allowing_repo);
+ $default_repo = $node->cvs_repository ? $node->cvs_repository : variable_get('cvs_default_repo', '');
+ if (!empty($repositories)) {
+ $form['cvs_nodeapi']['cvs_repository'] = array(
+ '#type' => 'select',
+ '#title' => t('Repository'),
+ '#default_value' => $default_repo,
+ '#options' => $allow_repo ? $repositories : array($default_repo => $repositories[$default_repo]),
+ '#description' => t("Specify the project's CVS repository."),
+ );
+ }
+ $form['cvs_nodeapi']['cvs_directory'] = array(
+ '#type' => 'textfield',
+ '#title' => t('CVS directory'),
+ '#default_value' => $node->cvs_directory,
+ '#size' => 40,
+ '#maxlength' => 255,
+ '#description' => t("Specify the project's directory within the specified CVS repository. Directory names should start with a leading slash and end with a trailing slash, and must be unique for each project. For example: /modules/foo/
, /themes/foo/
or /translations/foo/
."),
+ '#required' => TRUE,
+ );
+}
+
+/**
+ * Alters the project_release node to add build tag UI
+ * @see cvs_form_alter
+ */
+function cvs_alter_project_release_form(&$form) {
+ $release = $form['#node'];
+ $project = $form['project']['#value'];
+
+ if (!isset($project->releases)) {
+ // This project has no releases, nothing to alter
+ return;
+ }
+
+ $form['#pre_render'][] = 'cvs_project_release_form_pre_render';
+
+ $fields = array('version_api_major', 'version_api_minor', 'version_major', 'version_minor', 'version_patch');
+
+ if (isset($_POST['edit']['tag'])) {
+ $tag_name = $_POST['edit']['tag'];
+ // We have to validate this here, since we're getting called
+ // before a validate callback would be invoked...
+ if (!isset($tag_name)) {
+ form_set_error('tag', t('You have to select a valid CVS tag or branch.'));
+ }
+ if ($tag_name == 'TRUNK') {
+ // Special case validation for the TRUNK...
+ $tag->tag = 'TRUNK';
+ $tag->branch = 1;
+ $tag->nid = $project->nid;
+ $form['version'] = form_builder('project_release_node_form', $form['version']);
+ foreach ($fields as $field) {
+ $form_val = $form['version'][$field]['#value'];
+ if (isset($form_val) && $form_val !== '') {
+ if (is_numeric($form_val) || $form_val == 'x') {
+ $version->$field = $form_val;
+ }
+ }
+ }
+ $form_val = $form['version']['version_extra']['#value'];
+ if (isset($form_val) && $form_val !== '') {
+ $version->version_extra = check_plain($form_val);
+ }
+ if (isset($version)) {
+ $version_str = project_release_get_version($version, $project);
+ unset($form['validate_version']);
+ }
+ else {
+ _cvs_alter_project_release_form_unset_all($form, false);
+ }
+ }
+ else {
+ $query = db_query("SELECT * FROM {cvs_tags} WHERE nid = %d AND tag = '%s'", $project->nid, $tag_name);
+ $tag = db_fetch_object($query);
+ if (!$tag) {
+ form_set_error('tag', t('The tag you selected does not exist for this project.'));
+ }
+ $query = db_query("SELECT * FROM {project_release_nodes} WHERE pid = %d AND tag = '%s'", $project->nid, $tag_name);
+ if (db_num_rows($query)) {
+ form_set_error('tag', t('The tag or branch you have selected is already in use by another release'));
+ }
+ $version = cvs_get_version_from_tag($tag, $project);
+ $version_str = project_release_get_version($version, $project);
+ }
+ unset($form['tag']);
+ $tags[$tag_name] = $tag_name;
+ $form['cvs_tag'] = array(
+ '#weight' => -10,
+/*
+ // TODO: This isn't really working. Might need CSS float/clear badness
+ '#prefix' => '