Simple musings of a Drupal developer.

Drush beats CVS

By krs · July 30, 2009 · 8 Comments · 661 Views

I had checked out a bunch of modules fron CVS, but then I realized that CVS checkouts don't come with all the info such as version numbers, so I wanted to delete them and replace them with real copies. I used Drush and Bash, and here's how I did it.

Need to delete every CVS file from the sites/all/modules directory, and then replace each module with a fresh copy downloaded from drupal.org, and do it without ruining your SVN repository? "What's the difference?" you ask. Well, modules checked out directly from CVS don't get extra packaging info from drupal.org, and don't keep track of their own version numbers properly (you'll see a blank Version column on admin/build/modules).

So by getting a fresh copy from drupal.org, you get a proper .info file, and a LICENSE.txt file added for you. And it's a long module list? No problemo!

Assumptions - you have Drush installed and you're working with a checkout of an SVN repository.

cd to your modules directory, usually
cd examplesite/sites/all/modules


Update your modules to their latest versions - Drush is going to try and download the latest anyway, and you want them to match up.

Tell Drush to grab fresh copies of modules from drupal.org with:
find . -name CVS -depth 2 | sed 's/\// /g' | awk {'print $2'} | xargs drush dl
and watch the "Project xxx downloaded to ..." messages scroll by.

Get rid of all the CVS files with
find . -name CVS -prune -exec svn rm {} \;


Add all the new files (should just be a bunch of LICENSE.txt files) with
svn status | grep '^?' | xargs svn add
Then do a quick svn status - and you should see a bunch of Deletes on CVS files, Adding LICENSE.txt files, and Modifying any .info files

Last, SVN commit the whole bunch! yay!
svn commit -m "removed old CVS tags, redownloaded modules from drupal.org" .

--

edit: thanks to Joel for a better introduction

Filed in:
Tagged with: , , , , ,
posted by Derek "dww" Wright
Thu, 07/30/2009 - 7:17pm

Or, install CVS Deploy like you're supposed to when you checkout directly from CVS. Eye-wink


posted by Derek "dww" Wright
Thu, 07/30/2009 - 7:18pm

Your comment system ate my link... http://drupal.org/project/cvs_deploy

Enjoy,
-Derek


posted by deekayen
Thu, 07/30/2009 - 9:49pm

ditto on the CVS deploy module


posted by
Thu, 07/30/2009 - 10:42pm

the cvs_deploy module works great, but I prefer using drush and using one less module.


posted by MarkT
Fri, 07/31/2009 - 2:51am

Sorry, CVS beats Drush for installing modules. Especially if you want to develop.


posted by Jeremy Epstein
Mon, 08/03/2009 - 10:19pm

Why not have your cake and eat it too? My preferred strategy is to use CVS Deploy, and to checkout modules from CVS using Drush, like so:

drush dl --package-handler=cvs --destination=sites/all/modules/contrib module_name


posted by markb
Wed, 08/05/2009 - 2:49pm

i do the same thing as jeremy, but have also set up a bash alias to save typing:

alias dcvs='/usr/bin/php /path/to/drush.php --package-handler=cvs dl'


posted by
Thu, 08/13/2009 - 3:32pm

Thanks for the feedback!

A number of you (ok, everyone who cared to comment) seem to think that CVS + cvs_deploy or drush --package-handler=cvs is the way to go.

No one pointed out *why* those options are better though, so I'm inviting comments on the follow-up post (http://drupalhigh.onsugar.com/3774018) to collect some reasons and hopefully tips to improve workflow.


Post New Comment

If you are already an OnSugar member, or would like to receive email alerts as new comments are made, please login or register for OnSugar. Or connect with your Facebook account: .
The content of this field is kept private and will not be shown publicly.

About Me

Drupal.org username: kscheirer

subscribe

Drupal Cred

Drupal Camp Los Angeles 2009 - August 8-9th

Archive

November 2009
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
2930 
August 2009
SMTWTFS
 1
2345678
9101112131415
16171819202122
23242526272829
3031 
July 2009
SMTWTFS
 1234
567891011
12131415161718
19202122232425
262728293031