2. Before we begin...
✤ This isn’t a “How to use Subversion” tutorial.
✤ 5 min. overview of Subversion
✤ Want to learn more? Subversion Handbook
✤ CVS: similar to Subversion, but conceptually different in places
3. Before we begin...
✤ Why are we doing this?
✤ Mixing CVS and Subversion: Hold on to your butts!
✤ Module recommendation: CVS Deploy
4. Shortcuts (core)
✤ Create or update ~/.bash_profile
export PATH=$PATH:/usr/local/bin
✤ Checking out Drupal core from Drupal CVS (OS X)
✤ Create the shortcut command, drcvs_core in /usr/local/bin/
#!/bin/bash
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -d $1 -r DRUPAL-$2 drupal
✤ Make the file executable
$ chmod ugo+x /usr/local/bin/drcvs_core
5. Shortcuts (module)
✤ Checking out modules from Drupal CVS
✤ Create the shortcut command, drcvs_module in /usr/local/bin/
#!/bin/bash
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-$2 -d $1
contributions/modules/$1
✤ Make the file executable
6. Shortcuts (theme)
✤ Checking out themes from Drupal CVS
✤ Create the shortcut command, drcvs_theme in /usr/local/bin/
#!/bin/bash
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-$2 -d $1
contributions/themes/$1
✤ Make the file executable
7. Shortcuts
✤ A cleanup shortcut, drcvs_cleanup
#!/bin/bash
for FILE in `svn status $1 | grep '?'`; do svn add $FILE; done;
for FILE in `svn status $1 | grep '!'`; do svn rm $FILE; done;
✤ Aack! WTF is that mess?!?!
1. Find any new files (‘?’) and add them to SVN
2. Find any files that were removed (‘!’) and remove them from SVN
8. A version controlled site from
scratch
✤ Navigate to a Subversion check into which you’ll put the new site
OR Create a (empty) home for your site in Subversion and check it
out elsewhere
✤ Check out Drupal core from CVS, then add to Subversion
✤ Check out modules / themes from CVS, then add to Subversion
✤ Updating modules or core
✤ Ignoring files
✤ Referencing external Subversion projects
9. Drupal core
✤ Checkout Drupal core (version 6.9 We’ll update to 6.10 in a bit...)
$ cd /path/to/subversion/branches/folder
$ drcvs_core cvs-demo 6-9
✤ Add to Subversion
$ svn add cvs-demo
$ svn commit -m "Adding drupal core for cvs demo site"
11. Modules & Themes
✤ Checkout theme
$ drcvs_theme zen 6--1-0
✤ Add / commit theme to Subversion
$ svn add zen
$ svn commit -m "Add Zen theme"
12. Updating from CVS
✤ Update Drupal core to 6.10
$ cd /path/to/drupal
$ cvs up -dP -r DRUPAL-6-10
$ drcvs_cleanup .
$ svn commit -m "Update to Drupal 6.10"
✤ Update Views to 6.x-2.5
$ cd /path/to/views
$ cvs up -dP -r DRUPAL-6--2-5
$ drcvs_cleanup .
$ svn commit -m "Update to Views 6.x-2.5"
13. Ignoring files
✤ Occasionally you’ll want Subversion to ignore files, i.e. settings.php
✤ Before you’ve added the file to Subversion
$ cd /path/to/sites/default
$ svn propedit svn:ignore .
# Add ‘settings.php’ to the first line of the file and save it
$ svn commit . -m "Ignore settings.php"
14. Referencing external Subversion
projects
✤ Create an external reference to ASU Zen theme
$ cd /path/to/themes
$ svn propedit svn:externals .
✤ Add the following to new line(s) in the file
asuzen https://opensource.asu.edu/svn/asuzen/branches/asuzen-6.x/
✤ Retrieve the external project and commit the change
$ svn up
$ svn commit -m "Add external reference to ASU Zen theme"