Commit #47183 by KarenS
Content Construction Kit (CCK): /modules/cck/content.info 1.3
Content Construction Kit (CCK): /modules/cck/nodereference.info 1.3
Content Construction Kit (CCK): /modules/cck/number.info 1.3
Content Construction Kit (CCK): /modules/cck/optionwidgets.info 1.3
Content Construction Kit (CCK): /modules/cck/text.info 1.3
Content Construction Kit (CCK): /modules/cck/userreference.info 1.3

This didn't do what you wanted it to. After update I get ``$Name: $'' in the Version column.

Comments

karens’s picture

This was done following the instructions in http://drupal.org/node/101009. I committed them as version="$Name$" as the instructions state, and when updated they come back as version = "$Name: $". There is something missing in those instructions and I've posted a comment to that thread so we can figure out what it is.

webchick’s picture

$Name $ is working correctly... the user has checked out from HEAD which doesn't populate $Name: $ since it's not a branch. If they check out from -r DRUPAL-5, this will change to $Name: DRUPAL-5$

It look rather ugly, but it's still better than being completely blank as it gives you a clue where to start.

Anonymous’s picture

I just posted a reply to KarenS at http://drupal.org/node/101009 in which I asked if $Revision$ shouldn't be used instead of $Name$?

karens’s picture

Angie, I just tried a checkout from the 5.x branch and got the same results, no name is inserted, it's just $Name: $

webchick’s picture

Oh well that's not right. ;) I'll talk to dww next time I see him and ask him about $Revision$

webchick’s picture

Ok.. so $revision$ is no good because that's the 1.123 part and doesn't actually correspond to the branch name. It also would give you the revision of the _info_ file which is not useful at all. ;) $Name$ is what you want.

However, I wasn't able to duplicate this bug... when I do:

cvs co -r DRUPAL-5 -d cck contributions/modules/cck

My version shows up as:

$Name: DRUPAL-5 $

which of course is ugly as sin, but at least tells me where to start when I find a bug. :)

Anonymous’s picture

Ok, so I'm wondering now if the Drupal core module that parses the .info file shouldn't filter the Version variable to remove the ugliness and set the value to HEAD if it literally matches '$Name: $'? My concern would be that everyone is going to complain to every module/theme maintainer using this method if a filter isn't applied.

webchick’s picture

Status: Active » Fixed

The short answer is no, core shouldn't do that. A couple reasons:

1. End users should NOT be downloading from CVS. They should be using tarballs.
2. Developers may initially be confused by this, but once they understand the concepts of branching it's logical.
3. Adding a "make_nice_version" function in core to parse $Name: $ ties us to CVS for our revision control system from now until whenever 5.x isn't used by anyone anymore (probably years down the road).

However! There is nothing wrong with a small contrib module and/or a code snippet to add this clean-up function. It could probablly simply be a hook_form_alter on the modules form, or even a theme function to override the output on this form.

For now though, I'm going to mark this issue as fixed because it's behaving as it should, and is no fault of CCK.

webchick’s picture

Btw, here is a snippet you can add to your site which will address this globally: http://drupal.org/node/101009#comment-178021

dww’s picture

i fully support everything webchick said in here. ;) also, see http://drupal.org/node/87298 for a bunch more on why core shouldn't parse the value of "version" from the .info files...

cheers,
-derek

karens’s picture

Also, just out of curiosity, I checked the latest tarball and it nicely shows the right version.

dww’s picture

http://drupal.org/node/97286 -- "automatically insert human-readable version into .info files"
i wasn't lying. ;)

cheers,
-derek

karens’s picture

Hey derek, I never doubted you!! I rarely look at the tarball and do everything from cvs, so I just wanted to see what it looked like to others.

dww’s picture

hehe, i was just joking. no worries. ;) didn't mean to imply you doubted me, was just pointing to the issue where the goodness happened.

cheers,
-derek

Anonymous’s picture

Status: Fixed » Closed (fixed)