Hi,

yesterday, I've created a new feature branch for my module in CVS and called it DRUPAL-4-7--2. So far, so good. However, the branch still does not appear in the selection box for "Add new release". I seem to recall that I could add a release for nightly generated tarballs on scratch.d.o. Is this no longer possible? Do I need to use a tag like DRUPAL-4-7--2-0 for the feature branch? On the other hand, this would be a one-time "point release", it would not regenerate the tarball, would it?

Regards,
Tobias

CommentFileSizeAuthor
#18 xcvs-loginfo-cvs-tags-hack.patch.txt2.1 KBdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Category: bug » support

what module? i'll take a look. chances are about 0.05% this is actually a bug in the system itself, so i'm moving this to a support request. chances are good something's just screwy with the CVS repo (you didn't really tag what you think you did, etc) or something else specific to your module is going wrong.

toddy’s picture

It's the Weather module.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Fixed

all i can think of is that when you were adding this tag, before you tried to create a release node for it, that you removed the tag from some files in your workspace? if so, that's a known problem with how cvs.module keeps tags associated with projects (it's a long story). anyway, i fixed this in your case, added the DRUPAL-4-7--2 branch to the list of known identifiers for weather module.

i'm tentatively marking this fixed, though maybe i should turn this into the bug report about the case i described above where cvs.module can lose track of a tag if you remove it from a few files in a project but leave it on the rest.

toddy’s picture

Well, first of all, thanks for fixing this.

However:

all i can think of is that when you were adding this tag, before you tried to create a release node for it, that you removed the tag from some files in your workspace?

Hm, I don't understand what you mean here. I've created a branch, not a tag. It's not possible to remove a branch from CVS, is it? Even if it's possible, I certainly did not do it. I simply created the branch and expected the branch name to appear as release target. After it did not appear for more than 24 hours, I submitted this bug report.

dww’s picture

Project: Project » CVS integration
Version: 4.7.x-2.0 » 4.7.x-2.x-dev
Component: Releases » X-CVS scripts
Category: support » bug
Status: Fixed » Active

what CVS client did you use?

if it was the command-line, do you happen to remember if you used "cvs tag" or "cvs rtag" to create the branch?

sadly, i just noticed that the scripts that insert this info into the DB when you run cvs tag aren't particularly careful about checking for and reporting failures with this step, so it's possible something failed when trying to talk to the DB and the script just silently returned succcess. hrm.

setting this to an active bug for now, since it doesn't seem like a specific problem with your module or setup, but potentially something wrong with the cvs scripts.

dww’s picture

Version: 4.7.x-2.x-dev » 4.7.x-2.0
toddy’s picture

I'm using Linux and operate cvs on the command line. I did use cvs tag, I've never used rtag in that project. The cvs version that's installed on my computer is 1.12.9.

dww’s picture

moshe had this problem with OG, too. when i asked him how he made the tag, i was shocked:

cvs checkout -r DRUPAL-5 contributions
cd contributions/modules
mkdir og
cd og
cp /full/path/to/HEAD/og/* .
cvs add *
cvs commit

wow, who comes up with such contortions to avoid learning cvs tag -b DRUPAL-5 ? ;)

needless to say, the above confused the scripts that protect our repository. i never dreamed people would go to such lengths to add a new branch, so i didn't put the code that records valid CVS ids into the commit hook (xcvs-commitinfo.php) only into the tag hook (xcvs-taginfo.php).

perhaps some the other people who are having trouble are using similarly bizzare methods for branching their code. i suppose i could try to defend against this approach via additional checks during a commit, and always inserting another record into the {cvs_tags} table for each commit. seems ugly, but i suppose the above is technically a valid way to add a tag, and the commit hook is the only way to catch it.

toddy’s picture

Well, I'm afraid I have to disappoint you -- I'm not even remotely as creative as moshe in creating tags or branches. :-) I simply used cvs tag -b DRUPAL-4-7--2 for my module.

dww’s picture

right. i believe there's still a bug, even if you do something sane. ;) that's why i didn't just "by design" or "won't fix" this issue. and, i'm afraid i have to disappoint you, but i don't have much time to work on this in the next few days...

toddy’s picture

No problem. You've already fixed the original problem manually, so no need for any action right now.

toddy’s picture

Hi,

just a short follow-up: I've just created the branch DRUPAL-4-7--3 for the module Weather, using cvs tag -b DRUPAL-4-7--3. This time, it went without problems, and I can create a nightly development release based on that branch. Maybe it was a temporary problem in the early stages of the new release system.

Regards,
Tobias

webchick’s picture

I saw this too with sIFR module.

AFAIK (it's not my module) the module was branched for 4.7/5 in Eclipse, by doing a CVS export of the HEAD copy of the module (to remove CVS directories) into a DRUPAL-4-7 checkout of contrib and doing an add/commit from there in Eclipse. I remember Jeff getting some message to the effect that "sticky tag/branch DRUPAL-4-7 taking effect" or something.

Although it's possible the cvs export was done at the command line, and the branching done in Eclipse. I'm not positive.

I've never used Eclipse so I'm not sure what options were used. :( I'll ask Jeff next time I see him.

webchick’s picture

But I should point out, for whatever it's worth, that the ViewCVS interface shows the branches as being there as expected:

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/sifr/
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/sifr/?only_wi...
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/sifr/?only_wi...

(yes I know it says "only_with_tag", but on the drop-down DRUPAL-5 and DRUPAL-4-7 are in the "Branches" option group.)

When I compare that with, say, project module (which one could probably assume the maintainer knows what he's doing wrt CVS ;)) they look the same:

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/project/

dww’s picture

@webchick, jjeff: that "method" is equivalent to what i described moshe doing in #8 above. who comes up with this stuff? ;) why such great pains to avoid a simple (well documented) command for adding a branch or a tag?

@toddy: i agree it's still possible, even if you do something reasonable like cvs tag -b ... on the command line, for a temporary failure to happen. as i said, the scripts that are handling this aren't being careful about checking for failures when talking to the DB, so it's possible that temporary communication problems are causing the DB update to fail, but the cvs command silently returns success.

whenever i have time, i'll look into the kinds of problems toddy had. i'm tempted to "won't fix" the implicit request to handle moshe/jjeff's creative method for making branches. ;) there's no reason for me and them to do extra work for that branching method, when far more simple methods already exist and work.

webchick’s picture

@derek: I think this method has been employed in the past for primarily the following reasons:

1. A lot of people are using GUIs. GUIs don't have an intuitive way of translating that CVS command to right-click "whatever"
2. People have been bitten before by forgetting the -b and ending up doing a tag instead, getting yelled at by the CVS folks or getting unexpected results when new files aren't in the 4.7 release.
3. It's simple and intuitive (even though it's technically more work) to say, "Add this module/theme to the rest of the DRUPAL-4-7 stuff."

In order to mentally make the leap to "I need to create a DRUPAL-4-7 branch for my module":

a) You need to know that DRUPAL-4-7 _is_ a branch.
b) You need to know the difference between tags and branches.
c) You need to know that the CVS command to branch has the word "tag" in it, _not_ branch.

It's little wonder people get confused and go for the first option. :P

I alluded to this when we were in Brussels at lunch that one day, but you'll find that a large portion of module and especially theme maintainers only know enough about CVS to get their modules listed in contrib, and that's it. cvs add/commit/update with all their various flags is a challenge for people not familiar with CVS already. Tagging and branching is adding another complexity level, and something which even more experienced users don't understand (I don't feel I fully understood it myself until I spent 30 hours helping you with the docs for the release system :)).

So you can won't fix it if you want, but I guarantee you that this will come up again and again.

At any rate, how do we fix it? If I issue the cvs tag -b command, will that do it? Or is something screwed up now that needs to be undone?

dww’s picture

i won't try to debate the merits of this "alternate" approach vs. the simple way, since that's obviously not the point. ;) agreed, many people approach CVS like it's some mystic black box, and you must mutter the right incantations for it to do its magic... alas for the triumph of superstition over reason.

as clearly (IMHO) explained here: http://drupal.org/handbook/cvs/introduction#branches-and-tags branches are tags. they're just a special kind of tag with different properties. other than writing the best customized docs for what drupalistas need to know about CVS and asking people to read them, what else am i supposed to do to help people get over their fear and out of their ignorance when it comes to CVS?

anyway, on to your question: "At any rate, how do we fix it?"

it's easy, we just add another record into the {cvs_tags} table on d.o for your project and the missing branch. if you give me a list of pairs of project nid and branch names that are in CVS but not showing up for adding new releases, i can easily fix the DB.

if you're right, and my email to the devel list has no effect, and people keep making branches the hard way, i suppose we'll have to change xcvs-commitinfo.php (or perhaps xcvs-loginfo.php) so that if it sees you committing to a given branch for a particular project, it tries to insert a (usually duplicate) entry into {cvs_tags} for that project/branch pair. this should hopefully catch this special case. it'll be more expensive, and 99.9% of the time, unnecessary, but the speed at which "cvs commit" returns success isn't the most important bottleneck in drupal development, and i suppose it would save the manual effort of repairing the {cvs_tags} table when people do unexpected/crazy things to add branches.

cheers,
-derek

dww’s picture

Status: Active » Needs review
FileSize
2.1 KB

*sigh* ;)

tested heavily on scratch.d.o and the /scratch/cvs/drupal-contrib repo. works great. it's sad that this is needed...

dww’s picture

Status: Needs review » Fixed

in IRC killes said this was RTBC.
committed to HEAD and DRUPAL-4-7--2
installed on d.o.

Anonymous’s picture

Status: Fixed » Closed (fixed)