CVS guide for theme maintainers
A beginners notebook on creating his first theme Drupal project
Recently, I officially released a new theme for Drupal 5 called Ranch, and put it out there for all to download and use. These are my notes on some of the gotchas I encountered while getting set up for, and creating, a new theme project on Drupal.org.
CVS account on drupal.org
I already had an account on Drupal.org, so the very first thing I needed to do after I created my theme was to request CVS access so that I could contribute to drupal.org. I did this by going to http://drupal.org/cvs-application/requirements, reading the instructions there and filling out the application form which can be accessed from the bottom of that page.
Here are a couple of pointers for submitting your application:
- Have your theme up and running, so that you can submit a link to it in your application.
- It is good if the theme is valid, and looks good.
- Be thorough, but not overly effusive.
It seems that things go pretty quickly for contributors that have great looking valid themes, as they are really really looking for those right now!
Research and CVS
After getting signed up and approved (can take 15 minutes to one week, your mileage may vary according to how busy folks are) I dove into the vast array of information on Drupal.org on how to correctly CVS, make releases, branch, tag, etc. Luckily this is all very well documented. Get a good start at the CVS Quickstart page. Unfortunately, most of this documetation is geared towards module development, not themes, so sometimes you have to watch the code and modify it to work for themes.
One other resource that cleared up CVS, branching, tagging and some of what not to do, is http://www.angrydonuts.com/my_informal_take_on_using_the_ne where merlinofchaos explains things in a very well thought right up. Read up on that and meet me back here.
CVS first steps
The following, copied mostly from my bash command line history, documents the process, starting with creating your CVS structure on your local machine, and continuing on through CVS completion:
mkdir ~/Sites/contrib
cd ~/Sites/contrib/
export CVSROOT=:pserver:mycvsusername@cvs.drupal.org:/cvs/drupal-contrib
cvs login
cvs checkout -l contributions/themesClean up your directories first
WARNING - Don't use cvs checkout -l contributions/modules
At this point I had accidentally used cvs checkout -l contributions/modules instead of cvs checkout -l contributions/themes. I was, of course, working on a theme, so this didn't work. So I edited it back to where I removed everything, and started over with the contributions/themes. This tactic (removing and starting over) proved pretty handy thoughout. Also, make sure to use the -l option, this is REALLY important as it prevents you from downloading EVERY contribution under that directory.
Before you copy your files into the new CVS'd directory, you will really want to make sure that you have gotten rid of ALL of the extra files, hidden files, directories, and everything else you don't want in there. It's pretty difficult to rid yourself of this stuff later. Another thing I determined was a good idea for my first time, is that I kept all of my files for my relatively simple theme in one directory. This helped me out a great deal as I understand that CVS and recursion are not best buddies. Having only one directory made the CVS process easier.
cd contributions/themes/
cp -R /Library/WebServer/Documents/client/drupal-5.7/sites/default/themes/ranch ranch
cd ranch/
ls -alHere is where I was saying it was screwed up. See, CVS add isn't recursive, BUT it will add directories that are in the current directory. So, what ended up happening is that it added my images directory, and my sourcefiles directories which were both empty except for my .svn directories. CVS saw that there were the directories, but couldn't cvs delete them because there was more in the directory than CVS saw (namely my .svn directory).
To fix this, I went through a couple of rounds of remove, cvs delete, recreate, re-checkout, etc. until I decided to start from a checkout of my own contribution. When I removed everything and checked out my own contribution (after the branch statement below), it had empty images and sourcefiles directories (because that was all that CVS had known) and it was easilly able to cvs delete them.
Avoid this extra work by having a clean directory in the first place.
The first CVS commit
cd ..
cvs add ranch
cvs add ranch/*
cvs commit -m "Initial commit of the Ranch theme, a standards compliant CSS theme with easy to change color."This was the initial commit, which created the “HEAD” of my project. Neat! Too bad it’s screwed up at this point, but we fix it later. Next is were we create a branch called DRUPAL-5 - can’t have a project release without this!
The Quickstart states right here in the process the following: "If you have just made the initial commit to a new module, create a project on drupal.org referencing your module before proceeding with creating a branch or tag." See my notes below about creating a project as well.
Creating the first branch
cd ..
cvs tag -b DRUPAL-5 themes/ranch
cd themes/ranch/
cvs update -dP -r DRUPAL-5
cd ../../..
rm -Rf contributions/
cvs checkout -d ranch contributions/themes/ranch
cd ranch
cvs delete images
cvs delete sourcefiles
cvs commit -m "removing unused directories"
cvs statusCVS status at this point showed that I was in the right place at this point. I had finally slayed the directory problem.
Tagging the theme
cd ..
rm -Rf ranch/
cvs checkout -r DRUPAL-5 -d ranch contributions/themes/ranch/
cd ranch/
cvs tag DRUPAL-5--1-0This is where I made my first release tag, which is what makes the whole package process possible as I understand it. Done with CVS for now, YAY!
Make the project
Now that I had gotten an education from my CVS time with Drupal, it was time to actually create my Ranch project. I did this by going to Drupal.org, logging in, clicking on Create Content on the right sidebar, and selecting Project.
At this point I realized that I didn't have a good enough screenshot for the higher resolution image that goes on Drupal.org. I followed these guidelines: http://drupal.org/node/11637 and used that image on the Create Project page.
Add a release
Next, I finished filling out my Project page, then I went and created a release, which I did by going to the link in the right sidebar called My projects, and clicking on Add release under the Project links.
From there I selected the DRUPAL-5--1-0 CVS Identifier (I think, I don’t have a history on this part so corrections are solicited) and hit Next.
It was pretty self explanatory after that. Then, after waiting just a minute, because the Drupal script that updates the project page can take a couple of minutes, I checked and my project page was complete.
