I would like to see the CVS tree field present in the project editing form to be automatically set when a project is first created; that would not preclude the possibility for the maintainer to unset the value set by Drupal.

I know there are projects that don't have files in the CVS repository, but this happens only for Drupal.org related projects. I also read in an issue opened against a project that projects listed at Drupal.org must be hosted in cvs.drupal.org; if this is the case, then the link to the CVS tree is known when the project is created.

Comments

avpaderno’s picture

In that is not possible, then the description given for the form field should remember which is the CVS tree URL for a project.

avpaderno’s picture

Does anybody have a though, about this feature request?

chx’s picture

Project: Drupal.org site moderators » Drupal.org customizations
Component: Textual improvements » Code

This belongs to drupalorg module. Any volunteers coding this?

avpaderno’s picture

If it is plain Drupal code, I could do it. I am not sure if applying to become co-maintainer of the module for just this change could be worth (even though I can help changing other code too).

avpaderno’s picture

Status: Active » Needs review
StatusFileSize
new822 bytes

I created a patch against DRUPAL-6--1 for this feature.

avpaderno’s picture

StatusFileSize
new834 bytes

I am sorry; the previous patch is wrong. Please review this patch.

avpaderno’s picture

StatusFileSize
new1.26 KB

Let me see if I can get it work at the third time. The previous patch used the same path for all the project types. This patch fixes that.

avpaderno’s picture

StatusFileSize
new1.25 KB

This the patch made against HEAD. I am not sure which version is currently used on Drupal.org.

sun’s picture

Title: Setting the content of 'CVS tree' in automatic » Display link to drupalcode.org repository for "Browse the CVS repository" by default
Category: feature » task
StatusFileSize
new2.56 KB
new890 bytes

Pretty please, yes. This is badly needed.

We cannot alter the node edit form, because we don't know the repository at that time yet.

Attached patch implements this simply as default link, in case project.module did not set one already.

Apparently, development for drupal.org seems to happen without E^ALL being enabled. Attached patches are fixing a couple of notices (so I was able to work on this patch at all).

sun’s picture

Assigned: Unassigned » sun
killes@www.drop.org’s picture

Status: Needs review » Needs work

I am a bit confused: for which branch is this patch?

THe form_alter part seems to be altready applied.

sun’s picture

drupalorg-HEAD, back in March, at least. Actual change:

+++ drupalorg_project/drupalorg_project.module	9 Mar 2010 22:30:04 -0000
@@ -384,6 +384,13 @@ function drupalorg_project_cvs_user_edit
 function drupalorg_project_project_page_link_alter(&$links, $node) {
+  // Add "Browse the CVS repository" link for contributed projects by default.
+  if (!isset($links['development']['links']['browse_repository'])) {
+    if (isset($node->cvs['repository']) && $node->cvs['repository'] == 2 && !empty($node->cvs['directory'])) {
+      $links['development']['links']['browse_repository'] = l(t('Browse the CVS repository'), 'http://drupalcode.org/viewvc/drupal/contributions' . $node->cvs['directory']);
+    }
+  }
+
avpaderno’s picture

 function drupalorg_project_project_page_link_alter(&$links, $node) {
+  // Add "Browse the CVS repository" link for contributed projects by default.
+  if (!isset($links['development']['links']['browse_repository'])) {
+    if (isset($node->cvs['repository']) && $node->cvs['repository'] == 2 && !empty($node->cvs['directory'])) {
+      $links['development']['links']['browse_repository'] = l(t('Browse the CVS repository'), 'http://drupalcode.org/viewvc/drupal/contributions' . $node->cvs['directory']);
+    }
+  }

Should not the code verify if the path contained in $node->cvs['directory'] really starts with a slash?

sun’s picture

At the time of writing that patch, leading and trailing slashes in $node->cvs['directory'] were enforced via form validation on the project node form.

avpaderno’s picture

Slashes are not enforced, but silently added; the result is, anyway, the same.

sun’s picture

So what's up with this issue? Can we do this?

The lines in #12 resp. #13 are all that's required.

sun’s picture

Can someone having actual privileges to change anything explain what's further needed to get this done?

Each comment here is triggered by yet another experience struggling with non-existing CVS repo links.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new1.17 KB

Re-rolled against HEAD.

dww’s picture

Status: Needs review » Closed (duplicate)

This should be fixed in cvs.module, so that when we kill CVS and move to Git, we don't have to remember to take this code back out of drupalorg.module. Let's just fix this at #156118: Automatically generate the value of 'Link to webcvs/viewcvs' field for a project. Thanks!

dww’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new1.11 KB

Upon more consideration, #156118 is a lot of work for cvs.module to get right, especially given that that module is on the way to the graveyard. So yeah, a quick patch here is fine for now. Here's a port to DRUPAL-6--1, which is what's live on d.o.

dww’s picture

Status: Needs review » Fixed

Committed to both branches, merged into bzr, and deployed on d.o. Opened #913982: Rip out custom hack for links to drupalcode.org/viewvc so we don't forget to rip this code out once we have Git and #156118: Automatically generate the value of 'Link to webcvs/viewcvs' field for a project is fixed in versioncontrol_project.

Working fine now, e.g. at http://drupal.org/project/signup (where I removed the hard-coded link).

sun’s picture

Lovely! Thank you, Derek! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit b9f827a on 6.x-3.x, 7.x-3.x-dev by dww:
    #435528 by sun, dww: Automatically provide links to drupalcode.org CVS...